8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
cl_assert_equal_oidstr
1 parent cf19ddc commit fddfca3Copy full SHA for fddfca3
tests/clar/clar_libgit2.h
@@ -166,10 +166,27 @@ GIT_INLINE(void) clar__assert_equal_oid(
166
}
167
168
169
+GIT_INLINE(void) clar__assert_equal_oidstr(
170
+ const char *file, const char *func, int line, const char *desc,
171
+ const char *one_str, const git_oid *two)
172
+{
173
+ git_oid one;
174
+
175
+ if (git_oid__fromstr(&one, one_str, git_oid_type(two)) < 0) {
176
+ clar__fail(file, func, line, desc, "could not parse oid string", 1);
177
+ } else {
178
+ clar__assert_equal_oid(file, func, line, desc, &one, two);
179
+ }
180
+}
181
182
#define cl_assert_equal_oid(one, two) \
183
clar__assert_equal_oid(__FILE__, __func__, __LINE__, \
184
"OID mismatch: " #one " != " #two, (one), (two))
185
186
+#define cl_assert_equal_oidstr(one_str, two) \
187
+ clar__assert_equal_oidstr(__FILE__, __func__, __LINE__, \
188
+ "OID mismatch: " #one_str " != " #two, (one_str), (two))
189
190
/*
191
* Some utility macros for building long strings
192
*/
0 commit comments