After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 793856 - Use g_assert_[non]null() in glib-networking's testsuite
Use g_assert_[non]null() in glib-networking's testsuite
Status: RESOLVED FIXED
Product: glib
Classification: Platform
Component: network
2.55.x
Other Linux
: Normal normal
: ---
Assigned To: gtkdev
gtkdev
Depends on:
Blocks:
 
 
Reported: 2018-02-26 19:30 UTC by Michael Catanzaro
Modified: 2018-03-22 21:49 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Review use of g_assert() in tests (43.05 KB, patch)
2018-02-26 20:08 UTC, Michael Catanzaro
committed Details | Review

Description Michael Catanzaro 2018-02-26 19:30:19 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.
Comment 1 Michael Catanzaro 2018-02-26 20:07:04 UTC
Patch depends on the tests in bug #793712
Comment 2 Michael Catanzaro 2018-02-26 20:08:37 UTC
Created attachment 368975 [details] [review]
Review use of g_assert() in tests

Let's use the special testing macros instead.
Comment 3 Michael Catanzaro 2018-02-26 20:11:40 UTC
Note: zero changes needed in the proxy tests!
Comment 4 Philip Withnall 2018-02-27 10:58:31 UTC
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()!
Comment 5 Michael Catanzaro 2018-03-17 03:31:23 UTC
Forgot about this.
Comment 6 Michael Catanzaro 2018-03-22 21:49:17 UTC
Attachment 368975 [details] pushed as 345a16f - Review use of g_assert() in tests