|
From: <sv...@va...> - 2008-04-20 08:29:01
|
Author: bart Date: 2008-04-20 09:29:04 +0100 (Sun, 20 Apr 2008) New Revision: 7894 Log: Added regression test for drd's memory allocation replacement functions. Added: trunk/exp-drd/tests/memory_allocation.c trunk/exp-drd/tests/memory_allocation.stderr.exp trunk/exp-drd/tests/memory_allocation.vgtest Modified: trunk/exp-drd/tests/Makefile.am Modified: trunk/exp-drd/tests/Makefile.am =================================================================== --- trunk/exp-drd/tests/Makefile.am 2008-04-19 15:20:01 UTC (rev 7893) +++ trunk/exp-drd/tests/Makefile.am 2008-04-20 08:29:04 UTC (rev 7894) @@ -40,6 +40,8 @@ matinv.stderr.exp \ matinv.stdout.exp \ matinv.vgtest \ + memory_allocation.stderr.exp \ + memory_allocation.vgtest \ omp_matinv.stderr.exp \ omp_matinv.stdout.exp \ omp_matinv.vgtest \ @@ -155,6 +157,7 @@ hg06_readshared \ linuxthreads_det \ matinv \ + memory_allocation \ pth_barrier \ pth_broadcast \ pth_cond_race \ @@ -228,6 +231,9 @@ matinv_SOURCES = matinv.c matinv_LDADD = -lpthread -lm +memory_allocation_SOURCES = memory_allocation.c +memory_allocation_LDADD = -lpthread -lm + pth_barrier_SOURCES = pth_barrier.c pth_barrier_LDADD = -lpthread Added: trunk/exp-drd/tests/memory_allocation.c =================================================================== --- trunk/exp-drd/tests/memory_allocation.c (rev 0) +++ trunk/exp-drd/tests/memory_allocation.c 2008-04-20 08:29:04 UTC (rev 7894) @@ -0,0 +1,15 @@ +/* Repeatedly allocate and free memory. Tests whether drd */ +/* really frees memory allocated by a client. See also */ +/* http://bugs.kde.org/show_bug.cgi?id=161036 */ + +#include <stdlib.h> + +int main() +{ + int i; + for (i = 0; i < 100000; i++) + { + free(malloc(40960)); + } + return 0; +} Added: trunk/exp-drd/tests/memory_allocation.stderr.exp =================================================================== --- trunk/exp-drd/tests/memory_allocation.stderr.exp (rev 0) +++ trunk/exp-drd/tests/memory_allocation.stderr.exp 2008-04-20 08:29:04 UTC (rev 7894) @@ -0,0 +1,3 @@ + + +ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0) Added: trunk/exp-drd/tests/memory_allocation.vgtest =================================================================== --- trunk/exp-drd/tests/memory_allocation.vgtest (rev 0) +++ trunk/exp-drd/tests/memory_allocation.vgtest 2008-04-20 08:29:04 UTC (rev 7894) @@ -0,0 +1 @@ +prog: memory-allocation |