projects
/
projects
/
chimara
/
chimara.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
ad091d0
)
Print more informative assert message
author
Philip Chimento
<philip.chimento@gmail.com>
Sat, 26 Oct 2013 05:24:28 +0000
(22:24 -0700)
committer
Philip Chimento
<philip.chimento@gmail.com>
Sat, 26 Oct 2013 05:24:28 +0000
(22:24 -0700)
ASSERT_EQUAL() is for int-like types that will print with %d.
tests/unit/glkunit.h
patch
|
blob
|
history
diff --git
a/tests/unit/glkunit.h
b/tests/unit/glkunit.h
index 3828987b739c2fc6b73f20e8d1bc3f5cc09dbcd8..e50d19fc820cf97e97e1d996fb0c213ced1475a1 100644
(file)
--- a/
tests/unit/glkunit.h
+++ b/
tests/unit/glkunit.h
@@
-15,7
+15,10
@@
#define SUCCEED _BEGIN return 1; _END
#define ASSERT(expr) _ASSERT(expr, "%s", #expr)
-#define ASSERT_EQUAL(expected, actual) _ASSERT((expected) == (actual), "%s == %s", #expected, #actual);
+/* This macro is meant for int-like things that can print with %d */
+#define ASSERT_EQUAL(expected, actual) _ASSERT((expected) == (actual), \
+ "%s == %s (expected %d, was %d)", \
+ #actual, #expected, expected, actual);
struct TestDescription {
char *name;