5 #include "../memcheck.h"
7 /* This test checks that VALGRIND_CHECK_MEM_IS_DEFINED correctly
8 reports two errors when presented with a buffer which contains both
9 undefined data and some out of range component(s), and the
10 undefined data appears before the out of range components. Should
11 report 5 errors in total: the first test should report 2, the rest
18 fprintf(stderr
, "\n---- part defined, address error at end ----\n\n");
20 a
[0] = a
[1] = a
[2] = a
[3] = a
[6] = a
[7] = 'x';
21 (void) VALGRIND_CHECK_MEM_IS_DEFINED(a
, 9);
24 fprintf(stderr
, "\n---- part defined, address error at start ----\n\n");
26 a
[0] = a
[1] = a
[2] = a
[3] = a
[6] = a
[7] = 'x';
27 (void) VALGRIND_CHECK_MEM_IS_DEFINED(a
-1, 9);
30 fprintf(stderr
, "\n---- fully defined, address error at end ----\n\n");
32 a
[0] = a
[1] = a
[2] = a
[3] = a
[4] = a
[5] = a
[6] = a
[7] = 'x';
33 (void) VALGRIND_CHECK_MEM_IS_DEFINED(a
, 9);
36 fprintf(stderr
, "\n---- fully defined, address error at start ----\n\n");
38 a
[0] = a
[1] = a
[2] = a
[3] = a
[4] = a
[5] = a
[6] = a
[7] = 'x';
39 (void) VALGRIND_CHECK_MEM_IS_DEFINED(a
-1, 9);