From e6ef41119258799ca3720c5f2c5af4db327b2720 Mon Sep 17 00:00:00 2001 From: Pierre-Marc Fournier Date: Tue, 2 Mar 2010 15:04:07 -0500 Subject: [PATCH] tests: add test-libmallocwrap --- configure.ac | 1 + tests/Makefile.am | 2 +- tests/test-libmallocwrap/Makefile.am | 5 +++++ tests/test-libmallocwrap/prog.c | 28 ++++++++++++++++++++++++++++ 4 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 tests/test-libmallocwrap/Makefile.am create mode 100644 tests/test-libmallocwrap/prog.c diff --git a/configure.ac b/configure.ac index f0c99e6..e428a49 100644 --- a/configure.ac +++ b/configure.ac @@ -120,6 +120,7 @@ AC_CONFIG_FILES([ tests/simple_include/Makefile tests/snprintf/Makefile tests/test-nevents/Makefile + tests/test-libmallocwrap/Makefile libmallocwrap/Makefile libinterfork/Makefile ustd/Makefile diff --git a/tests/Makefile.am b/tests/Makefile.am index eca4e20..2429332 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -1,3 +1,3 @@ -SUBDIRS = hello hello2 basic basic_long fork simple_include snprintf test-nevents +SUBDIRS = hello hello2 basic basic_long fork simple_include snprintf test-nevents test-libmallocwrap noinst_SCRIPTS = test_loop runtests trace_matches diff --git a/tests/test-libmallocwrap/Makefile.am b/tests/test-libmallocwrap/Makefile.am new file mode 100644 index 0000000..502d6c4 --- /dev/null +++ b/tests/test-libmallocwrap/Makefile.am @@ -0,0 +1,5 @@ +#AM_CPPFLAGS = -I$(top_srcdir)/include + +noinst_PROGRAMS = prog +prog_SOURCES = prog.c +prog_LDADD = $(top_builddir)/libust/libust.la $(top_builddir)/libust-initializer.o diff --git a/tests/test-libmallocwrap/prog.c b/tests/test-libmallocwrap/prog.c new file mode 100644 index 0000000..6958a77 --- /dev/null +++ b/tests/test-libmallocwrap/prog.c @@ -0,0 +1,28 @@ +#include +#include + +#define N_ITER 1000 + +int main() +{ + int i; + const char teststr[] = "Hello World! 1234567890abc"; + void *ptrs[N_ITER]; + + for(i=0; i