g_assert_true(), g_assert_false(), g_assert_null(), and
g_assert_nonnull() simply printed out the expression they were
checking, without any further explanation of what went wrong. (In
particular, "g_assert_true(x)" and "g_assert_false(x)" would both
print the same thing on failure.) Add a little bit more context.
https://bugzilla.gnome.org/show_bug.cgi?id=724385
#err, err, dom, c); } while (0)
#define g_assert_true(expr) do { if G_LIKELY (expr) ; else \
g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
#err, err, dom, c); } while (0)
#define g_assert_true(expr) do { if G_LIKELY (expr) ; else \
g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
+ "'" #expr "' should be TRUE"); \
} while (0)
#define g_assert_false(expr) do { if G_LIKELY (!(expr)) ; else \
g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
} while (0)
#define g_assert_false(expr) do { if G_LIKELY (!(expr)) ; else \
g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
+ "'" #expr "' should be FALSE"); \
} while (0)
#define g_assert_null(expr) do { if G_LIKELY ((expr) == NULL) ; else \
g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
} while (0)
#define g_assert_null(expr) do { if G_LIKELY ((expr) == NULL) ; else \
g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
+ "'" #expr "' should be NULL"); \
} while (0)
#define g_assert_nonnull(expr) do { if G_LIKELY ((expr) != NULL) ; else \
g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
} while (0)
#define g_assert_nonnull(expr) do { if G_LIKELY ((expr) != NULL) ; else \
g_assertion_message (G_LOG_DOMAIN, __FILE__, __LINE__, G_STRFUNC, \
+ "'" #expr "' should not be NULL"); \
} while (0)
#ifdef G_DISABLE_ASSERT
#define g_assert_not_reached() do { (void) 0; } while (0)
} while (0)
#ifdef G_DISABLE_ASSERT
#define g_assert_not_reached() do { (void) 0; } while (0)