scripts/unit-test: Add new valgrind checks
These cause spurious failures on powerpc systems currently, so we should
skip valgrind if they don't work in the trivial expected working case.
==5266== Conditional jump or move depends on uninitialised value(s)^M
==5266== at 0x4E92764: __dcigettext (dcigettext.c:697)^M
==5266== by 0x4E900E7: dcgettext (dcgettext.c:47)^M
==5266== by 0x4F08AC7: strerror_r (_strerror.c:71)
Change-Id: Ib94c19688b446bc9cf780571260d5f6c922e6fb8
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/scripts/unit-test.py b/scripts/unit-test.py
index a92689e..5ee94ec 100755
--- a/scripts/unit-test.py
+++ b/scripts/unit-test.py
@@ -559,6 +559,8 @@
src = 'unit-test-vg.c'
exe = './unit-test-vg'
with open(src, 'w') as h:
+ h.write('#include <errno.h>\n')
+ h.write('#include <stdio.h>\n')
h.write('#include <stdlib.h>\n')
h.write('#include <string.h>\n')
h.write('int main() {\n')
@@ -566,6 +568,9 @@
h.write('strcpy(heap_str, "RandString");\n')
h.write('int res = strcmp("RandString", heap_str);\n')
h.write('free(heap_str);\n')
+ h.write('char errstr[64];\n')
+ h.write('strerror_r(EINVAL, errstr, sizeof(errstr));\n')
+ h.write('printf("%s\\n", errstr);\n')
h.write('return res;\n')
h.write('}\n')
try: