Commit Graph

4 Commits

Author SHA1 Message Date
Nick Alcock
b84ffc176d libctf: fix testsuite bugs revealed by -Wall
Most of these are harmless, but some of the type confusions and especially
a missing ctf_strerror() on an error path were actual bugs that could
have resulted in test failures crashing rather than printing an error
message.

libctf/
	* testsuite/libctf-lookup/enumerator-iteration.c: Fix type
        confusion, signedness confusion and a missing ctf_errmsg().
	* testsuite/libctf-regression/libctf-repeat-cu-main.c: Return 0 from
        the test function.
	* testsuite/libctf-regression/open-error-free.c: Fix signedness
        confusion.
	* testsuite/libctf-regression/zrewrite.c: Remove unused label.
2024-06-19 15:51:24 +01:00
Alan Modra
122f6f14b1 buffer overflow in libctf tests
* testsuite/libctf-regression/gzrewrite.c (main): Don't overflow
       "a" buffer in "after adding types" check.
       * testsuite/libctf-regression/zrewrite.c (main): Likewise.
2024-04-24 09:33:03 +09:30
Alan Modra
02fa4bbec1 Error compiling libctf-regression test
Seen on 64-bit targets.
ERROR: compilation of lookup program .../libctf-regression/gzrewrite.c failed

	* testsuite/libctf-regression/gzrewrite.c (main): Use %zu to
	print size_t values.
	* testsuite/libctf-regression/zrewrite.c (main): Likewise.
2024-04-20 10:36:37 +09:30
Nick Alcock
3b5e2d0e8d libctf: add rewriting tests
Now there's a chance of it actually working, we can add more tests for
the long-broken dict read-and-rewrite cases.  This is the first ever
test for the (rarely-used, unpleasant, and until recently completely
broken) ctf_gzwrite function.

libctf/

	* testsuite/libctf-regression/gzrewrite*: New test.
	* testsuite/libctf-regression/zrewrite*: Likewise.
2024-04-19 16:14:47 +01:00