convert: test failure on NetBSD
Submitted by Thomas Klausner
On NetBSD, the convert self test fails:
PASS: convert 2 /conversion/iconv-state ERROR: convert - too few tests run (expected 7, got 2) ERROR: convert - exited with status 134 (terminated by signal 6?)
Running glib/tests/convert directly, I see:
/conversion/no-conv: OK /conversion/iconv-state: OK /conversion/illegal-sequence: ** ERROR:convert.c:82:test_one_half: assertion failed (error == (g_convert_error, 1)): error is NULL Abort
When I comment out the assertions in line 82, it fails again later in the same function:
/conversion/no-conv: OK /conversion/iconv-state: OK /conversion/illegal-sequence: ** ERROR:convert.c:98:test_one_half: assertion failed (out == "a"): ("?" == "a") Abort
When I comment out these assertions as well, the test program succeeds.
AIU, the test wants to convert the ISO-8859-1 or -15 sequence \xc2\xbd to UTF-8 and expects it to fail. I'm not sure why that is so, but on NetBSD it fails differently than expected: The output buffer contains a single question mark "?".
NetBSD does not use libiconv but has its own implementation. Perhaps the return value handling is not identical and this leads to that result.
The NetBSD man page for iconv() is at http://netbsd.gw.com/cgi-bin/man-cgi?iconv+3+NetBSD-current