gtestutils: add g_assert_cmpmem()

Add a test macro to compare two buffers (which are not already known
to be the same length) for equality.

https://bugzilla.gnome.org/show_bug.cgi?id=754283
This commit is contained in:
Dan Winship
2014-12-03 05:57:29 -05:00
parent 367f36d630
commit 9f2e3f6b72
17 changed files with 120 additions and 103 deletions

View File

@@ -835,8 +835,7 @@ test_peer (void)
&len2,
&error);
g_assert_no_error (error);
g_assert_cmpint (len, ==, len2);
g_assert (memcmp (buf, buf2, len) == 0);
g_assert_cmpmem (buf, len, buf2, len2);
g_free (buf2);
g_free (buf);
}