summaryrefslogtreecommitdiff
path: root/tests-clay/clay_main.c
diff options
context:
space:
mode:
authorRussell Belfer <arrbee@arrbee.com>2011-12-14 12:34:43 -0800
committerRussell Belfer <arrbee@arrbee.com>2011-12-14 14:31:06 -0800
commitb5daae68a4ae859653141fb097e7b7c81b25530b (patch)
tree977115657e8b1690ea0a7d65ba49fc421b4cb392 /tests-clay/clay_main.c
parentd6ccedddd2f76d69b05ecfa45a93cde8682776e6 (diff)
downloadlibgit2-b5daae68a4ae859653141fb097e7b7c81b25530b.tar.gz
Allow git_buf_joinpath to accept self-joins
It was not safe for git_buf_joinpath to be used with a pointer into the buf itself because a reallocation could invalidate the input parameter that pointed into the buffer. This patch makes it safe to self join, at least for the leading input to the join, which is the common "append" case for self joins. Also added unit tests to explicitly cover this case. This should actually fix #511
Diffstat (limited to 'tests-clay/clay_main.c')
-rw-r--r--tests-clay/clay_main.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/tests-clay/clay_main.c b/tests-clay/clay_main.c
index ce3b66b87..80c13f429 100644
--- a/tests-clay/clay_main.c
+++ b/tests-clay/clay_main.c
@@ -167,12 +167,13 @@ static const struct clay_func _clay_cb_core_oid[] = {
{"streq", &test_core_oid__streq}
};
static const struct clay_func _clay_cb_core_path[] = {
- {"0", &test_core_path__0},
- {"1", &test_core_path__1},
- {"2", &test_core_path__2},
- {"5", &test_core_path__5},
- {"6", &test_core_path__6},
- {"7", &test_core_path__7}
+ {"0_dirname", &test_core_path__0_dirname},
+ {"1_basename", &test_core_path__1_basename},
+ {"2_topdir", &test_core_path__2_topdir},
+ {"5_joins", &test_core_path__5_joins},
+ {"6_long_joins", &test_core_path__6_long_joins},
+ {"7_path_to_dir", &test_core_path__7_path_to_dir},
+ {"8_self_join", &test_core_path__8_self_join}
};
static const struct clay_func _clay_cb_core_rmdir[] = {
{"delete_recursive", &test_core_rmdir__delete_recursive},
@@ -361,7 +362,7 @@ static const struct clay_suite _clay_suites[] = {
"core::path",
{NULL, NULL},
{NULL, NULL},
- _clay_cb_core_path, 6
+ _clay_cb_core_path, 7
},
{
"core::rmdir",
@@ -516,7 +517,7 @@ static const struct clay_suite _clay_suites[] = {
};
static size_t _clay_suite_count = 36;
-static size_t _clay_callback_count = 119;
+static size_t _clay_callback_count = 120;
/* Core test functions */
static void