GNOME Bugzilla – Bug 793856
Use g_assert_[non]null() in glib-networking's testsuite
Last modified: 2018-03-22 21:49:21 UTC
Use g_assert_[non]null() in glib-networking's testsuite, as suggested by Philip in bug #793712: "g_assert() will be optimised out if compiled with G_DISABLE_ASSERT. g_assert_null() won’t (and will give a more informative error message)." All uses of g_assert() could stand to be reviewed.
Patch depends on the tests in bug #793712
Created attachment 368975 [details] [review] Review use of g_assert() in tests Let's use the special testing macros instead.
Note: zero changes needed in the proxy tests!
Review of attachment 368975 [details] [review]: Looks good apart from one potential improvement. ::: tls/tests/certificate.c @@ +168,2 @@ g_assert_cmpuint (der->len, ==, test->cert_der->len); + g_assert_cmpint (memcmp (der->data, test->cert_der->data, der->len), ==, 0); g_assert_cmpmem()!
Forgot about this.
Attachment 368975 [details] pushed as 345a16f - Review use of g_assert() in tests