4.19.0: test suite fails in env with glib build with disabled asserts
Looks like exo test suite uses incorrect glib asserts functions which should not be used in test suite: From https://www.manpagez.com/html/glib/glib-2.46.2/glib-Testing.php#g-assert > ### g_assert() > > #define g_assert(expr) > > Debugging macro to terminate the application if the assertion fails. If the assertion fails (i.e. the expression is not true), an error message is logged and the application is terminated. > > The macro can be turned off in final releases of code by defining `G_DISABLE_ASSERT` when compiling the application. Instead `g_assert ()` should be used other `g_assert_* ()` assertions ```plaintext [tkloczko@pers-jacek exo-4.19.0]$ grep g_assert tests/* tests/test-exo-noop.c: g_assert (exo_noop_one () == 1); tests/test-exo-noop.c: g_assert (exo_noop_zero () == 0); tests/test-exo-noop.c: g_assert (exo_noop_null () == NULL); tests/test-exo-noop.c: g_assert (exo_noop_true () == TRUE); tests/test-exo-noop.c: g_assert (exo_noop_false () == FALSE); tests/test-exo-string.c: g_assert_cmpstr (res, ==, "thisisasample"); tests/test-exo-string.c: g_assert_cmpstr (res, ==, "m_nemonic"); tests/test-exo-string.c: g_assert (!exo_str_is_equal ("a", NULL)); tests/test-exo-string.c: g_assert (!exo_str_is_equal (NULL, "b")); tests/test-exo-string.c: g_assert (!exo_str_is_equal ("a", "abcde")); tests/test-exo-string.c: g_assert (!exo_str_is_equal (p, "a")); tests/test-exo-string.c: g_assert (exo_str_is_equal (NULL, NULL)); tests/test-exo-string.c: g_assert (exo_str_is_equal ("test", "test")); tests/test-exo-string.c: g_assert (exo_str_is_equal (p, p)); tests/test-exo-string.c: g_assert (exo_str_is_empty (p)); tests/test-exo-string.c: g_assert (exo_str_is_empty (p)); tests/test-exo-string.c: g_assert (!exo_str_is_empty (p)); tests/test-exo-string.c: g_assert_cmpstr (res, ==, "You should eat pizza every day."); tests/test-exo-string.c: g_assert_cmpstr (res, ==, "You should eat."); tests/test-exo-string.c: g_assert (res == NULL); tests/test-exo-string.c: g_assert_cmpstr (res, ==, test); tests/test-exo-string.c: g_assert_cmpuint (g_strv_length (res), ==, 2); tests/test-exo-string.c: g_assert_cmpstr (res[i], ==, input[i]); tests/test-exo-string.c: g_assert_cmpuint (g_strv_length (res), ==, g_strv_length (input)); tests/test-exo-string.c: g_assert_cmpstr (res[i], ==, input[i]); tests/test-exo-string.c: g_assert (res == NULL); tests/test-exo-string.c: g_assert (res == NULL); ``` Result of above is that test suite fails with: ```plaintext ====================================== exo 4.19.0: tests/test-suite.log ====================================== # TOTAL: 2 # PASS: 0 # SKIP: 0 # XFAIL: 0 # FAIL: 2 # XPASS: 0 # ERROR: 0 .. contents:: :depth: 2 FAIL: test-exo-noop =================== Tests were compiled with G_DISABLE_ASSERT and are likely no-ops. Aborting. FAIL test-exo-noop (exit status: 1) FAIL: test-exo-string ===================== Tests were compiled with G_DISABLE_ASSERT and are likely no-ops. Aborting. FAIL test-exo-string (exit status: 1) ============================================================================ Testsuite summary for exo 4.19.0 ============================================================================ # TOTAL: 2 # PASS: 0 # SKIP: 0 # XFAIL: 0 # FAIL: 2 # XPASS: 0 # ERROR: 0 ============================================================================ See tests/test-suite.log Please report to https://gitlab.xfce.org/xfce/exo ============================================================================ make[3]: *** [Makefile:860: test-suite.log] Error 1 ```
issue