GNOME Bugzilla – Bug 755126
testattributes fails when built with --disable-debug
Last modified: 2015-10-04 03:43:49 UTC
Building latest pango on Debian revealed this testcase problem: FAIL: testattributes ==================== /attributes/basic: OK /attributes/equal: OK /attributes/list/basic: OK /attributes/list/change: OK /attributes/list/splice: OK /attributes/list/filter: OK /attributes/iter/basic: ** ERROR:/build/pango1.0-1.37.5/./tests/testattributes.c:392:test_iter: assertion failed (start == 10): (0 == 10) FAIL testattributes (exit status: 134) This failure occurs (only) when built with --disable-debug !! Running gdb on debian/build/udeb/tests/.libs/lt-testattributes seems to indicate the _range, _next, _range calls made at https://git.gnome.org/browse/pango/tree/tests/testattributes.c#n387 have been reordered into _next, _range, _range.
Created attachment 312253 [details] [review] tests: testattributes needs assertions enabled This test failed when configured with --disable-debug since assertions would get disabled. Don't allow disabling them when building this tests as it relies on assertions.
Hello Matthias Clasen. Adding you to CC for this bug report because you seem to be the original author of the test ( https://git.gnome.org/browse/pango/commit/?id=b137e7b099a1 ) Could you please have a look and give me a thumbs up for ok to push my trivial patch?
A better fix would be to replace all instances of g_assert with g_assert_true.
I was considering adding -UG_DISABLE_ASSERT to tests/Makefile.am which I think would avoid future problems more efficiently, but went for adding #undef in the source file to follow the already existing pattern used in other tests. I'll look at making a new version.... Thanks for reviewing.