Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'tests/clar_libgit2.h')
-rw-r--r--tests/clar_libgit2.h18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/clar_libgit2.h b/tests/clar_libgit2.h
index da37bd655..0744877cb 100644
--- a/tests/clar_libgit2.h
+++ b/tests/clar_libgit2.h
@@ -78,6 +78,24 @@ void clar__assert_equal_file(
const char *file,
int line);
+GIT_INLINE(void) clar__assert_equal_oid(
+ const char *file, int line, const char *desc,
+ const git_oid *one, const git_oid *two)
+{
+ if (git_oid_cmp(one, two)) {
+ char err[] = "\"........................................\" != \"........................................\"";
+
+ git_oid_fmt(&err[1], one);
+ git_oid_fmt(&err[47], two);
+
+ clar__fail(file, line, desc, err, 1);
+ }
+}
+
+#define cl_assert_equal_oid(one, two) \
+ clar__assert_equal_oid(__FILE__, __LINE__, \
+ "OID mismatch: " #one " != " #two, (one), (two))
+
/*
* Some utility macros for building long strings
*/