From d2bd46b27e5357b983388d081b559863d7f1be9d Mon Sep 17 00:00:00 2001 From: Paul Floyd Date: Mon, 3 Nov 2025 21:43:17 +0100 Subject: [PATCH] regtest: rename memcheck wcpncpy The perl script filter_memcheck removes callstack elements that are not of interest and changes vg_replace_strmem.c/vg_replace_malloc.c line numbers to '...'. It protects lines containing the testcase name. When the testcase name is the same as the C function being tested that's not really what we want. My perl isn't really good enough to be able to only change the line numbers when it is a 'tool file'. Instead I'm renaming the testcase. --- memcheck/tests/Makefile.am | 4 ++-- memcheck/tests/wcpncpy.stderr.exp | 19 ------------------- memcheck/tests/wcpncpy.vgtest | 3 --- memcheck/tests/{wcpncpy.c => wcpncpy1.c} | 0 memcheck/tests/wcpncpy1.stderr.exp | 19 +++++++++++++++++++ memcheck/tests/wcpncpy1.vgtest | 3 +++ 6 files changed, 24 insertions(+), 24 deletions(-) delete mode 100644 memcheck/tests/wcpncpy.stderr.exp delete mode 100644 memcheck/tests/wcpncpy.vgtest rename memcheck/tests/{wcpncpy.c => wcpncpy1.c} (100%) create mode 100644 memcheck/tests/wcpncpy1.stderr.exp create mode 100644 memcheck/tests/wcpncpy1.vgtest diff --git a/memcheck/tests/Makefile.am b/memcheck/tests/Makefile.am index 755f422ee..6343b1b7c 100644 --- a/memcheck/tests/Makefile.am +++ b/memcheck/tests/Makefile.am @@ -461,7 +461,7 @@ EXTRA_DIST = \ vcpu_fnfns.stdout.exp-darwin vcpu_fnfns.stdout.exp-solaris \ vcpu_fnfns.stdout.exp-illumos \ vcpu_fnfns.stderr.exp vcpu_fnfns.vgtest \ - wcpncpy.stderr.exp wcpncpy.vgtest \ + wcpncpy1.stderr.exp wcpncpy1.vgtest \ wcs.vgtest wcs.stderr.exp wcs.stdout.exp \ wcscat.vgtest wcscat.stderr.exp wcscat.stdout.exp \ wcsncpy.vgtest wcsncpy.stderr.exp \ @@ -656,7 +656,7 @@ check_PROGRAMS += threadname endif if HAVE_WCPNCPY -check_PROGRAMS += wcpncpy +check_PROGRAMS += wcpncpy1 endif # are there still pre-C99 C compilers? diff --git a/memcheck/tests/wcpncpy.stderr.exp b/memcheck/tests/wcpncpy.stderr.exp deleted file mode 100644 index 0ff9e5c74..000000000 --- a/memcheck/tests/wcpncpy.stderr.exp +++ /dev/null @@ -1,19 +0,0 @@ -Conditional jump or move depends on uninitialised value(s) - at 0x........: wcpncpy (vg_replace_strmem.c:2427) - by 0x........: main (wcpncpy.c:14) - -Invalid write of size 4 - at 0x........: wcpncpy (vg_replace_strmem.c:2427) - by 0x........: main (wcpncpy.c:27) - Address 0x........ is 20 bytes inside a block of size 22 alloc'd - at 0x........: malloc (vg_replace_malloc.c:...) - by 0x........: main (wcpncpy.c:10) - -Source and destination overlap in wcpncpy(0x........, 0x........) - at 0x........: wcpncpy (vg_replace_strmem.c:2427) - by 0x........: main (wcpncpy.c:35) - -Source and destination overlap in wcpncpy(0x........, 0x........) - at 0x........: wcpncpy (vg_replace_strmem.c:2427) - by 0x........: main (wcpncpy.c:43) - diff --git a/memcheck/tests/wcpncpy.vgtest b/memcheck/tests/wcpncpy.vgtest deleted file mode 100644 index f4edd4b8d..000000000 --- a/memcheck/tests/wcpncpy.vgtest +++ /dev/null @@ -1,3 +0,0 @@ -prereq: test -e ./wcpncpy -prog: wcpncpy -vgopts: -q diff --git a/memcheck/tests/wcpncpy.c b/memcheck/tests/wcpncpy1.c similarity index 100% rename from memcheck/tests/wcpncpy.c rename to memcheck/tests/wcpncpy1.c diff --git a/memcheck/tests/wcpncpy1.stderr.exp b/memcheck/tests/wcpncpy1.stderr.exp new file mode 100644 index 000000000..1b7fd22b8 --- /dev/null +++ b/memcheck/tests/wcpncpy1.stderr.exp @@ -0,0 +1,19 @@ +Conditional jump or move depends on uninitialised value(s) + at 0x........: wcpncpy (vg_replace_strmem.c:...) + by 0x........: main (wcpncpy1.c:14) + +Invalid write of size 4 + at 0x........: wcpncpy (vg_replace_strmem.c:...) + by 0x........: main (wcpncpy1.c:27) + Address 0x........ is 20 bytes inside a block of size 22 alloc'd + at 0x........: malloc (vg_replace_malloc.c:...) + by 0x........: main (wcpncpy1.c:10) + +Source and destination overlap in wcpncpy(0x........, 0x........) + at 0x........: wcpncpy (vg_replace_strmem.c:...) + by 0x........: main (wcpncpy1.c:35) + +Source and destination overlap in wcpncpy(0x........, 0x........) + at 0x........: wcpncpy (vg_replace_strmem.c:...) + by 0x........: main (wcpncpy1.c:43) + diff --git a/memcheck/tests/wcpncpy1.vgtest b/memcheck/tests/wcpncpy1.vgtest new file mode 100644 index 000000000..052393a39 --- /dev/null +++ b/memcheck/tests/wcpncpy1.vgtest @@ -0,0 +1,3 @@ +prereq: test -e ./wcpncpy1 +prog: wcpncpy1 +vgopts: -q -- 2.47.3