Commit 1a6e8f8a by Russell Belfer

Update clar and remove old helpers

This updates to the latest clar which includes the helpers
`cl_assert_equal_s` and `cl_assert_equal_i`.  Convert the code
over to use those and remove the old libgit2-only helpers.
parent dbeca796
...@@ -34,7 +34,7 @@ GIT_INLINE(void) attr_check_expected( ...@@ -34,7 +34,7 @@ GIT_INLINE(void) attr_check_expected(
break; break;
case EXPECT_STRING: case EXPECT_STRING:
cl_assert_strequal(expected_str, value); cl_assert_equal_s(expected_str, value);
break; break;
} }
} }
......
...@@ -13,19 +13,19 @@ void test_attr_file__simple_read(void) ...@@ -13,19 +13,19 @@ void test_attr_file__simple_read(void)
cl_git_pass(git_attr_file__new(&file)); cl_git_pass(git_attr_file__new(&file));
cl_git_pass(git_attr_file__from_file(NULL, cl_fixture("attr/attr0"), file)); cl_git_pass(git_attr_file__from_file(NULL, cl_fixture("attr/attr0"), file));
cl_assert_strequal(cl_fixture("attr/attr0"), file->path); cl_assert_equal_s(cl_fixture("attr/attr0"), file->path);
cl_assert(file->rules.length == 1); cl_assert(file->rules.length == 1);
rule = get_rule(0); rule = get_rule(0);
cl_assert(rule != NULL); cl_assert(rule != NULL);
cl_assert_strequal("*", rule->match.pattern); cl_assert_equal_s("*", rule->match.pattern);
cl_assert(rule->match.length == 1); cl_assert(rule->match.length == 1);
cl_assert((rule->match.flags & GIT_ATTR_FNMATCH_HASWILD) != 0); cl_assert((rule->match.flags & GIT_ATTR_FNMATCH_HASWILD) != 0);
cl_assert(rule->assigns.length == 1); cl_assert(rule->assigns.length == 1);
assign = get_assign(rule, 0); assign = get_assign(rule, 0);
cl_assert(assign != NULL); cl_assert(assign != NULL);
cl_assert_strequal("binary", assign->name); cl_assert_equal_s("binary", assign->name);
cl_assert(GIT_ATTR_TRUE(assign->value)); cl_assert(GIT_ATTR_TRUE(assign->value));
cl_assert(!assign->is_allocated); cl_assert(!assign->is_allocated);
...@@ -40,7 +40,7 @@ void test_attr_file__match_variants(void) ...@@ -40,7 +40,7 @@ void test_attr_file__match_variants(void)
cl_git_pass(git_attr_file__new(&file)); cl_git_pass(git_attr_file__new(&file));
cl_git_pass(git_attr_file__from_file(NULL, cl_fixture("attr/attr1"), file)); cl_git_pass(git_attr_file__from_file(NULL, cl_fixture("attr/attr1"), file));
cl_assert_strequal(cl_fixture("attr/attr1"), file->path); cl_assert_equal_s(cl_fixture("attr/attr1"), file->path);
cl_assert(file->rules.length == 10); cl_assert(file->rules.length == 10);
/* let's do a thorough check of this rule, then just verify /* let's do a thorough check of this rule, then just verify
...@@ -48,53 +48,53 @@ void test_attr_file__match_variants(void) ...@@ -48,53 +48,53 @@ void test_attr_file__match_variants(void)
*/ */
rule = get_rule(0); rule = get_rule(0);
cl_assert(rule); cl_assert(rule);
cl_assert_strequal("pat0", rule->match.pattern); cl_assert_equal_s("pat0", rule->match.pattern);
cl_assert(rule->match.length == strlen("pat0")); cl_assert(rule->match.length == strlen("pat0"));
cl_assert(rule->match.flags == 0); cl_assert(rule->match.flags == 0);
cl_assert(rule->assigns.length == 1); cl_assert(rule->assigns.length == 1);
assign = get_assign(rule,0); assign = get_assign(rule,0);
cl_assert_strequal("attr0", assign->name); cl_assert_equal_s("attr0", assign->name);
cl_assert(assign->name_hash == git_attr_file__name_hash(assign->name)); cl_assert(assign->name_hash == git_attr_file__name_hash(assign->name));
cl_assert(GIT_ATTR_TRUE(assign->value)); cl_assert(GIT_ATTR_TRUE(assign->value));
cl_assert(!assign->is_allocated); cl_assert(!assign->is_allocated);
rule = get_rule(1); rule = get_rule(1);
cl_assert_strequal("pat1", rule->match.pattern); cl_assert_equal_s("pat1", rule->match.pattern);
cl_assert(rule->match.length == strlen("pat1")); cl_assert(rule->match.length == strlen("pat1"));
cl_assert(rule->match.flags == GIT_ATTR_FNMATCH_NEGATIVE); cl_assert(rule->match.flags == GIT_ATTR_FNMATCH_NEGATIVE);
rule = get_rule(2); rule = get_rule(2);
cl_assert_strequal("pat2", rule->match.pattern); cl_assert_equal_s("pat2", rule->match.pattern);
cl_assert(rule->match.length == strlen("pat2")); cl_assert(rule->match.length == strlen("pat2"));
cl_assert(rule->match.flags == GIT_ATTR_FNMATCH_DIRECTORY); cl_assert(rule->match.flags == GIT_ATTR_FNMATCH_DIRECTORY);
rule = get_rule(3); rule = get_rule(3);
cl_assert_strequal("pat3dir/pat3file", rule->match.pattern); cl_assert_equal_s("pat3dir/pat3file", rule->match.pattern);
cl_assert(rule->match.flags == GIT_ATTR_FNMATCH_FULLPATH); cl_assert(rule->match.flags == GIT_ATTR_FNMATCH_FULLPATH);
rule = get_rule(4); rule = get_rule(4);
cl_assert_strequal("pat4.*", rule->match.pattern); cl_assert_equal_s("pat4.*", rule->match.pattern);
cl_assert((rule->match.flags & GIT_ATTR_FNMATCH_HASWILD) != 0); cl_assert((rule->match.flags & GIT_ATTR_FNMATCH_HASWILD) != 0);
rule = get_rule(5); rule = get_rule(5);
cl_assert_strequal("*.pat5", rule->match.pattern); cl_assert_equal_s("*.pat5", rule->match.pattern);
cl_assert((rule->match.flags & GIT_ATTR_FNMATCH_HASWILD) != 0); cl_assert((rule->match.flags & GIT_ATTR_FNMATCH_HASWILD) != 0);
rule = get_rule(7); rule = get_rule(7);
cl_assert_strequal("pat7[a-e]??[xyz]", rule->match.pattern); cl_assert_equal_s("pat7[a-e]??[xyz]", rule->match.pattern);
cl_assert(rule->assigns.length == 1); cl_assert(rule->assigns.length == 1);
cl_assert((rule->match.flags & GIT_ATTR_FNMATCH_HASWILD) != 0); cl_assert((rule->match.flags & GIT_ATTR_FNMATCH_HASWILD) != 0);
assign = get_assign(rule,0); assign = get_assign(rule,0);
cl_assert_strequal("attr7", assign->name); cl_assert_equal_s("attr7", assign->name);
cl_assert(GIT_ATTR_TRUE(assign->value)); cl_assert(GIT_ATTR_TRUE(assign->value));
rule = get_rule(8); rule = get_rule(8);
cl_assert_strequal("pat8 with spaces", rule->match.pattern); cl_assert_equal_s("pat8 with spaces", rule->match.pattern);
cl_assert(rule->match.length == strlen("pat8 with spaces")); cl_assert(rule->match.length == strlen("pat8 with spaces"));
cl_assert(rule->match.flags == 0); cl_assert(rule->match.flags == 0);
rule = get_rule(9); rule = get_rule(9);
cl_assert_strequal("pat9", rule->match.pattern); cl_assert_equal_s("pat9", rule->match.pattern);
git_attr_file__free(file); git_attr_file__free(file);
} }
...@@ -111,9 +111,9 @@ static void check_one_assign( ...@@ -111,9 +111,9 @@ static void check_one_assign(
git_attr_rule *rule = get_rule(rule_idx); git_attr_rule *rule = get_rule(rule_idx);
git_attr_assignment *assign = get_assign(rule, assign_idx); git_attr_assignment *assign = get_assign(rule, assign_idx);
cl_assert_strequal(pattern, rule->match.pattern); cl_assert_equal_s(pattern, rule->match.pattern);
cl_assert(rule->assigns.length == 1); cl_assert(rule->assigns.length == 1);
cl_assert_strequal(name, assign->name); cl_assert_equal_s(name, assign->name);
cl_assert(assign->name_hash == git_attr_file__name_hash(assign->name)); cl_assert(assign->name_hash == git_attr_file__name_hash(assign->name));
attr_check_expected(expected, expected_str, assign->value); attr_check_expected(expected, expected_str, assign->value);
...@@ -127,7 +127,7 @@ void test_attr_file__assign_variants(void) ...@@ -127,7 +127,7 @@ void test_attr_file__assign_variants(void)
cl_git_pass(git_attr_file__new(&file)); cl_git_pass(git_attr_file__new(&file));
cl_git_pass(git_attr_file__from_file(NULL, cl_fixture("attr/attr2"), file)); cl_git_pass(git_attr_file__from_file(NULL, cl_fixture("attr/attr2"), file));
cl_assert_strequal(cl_fixture("attr/attr2"), file->path); cl_assert_equal_s(cl_fixture("attr/attr2"), file->path);
cl_assert(file->rules.length == 11); cl_assert(file->rules.length == 11);
check_one_assign(file, 0, 0, "pat0", "simple", EXPECT_TRUE, NULL); check_one_assign(file, 0, 0, "pat0", "simple", EXPECT_TRUE, NULL);
...@@ -140,45 +140,45 @@ void test_attr_file__assign_variants(void) ...@@ -140,45 +140,45 @@ void test_attr_file__assign_variants(void)
check_one_assign(file, 7, 0, "pat6", "negempty", EXPECT_FALSE, NULL); check_one_assign(file, 7, 0, "pat6", "negempty", EXPECT_FALSE, NULL);
rule = get_rule(8); rule = get_rule(8);
cl_assert_strequal("pat7", rule->match.pattern); cl_assert_equal_s("pat7", rule->match.pattern);
cl_assert(rule->assigns.length == 5); cl_assert(rule->assigns.length == 5);
/* assignments will be sorted by hash value, so we have to do /* assignments will be sorted by hash value, so we have to do
* lookups by search instead of by position * lookups by search instead of by position
*/ */
assign = git_attr_rule__lookup_assignment(rule, "multiple"); assign = git_attr_rule__lookup_assignment(rule, "multiple");
cl_assert(assign); cl_assert(assign);
cl_assert_strequal("multiple", assign->name); cl_assert_equal_s("multiple", assign->name);
cl_assert(GIT_ATTR_TRUE(assign->value)); cl_assert(GIT_ATTR_TRUE(assign->value));
assign = git_attr_rule__lookup_assignment(rule, "single"); assign = git_attr_rule__lookup_assignment(rule, "single");
cl_assert(assign); cl_assert(assign);
cl_assert_strequal("single", assign->name); cl_assert_equal_s("single", assign->name);
cl_assert(GIT_ATTR_FALSE(assign->value)); cl_assert(GIT_ATTR_FALSE(assign->value));
assign = git_attr_rule__lookup_assignment(rule, "values"); assign = git_attr_rule__lookup_assignment(rule, "values");
cl_assert(assign); cl_assert(assign);
cl_assert_strequal("values", assign->name); cl_assert_equal_s("values", assign->name);
cl_assert_strequal("1", assign->value); cl_assert_equal_s("1", assign->value);
assign = git_attr_rule__lookup_assignment(rule, "also"); assign = git_attr_rule__lookup_assignment(rule, "also");
cl_assert(assign); cl_assert(assign);
cl_assert_strequal("also", assign->name); cl_assert_equal_s("also", assign->name);
cl_assert_strequal("a-really-long-value/*", assign->value); cl_assert_equal_s("a-really-long-value/*", assign->value);
assign = git_attr_rule__lookup_assignment(rule, "happy"); assign = git_attr_rule__lookup_assignment(rule, "happy");
cl_assert(assign); cl_assert(assign);
cl_assert_strequal("happy", assign->name); cl_assert_equal_s("happy", assign->name);
cl_assert_strequal("yes!", assign->value); cl_assert_equal_s("yes!", assign->value);
assign = git_attr_rule__lookup_assignment(rule, "other"); assign = git_attr_rule__lookup_assignment(rule, "other");
cl_assert(!assign); cl_assert(!assign);
rule = get_rule(9); rule = get_rule(9);
cl_assert_strequal("pat8", rule->match.pattern); cl_assert_equal_s("pat8", rule->match.pattern);
cl_assert(rule->assigns.length == 2); cl_assert(rule->assigns.length == 2);
assign = git_attr_rule__lookup_assignment(rule, "again"); assign = git_attr_rule__lookup_assignment(rule, "again");
cl_assert(assign); cl_assert(assign);
cl_assert_strequal("again", assign->name); cl_assert_equal_s("again", assign->name);
cl_assert(GIT_ATTR_TRUE(assign->value)); cl_assert(GIT_ATTR_TRUE(assign->value));
assign = git_attr_rule__lookup_assignment(rule, "another"); assign = git_attr_rule__lookup_assignment(rule, "another");
cl_assert(assign); cl_assert(assign);
cl_assert_strequal("another", assign->name); cl_assert_equal_s("another", assign->name);
cl_assert_strequal("12321", assign->value); cl_assert_equal_s("12321", assign->value);
check_one_assign(file, 10, 0, "pat9", "at-eof", EXPECT_FALSE, NULL); check_one_assign(file, 10, 0, "pat9", "at-eof", EXPECT_FALSE, NULL);
...@@ -193,37 +193,37 @@ void test_attr_file__check_attr_examples(void) ...@@ -193,37 +193,37 @@ void test_attr_file__check_attr_examples(void)
cl_git_pass(git_attr_file__new(&file)); cl_git_pass(git_attr_file__new(&file));
cl_git_pass(git_attr_file__from_file(NULL, cl_fixture("attr/attr3"), file)); cl_git_pass(git_attr_file__from_file(NULL, cl_fixture("attr/attr3"), file));
cl_assert_strequal(cl_fixture("attr/attr3"), file->path); cl_assert_equal_s(cl_fixture("attr/attr3"), file->path);
cl_assert(file->rules.length == 3); cl_assert(file->rules.length == 3);
rule = get_rule(0); rule = get_rule(0);
cl_assert_strequal("*.java", rule->match.pattern); cl_assert_equal_s("*.java", rule->match.pattern);
cl_assert(rule->assigns.length == 3); cl_assert(rule->assigns.length == 3);
assign = git_attr_rule__lookup_assignment(rule, "diff"); assign = git_attr_rule__lookup_assignment(rule, "diff");
cl_assert_strequal("diff", assign->name); cl_assert_equal_s("diff", assign->name);
cl_assert_strequal("java", assign->value); cl_assert_equal_s("java", assign->value);
assign = git_attr_rule__lookup_assignment(rule, "crlf"); assign = git_attr_rule__lookup_assignment(rule, "crlf");
cl_assert_strequal("crlf", assign->name); cl_assert_equal_s("crlf", assign->name);
cl_assert(GIT_ATTR_FALSE(assign->value)); cl_assert(GIT_ATTR_FALSE(assign->value));
assign = git_attr_rule__lookup_assignment(rule, "myAttr"); assign = git_attr_rule__lookup_assignment(rule, "myAttr");
cl_assert_strequal("myAttr", assign->name); cl_assert_equal_s("myAttr", assign->name);
cl_assert(GIT_ATTR_TRUE(assign->value)); cl_assert(GIT_ATTR_TRUE(assign->value));
assign = git_attr_rule__lookup_assignment(rule, "missing"); assign = git_attr_rule__lookup_assignment(rule, "missing");
cl_assert(assign == NULL); cl_assert(assign == NULL);
rule = get_rule(1); rule = get_rule(1);
cl_assert_strequal("NoMyAttr.java", rule->match.pattern); cl_assert_equal_s("NoMyAttr.java", rule->match.pattern);
cl_assert(rule->assigns.length == 1); cl_assert(rule->assigns.length == 1);
assign = get_assign(rule, 0); assign = get_assign(rule, 0);
cl_assert_strequal("myAttr", assign->name); cl_assert_equal_s("myAttr", assign->name);
cl_assert(assign->value == NULL); cl_assert(assign->value == NULL);
rule = get_rule(2); rule = get_rule(2);
cl_assert_strequal("README", rule->match.pattern); cl_assert_equal_s("README", rule->match.pattern);
cl_assert(rule->assigns.length == 1); cl_assert(rule->assigns.length == 1);
assign = get_assign(rule, 0); assign = get_assign(rule, 0);
cl_assert_strequal("caveat", assign->name); cl_assert_equal_s("caveat", assign->name);
cl_assert_strequal("unspecified", assign->value); cl_assert_equal_s("unspecified", assign->value);
git_attr_file__free(file); git_attr_file__free(file);
} }
...@@ -11,12 +11,12 @@ void test_attr_lookup__simple(void) ...@@ -11,12 +11,12 @@ void test_attr_lookup__simple(void)
cl_git_pass(git_attr_file__new(&file)); cl_git_pass(git_attr_file__new(&file));
cl_git_pass(git_attr_file__from_file(NULL, cl_fixture("attr/attr0"), file)); cl_git_pass(git_attr_file__from_file(NULL, cl_fixture("attr/attr0"), file));
cl_assert_strequal(cl_fixture("attr/attr0"), file->path); cl_assert_equal_s(cl_fixture("attr/attr0"), file->path);
cl_assert(file->rules.length == 1); cl_assert(file->rules.length == 1);
cl_git_pass(git_attr_path__init(&path, "test", NULL)); cl_git_pass(git_attr_path__init(&path, "test", NULL));
cl_assert_strequal("test", path.path); cl_assert_equal_s("test", path.path);
cl_assert_strequal("test", path.basename); cl_assert_equal_s("test", path.basename);
cl_assert(!path.is_dir); cl_assert(!path.is_dir);
cl_git_pass(git_attr_file__lookup_one(file,&path,"binary",&value)); cl_git_pass(git_attr_file__lookup_one(file,&path,"binary",&value));
...@@ -129,11 +129,11 @@ void test_attr_lookup__match_variants(void) ...@@ -129,11 +129,11 @@ void test_attr_lookup__match_variants(void)
cl_git_pass(git_attr_file__new(&file)); cl_git_pass(git_attr_file__new(&file));
cl_git_pass(git_attr_file__from_file(NULL, cl_fixture("attr/attr1"), file)); cl_git_pass(git_attr_file__from_file(NULL, cl_fixture("attr/attr1"), file));
cl_assert_strequal(cl_fixture("attr/attr1"), file->path); cl_assert_equal_s(cl_fixture("attr/attr1"), file->path);
cl_assert(file->rules.length == 10); cl_assert(file->rules.length == 10);
cl_git_pass(git_attr_path__init(&path, "/testing/for/pat0", NULL)); cl_git_pass(git_attr_path__init(&path, "/testing/for/pat0", NULL));
cl_assert_strequal("pat0", path.basename); cl_assert_equal_s("pat0", path.basename);
run_test_cases(file, cases, 0); run_test_cases(file, cases, 0);
run_test_cases(file, dir_cases, 1); run_test_cases(file, dir_cases, 1);
......
...@@ -101,7 +101,7 @@ void test_attr_repo__get_many(void) ...@@ -101,7 +101,7 @@ void test_attr_repo__get_many(void)
cl_assert(GIT_ATTR_TRUE(values[0])); cl_assert(GIT_ATTR_TRUE(values[0]));
cl_assert(GIT_ATTR_TRUE(values[1])); cl_assert(GIT_ATTR_TRUE(values[1]));
cl_assert(GIT_ATTR_UNSPECIFIED(values[2])); cl_assert(GIT_ATTR_UNSPECIFIED(values[2]));
cl_assert_strequal("yes", values[3]); cl_assert_equal_s("yes", values[3]);
} }
static int count_attrs( static int count_attrs(
...@@ -150,7 +150,7 @@ void test_attr_repo__manpage_example(void) ...@@ -150,7 +150,7 @@ void test_attr_repo__manpage_example(void)
cl_assert(GIT_ATTR_FALSE(value)); cl_assert(GIT_ATTR_FALSE(value));
cl_git_pass(git_attr_get(g_repo, "sub/abc", "merge", &value)); cl_git_pass(git_attr_get(g_repo, "sub/abc", "merge", &value));
cl_assert_strequal("filfre", value); cl_assert_equal_s("filfre", value);
cl_git_pass(git_attr_get(g_repo, "sub/abc", "frotz", &value)); cl_git_pass(git_attr_get(g_repo, "sub/abc", "frotz", &value));
cl_assert(GIT_ATTR_UNSPECIFIED(value)); cl_assert(GIT_ATTR_UNSPECIFIED(value));
...@@ -177,13 +177,13 @@ void test_attr_repo__macros(void) ...@@ -177,13 +177,13 @@ void test_attr_repo__macros(void)
cl_assert(GIT_ATTR_TRUE(values[1])); cl_assert(GIT_ATTR_TRUE(values[1]));
cl_assert(GIT_ATTR_FALSE(values[2])); cl_assert(GIT_ATTR_FALSE(values[2]));
cl_assert(GIT_ATTR_UNSPECIFIED(values[3])); cl_assert(GIT_ATTR_UNSPECIFIED(values[3]));
cl_assert_strequal("77", values[4]); cl_assert_equal_s("77", values[4]);
cl_git_pass(git_attr_get_many(g_repo, "macro_test", 3, names3, values)); cl_git_pass(git_attr_get_many(g_repo, "macro_test", 3, names3, values));
cl_assert(GIT_ATTR_TRUE(values[0])); cl_assert(GIT_ATTR_TRUE(values[0]));
cl_assert(GIT_ATTR_FALSE(values[1])); cl_assert(GIT_ATTR_FALSE(values[1]));
cl_assert_strequal("answer", values[2]); cl_assert_equal_s("answer", values[2]);
} }
void test_attr_repo__bad_macros(void) void test_attr_repo__bad_macros(void)
...@@ -222,7 +222,7 @@ void test_attr_repo__bad_macros(void) ...@@ -222,7 +222,7 @@ void test_attr_repo__bad_macros(void)
* -firstmacro secondmacro="hahaha" thirdmacro * -firstmacro secondmacro="hahaha" thirdmacro
*/ */
cl_assert(GIT_ATTR_FALSE(values[3])); cl_assert(GIT_ATTR_FALSE(values[3]));
cl_assert_strequal("hahaha", values[4]); cl_assert_equal_s("hahaha", values[4]);
cl_assert(GIT_ATTR_TRUE(values[5])); cl_assert(GIT_ATTR_TRUE(values[5]));
} }
...@@ -297,7 +297,7 @@ static const struct clar_func _clar_cb_${suite_name}[] = { ...@@ -297,7 +297,7 @@ static const struct clar_func _clar_cb_${suite_name}[] = {
CLAR_FILES = { CLAR_FILES = {
"clar.c" : r"""eJytGWlv20b2s/grJsompmxalpTFYteOvQiyzcJo6wKJgxSwDWJEjqxpeCicoY9N9d/73lwcHrK7QPPF4rvmzbvf5CUvkqxOGXlLhWCVnK7PgpcOJpj8Ld90YDLN+LIH42UXVPHitg3LqVz3GGmlqIKjfVKxbzWvWEpWZUUELdJl+QBCyP6Rz/IojuTjhomOJAALSdUFALxK2YrEX84v3iyClyNHdc+LtLzXrA3U6N4AxJplGd3wDjgF5RJzwggO4AUj8c/vzi/i9+9JHCcpSzIPheqEG7hzBD8nJG5/N3T5VxBsEHmZMiBtQB5dsnZAEnsfDQVNEiZEW1Qf5mtYpfUmhD9KPfeBl+CrQtkw/vn84r9f3iziGICjTUVvc0qSMs9ZIUOIhIiMlbneLMYo2RNdJJvHUJYRWVVlHhFZxoL/D1QyqFgopAFbqvjy4+eL9+8uf/CFfYl/+ZHMFh7kU3z+6T/nH8OHCQnDB/KaxAD5AJAJeXFKZj5z/lWyfBNbE2SsUAbuAYGFFSlfBSMML7w7KFonUjuOfLp8dxlfngQvWSZYK1gg8u4px7ggEMT4c8PTcDFRcdvQ1QWHcNch1Qme3pGdE5VaTbCPk4xW0/U4CJCOJ+Su5JA0Iq7yMCkLISFUaEX2Y1HWVcImJ126pATPDFBGxAemDML0xB3io4IVf5B1xWI0X0vSkoqOGEta0JxpceqKeIeYVRWk+vdg5DNIOPckAMNJgj/jos6XrDppE4maS9aBrXjGDGMG5h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9Xmo1I1CmFOF85ay9w1J37RxBV5ZkWS82/tpWbx8GMegZo24uM5EytC3KmBJt9DNYQSBWesbFQxe0XIHOYKEY9HA+7PfsN0i1qN4qeDVpmWKNWYUYktpliWIG+gfTE5bORwTqnF4PL09dc6wLBq5x+XaZiHhsdE1mXIFaKc3SjaCEPzIUUNNC4sOFlLlwLlmoMyy+I+7wTWWH78la/3lwVA3AMuMR5JFeCBWI6D7749B3eUyJQCXv3pQC1L7z2qVqvBoYiWoiwhmqQJZIs2JIrHyZVsCaKUQ/eRL5BQWjdMOjcnup4OuAJ3lyWjkeWXOT/7QobZvIrl8a9YCXHEy8s7hKy8UAVd885JZtIRhOQ7/xoS6iqf4ZcPUikyku7YnldGnRo+F4cAOY1N+BjEAlgZoxlS+5EmXrVZRJRBni5j54sY+7fB+W1ShBu9feRG2ziAYGKTuAoym9cbHfDKrXO50SjO7R+tqVXdAhpt1yOducxTHYtMUyYpQ+Ykzmvvrndhr/GMx6DAJdu+px77PnbT1QCTieosE1nujpxdX5+atDhYFlquoXOEf4/wjB3t62O7/9/hGKyVWV6FYvavT+AhbcW38=""",
......
...@@ -25,26 +25,6 @@ ...@@ -25,26 +25,6 @@
*/ */
#define cl_git_fail(expr) cl_must_fail(expr) #define cl_git_fail(expr) cl_must_fail(expr)
/**
* Wrapper for string comparison that knows about nulls.
*/
#define cl_assert_strequal(a,b) \
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, 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);
clar__assert(0, file, line, err, buf, 1);
}
}
#define cl_assert_intequal(a,b) \
do { if ((a) != (b)) { char buf[128]; snprintf(buf,128,"%d != %d",(a),(b)); clar__assert(0,__FILE__,__LINE__,#a " != " #b,buf,1); } } while (0)
/* /*
* Some utility macros for building long strings * Some utility macros for building long strings
*/ */
......
...@@ -42,12 +42,14 @@ void test_core_errors__new_school(void) ...@@ -42,12 +42,14 @@ void test_core_errors__new_school(void)
cl_assert(str_in_error != NULL); cl_assert(str_in_error != NULL);
git_error_clear(); git_error_clear();
cl_assert(git_error_last() == NULL);
{ do {
struct stat st; struct stat st;
memset(&st, 0, sizeof(st));
assert(p_lstat("this_file_does_not_exist", &st) < 0); assert(p_lstat("this_file_does_not_exist", &st) < 0);
GIT_UNUSED(st); GIT_UNUSED(st);
} } while (false);
giterr_set(GITERR_OS, "stat failed"); /* internal fn */ giterr_set(GITERR_OS, "stat failed"); /* internal fn */
cl_assert(git_error_last() != NULL); cl_assert(git_error_last() != NULL);
......
...@@ -8,11 +8,11 @@ check_dirname(const char *A, const char *B) ...@@ -8,11 +8,11 @@ check_dirname(const char *A, const char *B)
char *dir2; char *dir2;
cl_assert(git_path_dirname_r(&dir, A) >= 0); cl_assert(git_path_dirname_r(&dir, A) >= 0);
cl_assert_strequal(B, dir.ptr); cl_assert_equal_s(B, dir.ptr);
git_buf_free(&dir); git_buf_free(&dir);
cl_assert((dir2 = git_path_dirname(A)) != NULL); cl_assert((dir2 = git_path_dirname(A)) != NULL);
cl_assert_strequal(B, dir2); cl_assert_equal_s(B, dir2);
git__free(dir2); git__free(dir2);
} }
...@@ -23,11 +23,11 @@ check_basename(const char *A, const char *B) ...@@ -23,11 +23,11 @@ check_basename(const char *A, const char *B)
char *base2; char *base2;
cl_assert(git_path_basename_r(&base, A) >= 0); cl_assert(git_path_basename_r(&base, A) >= 0);
cl_assert_strequal(B, base.ptr); cl_assert_equal_s(B, base.ptr);
git_buf_free(&base); git_buf_free(&base);
cl_assert((base2 = git_path_basename(A)) != NULL); cl_assert((base2 = git_path_basename(A)) != NULL);
cl_assert_strequal(B, base2); cl_assert_equal_s(B, base2);
git__free(base2); git__free(base2);
} }
...@@ -37,7 +37,7 @@ check_topdir(const char *A, const char *B) ...@@ -37,7 +37,7 @@ check_topdir(const char *A, const char *B)
const char *dir; const char *dir;
cl_assert((dir = git_path_topdir(A)) != NULL); cl_assert((dir = git_path_topdir(A)) != NULL);
cl_assert_strequal(B, dir); cl_assert_equal_s(B, dir);
} }
static void static void
...@@ -46,7 +46,7 @@ check_joinpath(const char *path_a, const char *path_b, const char *expected_path ...@@ -46,7 +46,7 @@ check_joinpath(const char *path_a, const char *path_b, const char *expected_path
git_buf joined_path = GIT_BUF_INIT; git_buf joined_path = GIT_BUF_INIT;
cl_git_pass(git_buf_joinpath(&joined_path, path_a, path_b)); cl_git_pass(git_buf_joinpath(&joined_path, path_a, path_b));
cl_assert_strequal(expected_path, joined_path.ptr); cl_assert_equal_s(expected_path, joined_path.ptr);
git_buf_free(&joined_path); git_buf_free(&joined_path);
} }
...@@ -63,7 +63,7 @@ check_joinpath_n( ...@@ -63,7 +63,7 @@ check_joinpath_n(
cl_git_pass(git_buf_join_n(&joined_path, '/', 4, cl_git_pass(git_buf_join_n(&joined_path, '/', 4,
path_a, path_b, path_c, path_d)); path_a, path_b, path_c, path_d));
cl_assert_strequal(expected_path, joined_path.ptr); cl_assert_equal_s(expected_path, joined_path.ptr);
git_buf_free(&joined_path); git_buf_free(&joined_path);
} }
...@@ -189,7 +189,7 @@ check_path_to_dir( ...@@ -189,7 +189,7 @@ check_path_to_dir(
git_buf_sets(&tgt, path); git_buf_sets(&tgt, path);
cl_git_pass(git_path_to_dir(&tgt)); cl_git_pass(git_path_to_dir(&tgt));
cl_assert_strequal(expected, tgt.ptr); cl_assert_equal_s(expected, tgt.ptr);
git_buf_free(&tgt); git_buf_free(&tgt);
} }
...@@ -197,16 +197,18 @@ check_path_to_dir( ...@@ -197,16 +197,18 @@ check_path_to_dir(
static void static void
check_string_to_dir( check_string_to_dir(
const char* path, const char* path,
int maxlen, size_t maxlen,
const char* expected) const char* expected)
{ {
int len = strlen(path); size_t len = strlen(path);
char *buf = git__malloc(len + 2); char *buf = git__malloc(len + 2);
cl_assert(buf);
strncpy(buf, path, len + 2); strncpy(buf, path, len + 2);
git_path_string_to_dir(buf, maxlen); git_path_string_to_dir(buf, maxlen);
cl_assert_strequal(expected, buf); cl_assert_equal_s(expected, buf);
git__free(buf); git__free(buf);
} }
...@@ -247,28 +249,28 @@ void test_core_path__08_self_join(void) ...@@ -247,28 +249,28 @@ void test_core_path__08_self_join(void)
asize = path.asize; asize = path.asize;
cl_git_pass(git_buf_sets(&path, "/foo")); cl_git_pass(git_buf_sets(&path, "/foo"));
cl_assert_strequal(path.ptr, "/foo"); cl_assert_equal_s(path.ptr, "/foo");
cl_assert(asize < path.asize); cl_assert(asize < path.asize);
asize = path.asize; asize = path.asize;
cl_git_pass(git_buf_joinpath(&path, path.ptr, "this is a new string")); cl_git_pass(git_buf_joinpath(&path, path.ptr, "this is a new string"));
cl_assert_strequal(path.ptr, "/foo/this is a new string"); cl_assert_equal_s(path.ptr, "/foo/this is a new string");
cl_assert(asize < path.asize); cl_assert(asize < path.asize);
asize = path.asize; asize = path.asize;
cl_git_pass(git_buf_joinpath(&path, path.ptr, "/grow the buffer, grow the buffer, grow the buffer")); cl_git_pass(git_buf_joinpath(&path, path.ptr, "/grow the buffer, grow the buffer, grow the buffer"));
cl_assert_strequal(path.ptr, "/foo/this is a new string/grow the buffer, grow the buffer, grow the buffer"); cl_assert_equal_s(path.ptr, "/foo/this is a new string/grow the buffer, grow the buffer, grow the buffer");
cl_assert(asize < path.asize); cl_assert(asize < path.asize);
git_buf_free(&path); git_buf_free(&path);
cl_git_pass(git_buf_sets(&path, "/foo/bar")); cl_git_pass(git_buf_sets(&path, "/foo/bar"));
cl_git_pass(git_buf_joinpath(&path, path.ptr + 4, "baz")); cl_git_pass(git_buf_joinpath(&path, path.ptr + 4, "baz"));
cl_assert_strequal(path.ptr, "/bar/baz"); cl_assert_equal_s(path.ptr, "/bar/baz");
asize = path.asize; asize = path.asize;
cl_git_pass(git_buf_joinpath(&path, path.ptr + 4, "somethinglongenoughtorealloc")); cl_git_pass(git_buf_joinpath(&path, path.ptr + 4, "somethinglongenoughtorealloc"));
cl_assert_strequal(path.ptr, "/baz/somethinglongenoughtorealloc"); cl_assert_equal_s(path.ptr, "/baz/somethinglongenoughtorealloc");
cl_assert(asize < path.asize); cl_assert(asize < path.asize);
git_buf_free(&path); git_buf_free(&path);
...@@ -279,7 +281,7 @@ static void check_percent_decoding(const char *expected_result, const char *inpu ...@@ -279,7 +281,7 @@ static void check_percent_decoding(const char *expected_result, const char *inpu
git_buf buf = GIT_BUF_INIT; git_buf buf = GIT_BUF_INIT;
cl_git_pass(git__percent_decode(&buf, input)); cl_git_pass(git__percent_decode(&buf, input));
cl_assert_strequal(expected_result, git_buf_cstr(&buf)); cl_assert_equal_s(expected_result, git_buf_cstr(&buf));
git_buf_free(&buf); git_buf_free(&buf);
} }
...@@ -306,7 +308,7 @@ static void check_fromurl(const char *expected_result, const char *input, int sh ...@@ -306,7 +308,7 @@ static void check_fromurl(const char *expected_result, const char *input, int sh
if (!should_fail) { if (!should_fail) {
cl_git_pass(git_path_fromurl(&buf, input)); cl_git_pass(git_path_fromurl(&buf, input));
cl_assert_strequal(expected_result, git_buf_cstr(&buf)); cl_assert_equal_s(expected_result, git_buf_cstr(&buf));
} else } else
cl_git_fail(git_path_fromurl(&buf, input)); cl_git_fail(git_path_fromurl(&buf, input));
...@@ -346,7 +348,7 @@ static int check_one_walkup_step(void *ref, git_buf *path) ...@@ -346,7 +348,7 @@ static int check_one_walkup_step(void *ref, git_buf *path)
{ {
check_walkup_info *info = (check_walkup_info *)ref; check_walkup_info *info = (check_walkup_info *)ref;
cl_assert(info->expect[info->expect_idx] != NULL); cl_assert(info->expect[info->expect_idx] != NULL);
cl_assert_strequal(info->expect[info->expect_idx], path->ptr); cl_assert_equal_s(info->expect[info->expect_idx], path->ptr);
info->expect_idx++; info->expect_idx++;
return 0; return 0;
} }
...@@ -380,7 +382,7 @@ void test_core_path__11_walkup(void) ...@@ -380,7 +382,7 @@ void test_core_path__11_walkup(void)
git_path_walk_up(&p, root[j], check_one_walkup_step, &info) git_path_walk_up(&p, root[j], check_one_walkup_step, &info)
); );
cl_assert_strequal(p.ptr, expect[i]); cl_assert_equal_s(p.ptr, expect[i]);
/* skip to next run of expectations */ /* skip to next run of expectations */
while (expect[i] != NULL) i++; while (expect[i] != NULL) i++;
......
...@@ -37,7 +37,7 @@ static void tree_iterator_test( ...@@ -37,7 +37,7 @@ static void tree_iterator_test(
while (entry != NULL) { while (entry != NULL) {
if (expected_values != NULL) if (expected_values != NULL)
cl_assert_strequal(expected_values[count], entry->path); cl_assert_equal_s(expected_values[count], entry->path);
count++; count++;
...@@ -192,7 +192,7 @@ static void index_iterator_test( ...@@ -192,7 +192,7 @@ static void index_iterator_test(
while (entry != NULL) { while (entry != NULL) {
if (expected_names != NULL) if (expected_names != NULL)
cl_assert_strequal(expected_names[count], entry->path); cl_assert_equal_s(expected_names[count], entry->path);
if (expected_oids != NULL) { if (expected_oids != NULL) {
git_oid oid; git_oid oid;
...@@ -330,7 +330,7 @@ static void workdir_iterator_test( ...@@ -330,7 +330,7 @@ static void workdir_iterator_test(
} }
if (expected_names != NULL) if (expected_names != NULL)
cl_assert_strequal(expected_names[count_all], entry->path); cl_assert_equal_s(expected_names[count_all], entry->path);
if (an_ignored_name && strcmp(an_ignored_name,entry->path)==0) if (an_ignored_name && strcmp(an_ignored_name,entry->path)==0)
cl_assert(ignored); cl_assert(ignored);
......
...@@ -149,15 +149,15 @@ void test_diff_tree__options(void) ...@@ -149,15 +149,15 @@ void test_diff_tree__options(void)
diff, &actual, diff_file_fn, diff_hunk_fn, diff_line_fn)); diff, &actual, diff_file_fn, diff_hunk_fn, diff_line_fn));
expected = &test_expects[i]; expected = &test_expects[i];
cl_assert_intequal(actual.files, expected->files); cl_assert_equal_i(actual.files, expected->files);
cl_assert_intequal(actual.file_adds, expected->file_adds); cl_assert_equal_i(actual.file_adds, expected->file_adds);
cl_assert_intequal(actual.file_dels, expected->file_dels); cl_assert_equal_i(actual.file_dels, expected->file_dels);
cl_assert_intequal(actual.file_mods, expected->file_mods); cl_assert_equal_i(actual.file_mods, expected->file_mods);
cl_assert_intequal(actual.hunks, expected->hunks); cl_assert_equal_i(actual.hunks, expected->hunks);
cl_assert_intequal(actual.lines, expected->lines); cl_assert_equal_i(actual.lines, expected->lines);
cl_assert_intequal(actual.line_ctxt, expected->line_ctxt); cl_assert_equal_i(actual.line_ctxt, expected->line_ctxt);
cl_assert_intequal(actual.line_adds, expected->line_adds); cl_assert_equal_i(actual.line_adds, expected->line_adds);
cl_assert_intequal(actual.line_dels, expected->line_dels); cl_assert_equal_i(actual.line_dels, expected->line_dels);
git_diff_list_free(diff); git_diff_list_free(diff);
diff = NULL; diff = NULL;
......
...@@ -37,19 +37,19 @@ void test_diff_workdir__to_index(void) ...@@ -37,19 +37,19 @@ void test_diff_workdir__to_index(void)
* - git diff * - git diff
* - mv .git .gitted * - mv .git .gitted
*/ */
cl_assert_intequal(12, exp.files); cl_assert_equal_i(12, exp.files);
cl_assert_intequal(0, exp.file_adds); cl_assert_equal_i(0, exp.file_adds);
cl_assert_intequal(4, exp.file_dels); cl_assert_equal_i(4, exp.file_dels);
cl_assert_intequal(4, exp.file_mods); cl_assert_equal_i(4, exp.file_mods);
cl_assert_intequal(1, exp.file_ignored); cl_assert_equal_i(1, exp.file_ignored);
cl_assert_intequal(3, exp.file_untracked); cl_assert_equal_i(3, exp.file_untracked);
cl_assert_intequal(8, exp.hunks); cl_assert_equal_i(8, exp.hunks);
cl_assert_intequal(14, exp.lines); cl_assert_equal_i(14, exp.lines);
cl_assert_intequal(5, exp.line_ctxt); cl_assert_equal_i(5, exp.line_ctxt);
cl_assert_intequal(4, exp.line_adds); cl_assert_equal_i(4, exp.line_adds);
cl_assert_intequal(5, exp.line_dels); cl_assert_equal_i(5, exp.line_dels);
git_diff_list_free(diff); git_diff_list_free(diff);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment