summaryrefslogtreecommitdiff
path: root/tests-clay/clay_libgit2.h
diff options
context:
space:
mode:
authorRussell Belfer <arrbee@arrbee.com>2011-11-30 13:10:47 -0800
committerRussell Belfer <arrbee@arrbee.com>2011-11-30 13:10:47 -0800
commit969d588d9ab957addb2cecd0f18f7c3699b032b6 (patch)
treee6dfe6149c816cb5b588ddcee9535d7caccd818d /tests-clay/clay_libgit2.h
parentf5f048265800659aa6f495c05eb99e1b76a713e2 (diff)
downloadlibgit2-969d588d9ab957addb2cecd0f18f7c3699b032b6.tar.gz
Optimized of git_buf_join.
This streamlines git_buf_join and removes the join-append behavior, opting instead for a very compact join-replace of the git_buf contents. The unit tests had to be updated to remove the join-append tests and have a bunch more exhaustive tests added.
Diffstat (limited to 'tests-clay/clay_libgit2.h')
-rw-r--r--tests-clay/clay_libgit2.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/tests-clay/clay_libgit2.h b/tests-clay/clay_libgit2.h
index 2eedc61d2..6b14b7d6e 100644
--- a/tests-clay/clay_libgit2.h
+++ b/tests-clay/clay_libgit2.h
@@ -29,15 +29,16 @@
* Wrapper for string comparison that knows about nulls.
*/
#define cl_assert_strequal(a,b) \
- cl_assert_strequal_internal(a,b,__FILE__,__LINE__)
+ cl_assert_strequal_internal(a,b,__FILE__,__LINE__,"string mismatch: " #a " != " #b)
-GIT_INLINE(void) cl_assert_strequal_internal(const char *a, const char *b, const char *file, int line)
+GIT_INLINE(void) cl_assert_strequal_internal(
+ const char *a, const char *b, const char *file, int line, const char *err)
{
int match = (a == NULL || b == NULL) ? (a == b) : (strcmp(a, b) == 0);
if (!match) {
char buf[4096];
snprintf(buf, 4096, "'%s' != '%s'", a, b);
- clay__assert(0, file, line, buf, "Strings do not match", 1);
+ clay__assert(0, file, line, buf, err, 1);
}
}