summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-09-16 15:08:35 -0700
committerRussell Belfer <rb@github.com>2013-09-17 09:31:46 -0700
commitf60ed4e6495b8bf68d0604335672e6f300330b3b (patch)
treeb4479ec3ad261bcac13493ee3f5ad45d15dfdda2
parenteefc32d54944ead5a5e3041c1b1f6c8c946cc014 (diff)
downloadlibgit2-f60ed4e6495b8bf68d0604335672e6f300330b3b.tar.gz
Update clar and recreate cl_assert_equal_sz
This updates clar to the version without cl_assert_equal_sz and then adds a new version of that macro the clar_libgit2.h. The new version works around a strange issue that seemed to be arising on release builds with VS 10 64-bit builds.
-rw-r--r--tests-clar/clar.h1
-rw-r--r--tests-clar/clar_libgit2.h5
2 files changed, 5 insertions, 1 deletions
diff --git a/tests-clar/clar.h b/tests-clar/clar.h
index c40bc7ac9..e1f244eba 100644
--- a/tests-clar/clar.h
+++ b/tests-clar/clar.h
@@ -68,7 +68,6 @@ void cl_fixture_cleanup(const char *fixture_name);
#define cl_assert_equal_p(p1,p2) clar__assert_equal(__FILE__,__LINE__,"Pointer mismatch: " #p1 " != " #p2, 1, "%p", (p1), (p2))
-#define cl_assert_equal_sz(sz1,sz2) clar__assert_equal(__FILE__,__LINE__,#sz1 " != " #sz2, 1, "%"PRIuZ, (size_t)(sz1), (size_t)(sz2))
void clar__fail(
const char *file,
diff --git a/tests-clar/clar_libgit2.h b/tests-clar/clar_libgit2.h
index f2d9c4d0b..c37306bc4 100644
--- a/tests-clar/clar_libgit2.h
+++ b/tests-clar/clar_libgit2.h
@@ -43,6 +43,11 @@ GIT_INLINE(void) clar__assert_in_range(
}
}
+#define cl_assert_equal_sz(sz1,sz2) do { \
+ size_t __sz1 = (sz1), __sz2 = (sz2); \
+ clar__assert_equal(__FILE__,__LINE__,#sz1 " != " #sz2, 1, "%"PRIuZ, __sz1, __sz2); \
+} while (0)
+
#define cl_assert_in_range(L,V,H) \
clar__assert_in_range((L),(V),(H),__FILE__,__LINE__,"Range check: " #V " in [" #L "," #H "]", 1)