summaryrefslogtreecommitdiff
path: root/egg/egg-testing.h
diff options
context:
space:
mode:
authorStef Walter <stefw@gnome.org>2012-03-10 07:57:41 +0100
committerStef Walter <stefw@gnome.org>2012-04-07 16:44:27 +0200
commit5c4a86255897206875d72fee0c41e657dce3e39f (patch)
treebe8ff4a2950aec3006a6c8310932503b549556a0 /egg/egg-testing.h
parent46748de8fc812dbc384e47b5910d522f57bbc79c (diff)
downloadgnome-keyring-5c4a86255897206875d72fee0c41e657dce3e39f.tar.gz
Bring over new egg'd components from gcr
* Updated ASN.1, armor, bytes, openssl, etc.
Diffstat (limited to 'egg/egg-testing.h')
-rw-r--r--egg/egg-testing.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/egg/egg-testing.h b/egg/egg-testing.h
index 8dca0864..5b4c911f 100644
--- a/egg/egg-testing.h
+++ b/egg/egg-testing.h
@@ -37,6 +37,13 @@
G_STRFUNC, #a "[" #na"] " #cmp " " #b "[" #nb "]", \
__p1, __n1, #cmp, __p2, __n2); } while (0)
+#define egg_assert_cmpbytes(a, cmp, b, nb) \
+ do { gpointer __p1 = (gpointer)(a); gconstpointer __p2 = (b); gsize __n2 = (nb); \
+ if (egg_bytes_get_size (__p1) cmp __n2 && memcmp (egg_bytes_get_data (__p1), __p2, __n2) cmp 0) ; else \
+ egg_assertion_message_cmpmem (G_LOG_DOMAIN, __FILE__, __LINE__, \
+ G_STRFUNC, #a " " #cmp " " #b, \
+ egg_bytes_get_data (__p1), egg_bytes_get_size(__p1), #cmp, __p2, __n2); } while (0)
+
void egg_assertion_message_cmpmem (const char *domain, const char *file,
int line, const char *func,
const char *expr, gconstpointer arg1,