summaryrefslogtreecommitdiff
path: root/tests-clar
diff options
context:
space:
mode:
Diffstat (limited to 'tests-clar')
-rw-r--r--tests-clar/attr/flags.c58
-rw-r--r--tests-clar/attr/repo.c26
-rw-r--r--tests-clar/commit/signature.c4
-rw-r--r--tests-clar/config/add.c4
-rw-r--r--tests-clar/config/multivar.c4
-rw-r--r--tests-clar/config/new.c4
-rw-r--r--tests-clar/config/read.c52
-rw-r--r--tests-clar/config/stress.c10
-rw-r--r--tests-clar/config/write.c10
-rw-r--r--tests-clar/index/tests.c4
-rw-r--r--tests-clar/network/remotelocal.c2
-rw-r--r--tests-clar/object/tag/read.c4
-rw-r--r--tests-clar/object/tree/frompath.c14
-rw-r--r--tests-clar/refs/branches/delete.c2
-rw-r--r--tests-clar/refs/list.c4
-rw-r--r--tests-clar/refs/listall.c2
-rw-r--r--tests-clar/repo/open.c2
-rw-r--r--tests-clar/revwalk/basic.c12
18 files changed, 109 insertions, 109 deletions
diff --git a/tests-clar/attr/flags.c b/tests-clar/attr/flags.c
index 5081de8b2..80c6e1171 100644
--- a/tests-clar/attr/flags.c
+++ b/tests-clar/attr/flags.c
@@ -14,7 +14,7 @@ void test_attr_flags__bare(void)
cl_assert(git_repository_is_bare(repo));
cl_git_pass(git_attr_get(
- repo, GIT_ATTR_CHECK_NO_SYSTEM, "README.md", "diff", &value));
+ &value, repo, GIT_ATTR_CHECK_NO_SYSTEM, "README.md", "diff"));
cl_assert(GIT_ATTR_UNSPECIFIED(value));
}
@@ -27,34 +27,34 @@ void test_attr_flags__index_vs_workdir(void)
/* wd then index */
cl_git_pass(git_attr_get(
- repo, GIT_ATTR_CHECK_NO_SYSTEM | GIT_ATTR_CHECK_FILE_THEN_INDEX,
- "README.md", "bar", &value));
+ &value, repo, GIT_ATTR_CHECK_NO_SYSTEM | GIT_ATTR_CHECK_FILE_THEN_INDEX,
+ "README.md", "bar"));
cl_assert(GIT_ATTR_FALSE(value));
cl_git_pass(git_attr_get(
- repo, GIT_ATTR_CHECK_NO_SYSTEM | GIT_ATTR_CHECK_FILE_THEN_INDEX,
- "README.md", "blargh", &value));
+ &value, repo, GIT_ATTR_CHECK_NO_SYSTEM | GIT_ATTR_CHECK_FILE_THEN_INDEX,
+ "README.md", "blargh"));
cl_assert_equal_s(value, "goop");
cl_git_pass(git_attr_get(
- repo, GIT_ATTR_CHECK_NO_SYSTEM | GIT_ATTR_CHECK_FILE_THEN_INDEX,
- "README.txt", "foo", &value));
+ &value, repo, GIT_ATTR_CHECK_NO_SYSTEM | GIT_ATTR_CHECK_FILE_THEN_INDEX,
+ "README.txt", "foo"));
cl_assert(GIT_ATTR_FALSE(value));
/* index then wd */
cl_git_pass(git_attr_get(
- repo, GIT_ATTR_CHECK_NO_SYSTEM | GIT_ATTR_CHECK_INDEX_THEN_FILE,
- "README.md", "bar", &value));
+ &value, repo, GIT_ATTR_CHECK_NO_SYSTEM | GIT_ATTR_CHECK_INDEX_THEN_FILE,
+ "README.md", "bar"));
cl_assert(GIT_ATTR_TRUE(value));
cl_git_pass(git_attr_get(
- repo, GIT_ATTR_CHECK_NO_SYSTEM | GIT_ATTR_CHECK_INDEX_THEN_FILE,
- "README.md", "blargh", &value));
+ &value, repo, GIT_ATTR_CHECK_NO_SYSTEM | GIT_ATTR_CHECK_INDEX_THEN_FILE,
+ "README.md", "blargh"));
cl_assert_equal_s(value, "garble");
cl_git_pass(git_attr_get(
- repo, GIT_ATTR_CHECK_NO_SYSTEM | GIT_ATTR_CHECK_INDEX_THEN_FILE,
- "README.txt", "foo", &value));
+ &value, repo, GIT_ATTR_CHECK_NO_SYSTEM | GIT_ATTR_CHECK_INDEX_THEN_FILE,
+ "README.txt", "foo"));
cl_assert(GIT_ATTR_TRUE(value));
}
@@ -65,44 +65,44 @@ void test_attr_flags__subdir(void)
/* wd then index */
cl_git_pass(git_attr_get(
- repo, GIT_ATTR_CHECK_NO_SYSTEM | GIT_ATTR_CHECK_FILE_THEN_INDEX,
- "sub/sub/README.md", "bar", &value));
+ &value, repo, GIT_ATTR_CHECK_NO_SYSTEM | GIT_ATTR_CHECK_FILE_THEN_INDEX,
+ "sub/sub/README.md", "bar"));
cl_assert_equal_s(value, "1234");
cl_git_pass(git_attr_get(
- repo, GIT_ATTR_CHECK_NO_SYSTEM | GIT_ATTR_CHECK_FILE_THEN_INDEX,
- "sub/sub/README.txt", "another", &value));
+ &value, repo, GIT_ATTR_CHECK_NO_SYSTEM | GIT_ATTR_CHECK_FILE_THEN_INDEX,
+ "sub/sub/README.txt", "another"));
cl_assert_equal_s(value, "one");
cl_git_pass(git_attr_get(
- repo, GIT_ATTR_CHECK_NO_SYSTEM | GIT_ATTR_CHECK_FILE_THEN_INDEX,
- "sub/sub/README.txt", "again", &value));
+ &value, repo, GIT_ATTR_CHECK_NO_SYSTEM | GIT_ATTR_CHECK_FILE_THEN_INDEX,
+ "sub/sub/README.txt", "again"));
cl_assert(GIT_ATTR_TRUE(value));
cl_git_pass(git_attr_get(
- repo, GIT_ATTR_CHECK_NO_SYSTEM | GIT_ATTR_CHECK_FILE_THEN_INDEX,
- "sub/sub/README.txt", "beep", &value));
+ &value, repo, GIT_ATTR_CHECK_NO_SYSTEM | GIT_ATTR_CHECK_FILE_THEN_INDEX,
+ "sub/sub/README.txt", "beep"));
cl_assert_equal_s(value, "10");
/* index then wd */
cl_git_pass(git_attr_get(
- repo, GIT_ATTR_CHECK_NO_SYSTEM | GIT_ATTR_CHECK_INDEX_THEN_FILE,
- "sub/sub/README.md", "bar", &value));
+ &value, repo, GIT_ATTR_CHECK_NO_SYSTEM | GIT_ATTR_CHECK_INDEX_THEN_FILE,
+ "sub/sub/README.md", "bar"));
cl_assert_equal_s(value, "1337");
cl_git_pass(git_attr_get(
- repo, GIT_ATTR_CHECK_NO_SYSTEM | GIT_ATTR_CHECK_INDEX_THEN_FILE,
- "sub/sub/README.txt", "another", &value));
+ &value, repo, GIT_ATTR_CHECK_NO_SYSTEM | GIT_ATTR_CHECK_INDEX_THEN_FILE,
+ "sub/sub/README.txt", "another"));
cl_assert_equal_s(value, "one");
cl_git_pass(git_attr_get(
- repo, GIT_ATTR_CHECK_NO_SYSTEM | GIT_ATTR_CHECK_INDEX_THEN_FILE,
- "sub/sub/README.txt", "again", &value));
+ &value, repo, GIT_ATTR_CHECK_NO_SYSTEM | GIT_ATTR_CHECK_INDEX_THEN_FILE,
+ "sub/sub/README.txt", "again"));
cl_assert(GIT_ATTR_TRUE(value));
cl_git_pass(git_attr_get(
- repo, GIT_ATTR_CHECK_NO_SYSTEM | GIT_ATTR_CHECK_INDEX_THEN_FILE,
- "sub/sub/README.txt", "beep", &value));
+ &value, repo, GIT_ATTR_CHECK_NO_SYSTEM | GIT_ATTR_CHECK_INDEX_THEN_FILE,
+ "sub/sub/README.txt", "beep"));
cl_assert_equal_s(value, "5");
}
diff --git a/tests-clar/attr/repo.c b/tests-clar/attr/repo.c
index 006a49081..a88dfb3f9 100644
--- a/tests-clar/attr/repo.c
+++ b/tests-clar/attr/repo.c
@@ -64,7 +64,7 @@ void test_attr_repo__get_one(void)
for (scan = test_cases; scan->path != NULL; scan++) {
const char *value;
- cl_git_pass(git_attr_get(g_repo, 0, scan->path, scan->attr, &value));
+ cl_git_pass(git_attr_get(&value, g_repo, 0, scan->path, scan->attr));
attr_check_expected(scan->expected, scan->expected_str, value);
}
@@ -78,21 +78,21 @@ void test_attr_repo__get_many(void)
const char *names[4] = { "repoattr", "rootattr", "missingattr", "subattr" };
const char *values[4];
- cl_git_pass(git_attr_get_many(g_repo, 0, "root_test1", 4, names, values));
+ cl_git_pass(git_attr_get_many(values, g_repo, 0, "root_test1", 4, names));
cl_assert(GIT_ATTR_TRUE(values[0]));
cl_assert(GIT_ATTR_TRUE(values[1]));
cl_assert(GIT_ATTR_UNSPECIFIED(values[2]));
cl_assert(GIT_ATTR_UNSPECIFIED(values[3]));
- cl_git_pass(git_attr_get_many(g_repo, 0, "root_test2", 4, names, values));
+ cl_git_pass(git_attr_get_many(values, g_repo, 0, "root_test2", 4, names));
cl_assert(GIT_ATTR_TRUE(values[0]));
cl_assert(GIT_ATTR_FALSE(values[1]));
cl_assert(GIT_ATTR_UNSPECIFIED(values[2]));
cl_assert(GIT_ATTR_UNSPECIFIED(values[3]));
- cl_git_pass(git_attr_get_many(g_repo, 0, "sub/subdir_test1", 4, names, values));
+ cl_git_pass(git_attr_get_many(values, g_repo, 0, "sub/subdir_test1", 4, names));
cl_assert(GIT_ATTR_TRUE(values[0]));
cl_assert(GIT_ATTR_TRUE(values[1]));
@@ -137,19 +137,19 @@ void test_attr_repo__manpage_example(void)
{
const char *value;
- cl_git_pass(git_attr_get(g_repo, 0, "sub/abc", "foo", &value));
+ cl_git_pass(git_attr_get(&value, g_repo, 0, "sub/abc", "foo"));
cl_assert(GIT_ATTR_TRUE(value));
- cl_git_pass(git_attr_get(g_repo, 0, "sub/abc", "bar", &value));
+ cl_git_pass(git_attr_get(&value, g_repo, 0, "sub/abc", "bar"));
cl_assert(GIT_ATTR_UNSPECIFIED(value));
- cl_git_pass(git_attr_get(g_repo, 0, "sub/abc", "baz", &value));
+ cl_git_pass(git_attr_get(&value, g_repo, 0, "sub/abc", "baz"));
cl_assert(GIT_ATTR_FALSE(value));
- cl_git_pass(git_attr_get(g_repo, 0, "sub/abc", "merge", &value));
+ cl_git_pass(git_attr_get(&value, g_repo, 0, "sub/abc", "merge"));
cl_assert_equal_s("filfre", value);
- cl_git_pass(git_attr_get(g_repo, 0, "sub/abc", "frotz", &value));
+ cl_git_pass(git_attr_get(&value, g_repo, 0, "sub/abc", "frotz"));
cl_assert(GIT_ATTR_UNSPECIFIED(value));
}
@@ -160,7 +160,7 @@ void test_attr_repo__macros(void)
const char *names3[3] = { "macro2", "multi2", "multi3" };
const char *values[5];
- cl_git_pass(git_attr_get_many(g_repo, 0, "binfile", 5, names, values));
+ cl_git_pass(git_attr_get_many(values, g_repo, 0, "binfile", 5, names));
cl_assert(GIT_ATTR_TRUE(values[0]));
cl_assert(GIT_ATTR_TRUE(values[1]));
@@ -168,7 +168,7 @@ void test_attr_repo__macros(void)
cl_assert(GIT_ATTR_FALSE(values[3]));
cl_assert(GIT_ATTR_UNSPECIFIED(values[4]));
- cl_git_pass(git_attr_get_many(g_repo, 0, "macro_test", 5, names2, values));
+ cl_git_pass(git_attr_get_many(values, g_repo, 0, "macro_test", 5, names2));
cl_assert(GIT_ATTR_TRUE(values[0]));
cl_assert(GIT_ATTR_TRUE(values[1]));
@@ -176,7 +176,7 @@ void test_attr_repo__macros(void)
cl_assert(GIT_ATTR_UNSPECIFIED(values[3]));
cl_assert_equal_s("77", values[4]);
- cl_git_pass(git_attr_get_many(g_repo, 0, "macro_test", 3, names3, values));
+ cl_git_pass(git_attr_get_many(values, g_repo, 0, "macro_test", 3, names3));
cl_assert(GIT_ATTR_TRUE(values[0]));
cl_assert(GIT_ATTR_FALSE(values[1]));
@@ -189,7 +189,7 @@ void test_attr_repo__bad_macros(void)
"firstmacro", "secondmacro", "thirdmacro" };
const char *values[6];
- cl_git_pass(git_attr_get_many(g_repo, 0, "macro_bad", 6, names, values));
+ cl_git_pass(git_attr_get_many(values, g_repo, 0, "macro_bad", 6, names));
/* these three just confirm that the "mymacro" rule ran */
cl_assert(GIT_ATTR_UNSPECIFIED(values[0]));
diff --git a/tests-clar/commit/signature.c b/tests-clar/commit/signature.c
index 605b8330a..290b11fa3 100644
--- a/tests-clar/commit/signature.c
+++ b/tests-clar/commit/signature.c
@@ -3,9 +3,9 @@
static int try_build_signature(const char *name, const char *email, git_time_t time, int offset)
{
git_signature *sign;
- int error = GIT_SUCCESS;
+ int error = 0;
- if ((error = git_signature_new(&sign, name, email, time, offset)) < GIT_SUCCESS)
+ if ((error = git_signature_new(&sign, name, email, time, offset)) < 0)
return error;
git_signature_free((git_signature *)sign);
diff --git a/tests-clar/config/add.c b/tests-clar/config/add.c
index b58029951..9854fbb39 100644
--- a/tests-clar/config/add.c
+++ b/tests-clar/config/add.c
@@ -17,7 +17,7 @@ void test_config_add__to_existing_section(void)
cl_git_pass(git_config_open_ondisk(&cfg, "config10"));
cl_git_pass(git_config_set_int32(cfg, "empty.tmp", 5));
- cl_git_pass(git_config_get_int32(cfg, "empty.tmp", &i));
+ cl_git_pass(git_config_get_int32(&i, cfg, "empty.tmp"));
cl_assert(i == 5);
cl_git_pass(git_config_delete(cfg, "empty.tmp"));
git_config_free(cfg);
@@ -30,7 +30,7 @@ void test_config_add__to_new_section(void)
cl_git_pass(git_config_open_ondisk(&cfg, "config10"));
cl_git_pass(git_config_set_int32(cfg, "section.tmp", 5));
- cl_git_pass(git_config_get_int32(cfg, "section.tmp", &i));
+ cl_git_pass(git_config_get_int32(&i, cfg, "section.tmp"));
cl_assert(i == 5);
cl_git_pass(git_config_delete(cfg, "section.tmp"));
git_config_free(cfg);
diff --git a/tests-clar/config/multivar.c b/tests-clar/config/multivar.c
index d3784c0dd..3b40cd09a 100644
--- a/tests-clar/config/multivar.c
+++ b/tests-clar/config/multivar.c
@@ -21,7 +21,7 @@ static int mv_read_cb(const char *name, const char *value, void *data)
if (!strcmp(name, _name))
(*n)++;
- return GIT_SUCCESS;
+ return 0;
}
void test_config_multivar__foreach(void)
@@ -45,7 +45,7 @@ static int cb(const char *val, void *data)
(*n)++;
- return GIT_SUCCESS;
+ return 0;
}
void test_config_multivar__get(void)
diff --git a/tests-clar/config/new.c b/tests-clar/config/new.c
index 78e8ec828..fae3ce941 100644
--- a/tests-clar/config/new.c
+++ b/tests-clar/config/new.c
@@ -25,9 +25,9 @@ void test_config_new__write_new_config(void)
cl_git_pass(git_config_new(&config));
cl_git_pass(git_config_add_file(config, file, 0));
- cl_git_pass(git_config_get_string(config, "color.ui", &out));
+ cl_git_pass(git_config_get_string(&out, config, "color.ui"));
cl_assert_equal_s(out, "auto");
- cl_git_pass(git_config_get_string(config, "core.editor", &out));
+ cl_git_pass(git_config_get_string(&out, config, "core.editor"));
cl_assert_equal_s(out, "ed");
git_config_free(config);
diff --git a/tests-clar/config/read.c b/tests-clar/config/read.c
index 3e9a8d4bf..f33bdd89e 100644
--- a/tests-clar/config/read.c
+++ b/tests-clar/config/read.c
@@ -7,13 +7,13 @@ void test_config_read__simple_read(void)
cl_git_pass(git_config_open_ondisk(&cfg, cl_fixture("config/config0")));
- cl_git_pass(git_config_get_int32(cfg, "core.repositoryformatversion", &i));
+ cl_git_pass(git_config_get_int32(&i, cfg, "core.repositoryformatversion"));
cl_assert(i == 0);
- cl_git_pass(git_config_get_bool(cfg, "core.filemode", &i));
+ cl_git_pass(git_config_get_bool(&i, cfg, "core.filemode"));
cl_assert(i == 1);
- cl_git_pass(git_config_get_bool(cfg, "core.bare", &i));
+ cl_git_pass(git_config_get_bool(&i, cfg, "core.bare"));
cl_assert(i == 0);
- cl_git_pass(git_config_get_bool(cfg, "core.logallrefupdates", &i));
+ cl_git_pass(git_config_get_bool(&i, cfg, "core.logallrefupdates"));
cl_assert(i == 1);
git_config_free(cfg);
@@ -27,18 +27,18 @@ void test_config_read__case_sensitive(void)
cl_git_pass(git_config_open_ondisk(&cfg, cl_fixture("config/config1")));
- cl_git_pass(git_config_get_string(cfg, "this.that.other", &str));
+ cl_git_pass(git_config_get_string(&str, cfg, "this.that.other"));
cl_assert_equal_s(str, "true");
- cl_git_pass(git_config_get_string(cfg, "this.That.other", &str));
+ cl_git_pass(git_config_get_string(&str, cfg, "this.That.other"));
cl_assert_equal_s(str, "yes");
- cl_git_pass(git_config_get_bool(cfg, "this.that.other", &i));
+ cl_git_pass(git_config_get_bool(&i, cfg, "this.that.other"));
cl_assert(i == 1);
- cl_git_pass(git_config_get_bool(cfg, "this.That.other", &i));
+ cl_git_pass(git_config_get_bool(&i, cfg, "this.That.other"));
cl_assert(i == 1);
/* This one doesn't exist */
- cl_must_fail(git_config_get_bool(cfg, "this.thaT.other", &i));
+ cl_must_fail(git_config_get_bool(&i, cfg, "this.thaT.other"));
git_config_free(cfg);
}
@@ -54,7 +54,7 @@ void test_config_read__multiline_value(void)
cl_git_pass(git_config_open_ondisk(&cfg, cl_fixture("config/config2")));
- cl_git_pass(git_config_get_string(cfg, "this.That.and", &str));
+ cl_git_pass(git_config_get_string(&str, cfg, "this.That.and"));
cl_assert_equal_s(str, "one one one two two three three");
git_config_free(cfg);
@@ -70,11 +70,11 @@ void test_config_read__subsection_header(void)
cl_git_pass(git_config_open_ondisk(&cfg, cl_fixture("config/config3")));
- cl_git_pass(git_config_get_string(cfg, "section.subsection.var", &str));
+ cl_git_pass(git_config_get_string(&str, cfg, "section.subsection.var"));
cl_assert_equal_s(str, "hello");
/* The subsection is transformed to lower-case */
- cl_must_fail(git_config_get_string(cfg, "section.subSectIon.var", &str));
+ cl_must_fail(git_config_get_string(&str, cfg, "section.subSectIon.var"));
git_config_free(cfg);
}
@@ -87,10 +87,10 @@ void test_config_read__lone_variable(void)
cl_git_pass(git_config_open_ondisk(&cfg, cl_fixture("config/config4")));
- cl_git_pass(git_config_get_string(cfg, "some.section.variable", &str));
+ cl_git_pass(git_config_get_string(&str, cfg, "some.section.variable"));
cl_assert(str == NULL);
- cl_git_pass(git_config_get_bool(cfg, "some.section.variable", &i));
+ cl_git_pass(git_config_get_bool(&i, cfg, "some.section.variable"));
cl_assert(i == 1);
git_config_free(cfg);
@@ -103,25 +103,25 @@ void test_config_read__number_suffixes(void)
cl_git_pass(git_config_open_ondisk(&cfg, cl_fixture("config/config5")));
- cl_git_pass(git_config_get_int64(cfg, "number.simple", &i));
+ cl_git_pass(git_config_get_int64(&i, cfg, "number.simple"));
cl_assert(i == 1);
- cl_git_pass(git_config_get_int64(cfg, "number.k", &i));
+ cl_git_pass(git_config_get_int64(&i, cfg, "number.k"));
cl_assert(i == 1 * 1024);
- cl_git_pass(git_config_get_int64(cfg, "number.kk", &i));
+ cl_git_pass(git_config_get_int64(&i, cfg, "number.kk"));
cl_assert(i == 1 * 1024);
- cl_git_pass(git_config_get_int64(cfg, "number.m", &i));
+ cl_git_pass(git_config_get_int64(&i, cfg, "number.m"));
cl_assert(i == 1 * 1024 * 1024);
- cl_git_pass(git_config_get_int64(cfg, "number.mm", &i));
+ cl_git_pass(git_config_get_int64(&i, cfg, "number.mm"));
cl_assert(i == 1 * 1024 * 1024);
- cl_git_pass(git_config_get_int64(cfg, "number.g", &i));
+ cl_git_pass(git_config_get_int64(&i, cfg, "number.g"));
cl_assert(i == 1 * 1024 * 1024 * 1024);
- cl_git_pass(git_config_get_int64(cfg, "number.gg", &i));
+ cl_git_pass(git_config_get_int64(&i, cfg, "number.gg"));
cl_assert(i == 1 * 1024 * 1024 * 1024);
git_config_free(cfg);
@@ -134,10 +134,10 @@ void test_config_read__blank_lines(void)
cl_git_pass(git_config_open_ondisk(&cfg, cl_fixture("config/config6")));
- cl_git_pass(git_config_get_bool(cfg, "valid.subsection.something", &i));
+ cl_git_pass(git_config_get_bool(&i, cfg, "valid.subsection.something"));
cl_assert(i == 1);
- cl_git_pass(git_config_get_bool(cfg, "something.else.something", &i));
+ cl_git_pass(git_config_get_bool(&i, cfg, "something.else.something"));
cl_assert(i == 0);
git_config_free(cfg);
@@ -170,10 +170,10 @@ void test_config_read__prefixes(void)
const char *str;
cl_git_pass(git_config_open_ondisk(&cfg, cl_fixture("config/config9")));
- cl_git_pass(git_config_get_string(cfg, "remote.ab.url", &str));
+ cl_git_pass(git_config_get_string(&str, cfg, "remote.ab.url"));
cl_assert_equal_s(str, "http://example.com/git/ab");
- cl_git_pass(git_config_get_string(cfg, "remote.abba.url", &str));
+ cl_git_pass(git_config_get_string(&str, cfg, "remote.abba.url"));
cl_assert_equal_s(str, "http://example.com/git/abba");
git_config_free(cfg);
@@ -185,7 +185,7 @@ void test_config_read__escaping_quotes(void)
const char *str;
cl_git_pass(git_config_open_ondisk(&cfg, cl_fixture("config/config13")));
- cl_git_pass(git_config_get_string(cfg, "core.editor", &str));
+ cl_git_pass(git_config_get_string(&str, cfg, "core.editor"));
cl_assert(strcmp(str, "\"C:/Program Files/Nonsense/bah.exe\" \"--some option\"") == 0);
git_config_free(cfg);
diff --git a/tests-clar/config/stress.c b/tests-clar/config/stress.c
index 54a61ad67..3de1f7692 100644
--- a/tests-clar/config/stress.c
+++ b/tests-clar/config/stress.c
@@ -32,8 +32,8 @@ void test_config_stress__dont_break_on_invalid_input(void)
cl_git_pass(git_config_new(&config));
cl_git_pass(git_config_add_file(config, file, 0));
- cl_git_pass(git_config_get_string(config, "color.ui", &color));
- cl_git_pass(git_config_get_string(config, "core.editor", &editor));
+ cl_git_pass(git_config_get_string(&color, config, "color.ui"));
+ cl_git_pass(git_config_get_string(&editor, config, "core.editor"));
git_config_free(config);
}
@@ -48,13 +48,13 @@ void test_config_stress__comments(void)
cl_git_pass(git_config_new(&config));
cl_git_pass(git_config_add_file(config, file, 0));
- cl_git_pass(git_config_get_string(config, "some.section.other", &str));
+ cl_git_pass(git_config_get_string(&str, config, "some.section.other"));
cl_assert(!strcmp(str, "hello! \" ; ; ; "));
- cl_git_pass(git_config_get_string(config, "some.section.multi", &str));
+ cl_git_pass(git_config_get_string(&str, config, "some.section.multi"));
cl_assert(!strcmp(str, "hi, this is a ; multiline comment # with ;\n special chars and other stuff !@#"));
- cl_git_pass(git_config_get_string(config, "some.section.back", &str));
+ cl_git_pass(git_config_get_string(&str, config, "some.section.back"));
cl_assert(!strcmp(str, "this is \ba phrase"));
git_config_free(config);
diff --git a/tests-clar/config/write.c b/tests-clar/config/write.c
index f25bf5a91..f8774473e 100644
--- a/tests-clar/config/write.c
+++ b/tests-clar/config/write.c
@@ -22,7 +22,7 @@ void test_config_write__replace_value(void)
git_config_free(cfg);
cl_git_pass(git_config_open_ondisk(&cfg, "config9"));
- cl_git_pass(git_config_get_int32(cfg, "core.dummy", &i));
+ cl_git_pass(git_config_get_int32(&i, cfg, "core.dummy"));
cl_assert(i == 5);
git_config_free(cfg);
@@ -35,12 +35,12 @@ void test_config_write__replace_value(void)
git_config_free(cfg);
cl_git_pass(git_config_open_ondisk(&cfg, "config9"));
- cl_git_pass(git_config_get_int64(cfg, "core.verylong", &l));
+ cl_git_pass(git_config_get_int64(&l, cfg, "core.verylong"));
cl_assert(l == expected);
git_config_free(cfg);
cl_git_pass(git_config_open_ondisk(&cfg, "config9"));
- cl_must_fail(git_config_get_int32(cfg, "core.verylong", &i));
+ cl_must_fail(git_config_get_int32(&i, cfg, "core.verylong"));
git_config_free(cfg);
cl_git_pass(git_config_open_ondisk(&cfg, "config9"));
@@ -62,7 +62,7 @@ void test_config_write__delete_value(void)
git_config_free(cfg);
cl_git_pass(git_config_open_ondisk(&cfg, "config9"));
- cl_assert(git_config_get_int32(cfg, "core.dummy", &i) == GIT_ENOTFOUND);
+ cl_assert(git_config_get_int32(&i, cfg, "core.dummy") == GIT_ENOTFOUND);
cl_git_pass(git_config_set_int32(cfg, "core.dummy", 1));
git_config_free(cfg);
}
@@ -77,7 +77,7 @@ void test_config_write__write_subsection(void)
git_config_free(cfg);
cl_git_pass(git_config_open_ondisk(&cfg, "config9"));
- cl_git_pass(git_config_get_string(cfg, "my.own.var", &str));
+ cl_git_pass(git_config_get_string(&str, cfg, "my.own.var"));
cl_git_pass(strcmp(str, "works"));
git_config_free(cfg);
}
diff --git a/tests-clar/index/tests.c b/tests-clar/index/tests.c
index 3d01b7cfb..3436f8d1e 100644
--- a/tests-clar/index/tests.c
+++ b/tests-clar/index/tests.c
@@ -50,10 +50,10 @@ static void files_are_equal(const char *a, const char *b)
git_buf buf_b = GIT_BUF_INIT;
int pass;
- if (git_futils_readbuffer(&buf_a, a) < GIT_SUCCESS)
+ if (git_futils_readbuffer(&buf_a, a) < 0)
cl_assert(0);
- if (git_futils_readbuffer(&buf_b, b) < GIT_SUCCESS) {
+ if (git_futils_readbuffer(&buf_b, b) < 0) {
git_buf_free(&buf_a);
cl_assert(0);
}
diff --git a/tests-clar/network/remotelocal.c b/tests-clar/network/remotelocal.c
index 35fa072ef..98abbbeb9 100644
--- a/tests-clar/network/remotelocal.c
+++ b/tests-clar/network/remotelocal.c
@@ -68,7 +68,7 @@ static int count_ref__cb(git_remote_head *head, void *payload)
(void)head;
(*count)++;
- return GIT_SUCCESS;
+ return 0;
}
static int ensure_peeled__cb(git_remote_head *head, void *payload)
diff --git a/tests-clar/object/tag/read.c b/tests-clar/object/tag/read.c
index cfeb3aeee..6a0ad8a23 100644
--- a/tests-clar/object/tag/read.c
+++ b/tests-clar/object/tag/read.c
@@ -17,9 +17,9 @@ static void ensure_tag_pattern_match(git_repository *repo,
const size_t expected_matches)
{
git_strarray tag_list;
- int error = GIT_SUCCESS;
+ int error = 0;
- if ((error = git_tag_list_match(&tag_list, pattern, repo)) < GIT_SUCCESS)
+ if ((error = git_tag_list_match(&tag_list, pattern, repo)) < 0)
goto exit;
if (tag_list.count != expected_matches)
diff --git a/tests-clar/object/tree/frompath.c b/tests-clar/object/tree/frompath.c
index ea0add37b..06c69ac08 100644
--- a/tests-clar/object/tree/frompath.c
+++ b/tests-clar/object/tree/frompath.c
@@ -30,10 +30,10 @@ static void assert_tree_from_path(git_tree *root, const char *path, int expected
cl_assert(git_tree_get_subtree(&containing_tree, root, path) == expected_result);
- if (containing_tree == NULL && expected_result != GIT_SUCCESS)
+ if (containing_tree == NULL && expected_result != 0)
return;
- cl_assert(containing_tree != NULL && expected_result == GIT_SUCCESS);
+ cl_assert(containing_tree != NULL && expected_result == 0);
cl_git_pass(git_oid_streq(git_object_id((const git_object *)containing_tree), expected_raw_oid));
@@ -49,19 +49,19 @@ static void assert_tree_from_path_klass(git_tree *root, const char *path, int ex
void test_object_tree_frompath__retrieve_tree_from_path_to_treeentry(void)
{
/* Will return self if given a one path segment... */
- assert_tree_from_path(tree, "README", GIT_SUCCESS, tree_with_subtrees_oid);
+ assert_tree_from_path(tree, "README", 0, tree_with_subtrees_oid);
/* ...even one that lead to a non existent tree entry. */
- assert_tree_from_path(tree, "i-do-not-exist.txt", GIT_SUCCESS, tree_with_subtrees_oid);
+ assert_tree_from_path(tree, "i-do-not-exist.txt", 0, tree_with_subtrees_oid);
/* Will return fgh tree oid given this following path... */
- assert_tree_from_path(tree, "ab/de/fgh/1.txt", GIT_SUCCESS, "3259a6bd5b57fb9c1281bb7ed3167b50f224cb54");
+ assert_tree_from_path(tree, "ab/de/fgh/1.txt", 0, "3259a6bd5b57fb9c1281bb7ed3167b50f224cb54");
/* ... and ab tree oid given this one. */
- assert_tree_from_path(tree, "ab/de", GIT_SUCCESS, "f1425cef211cc08caa31e7b545ffb232acb098c3");
+ assert_tree_from_path(tree, "ab/de", 0, "f1425cef211cc08caa31e7b545ffb232acb098c3");
/* Will succeed if given a valid path which leads to a tree entry which doesn't exist */
- assert_tree_from_path(tree, "ab/de/fgh/i-do-not-exist.txt", GIT_SUCCESS, "3259a6bd5b57fb9c1281bb7ed3167b50f224cb54");
+ assert_tree_from_path(tree, "ab/de/fgh/i-do-not-exist.txt", 0, "3259a6bd5b57fb9c1281bb7ed3167b50f224cb54");
}
void test_object_tree_frompath__fail_when_processing_an_unknown_tree_segment(void)
diff --git a/tests-clar/refs/branches/delete.c b/tests-clar/refs/branches/delete.c
index 8ccfaf32f..03d3c56d7 100644
--- a/tests-clar/refs/branches/delete.c
+++ b/tests-clar/refs/branches/delete.c
@@ -75,7 +75,7 @@ void test_refs_branches_delete__can_delete_a_remote_branch(void)
cl_git_pass(git_branch_delete(repo, "nulltoken/master", GIT_BRANCH_REMOTE));
}
-static void assert_non_exisitng_branch_removal(const char *branch_name, git_branch_type branch_type)
+static void assert_non_exisitng_branch_removal(const char *branch_name, git_branch_t branch_type)
{
int error;
error = git_branch_delete(repo, branch_name, branch_type);
diff --git a/tests-clar/refs/list.c b/tests-clar/refs/list.c
index f673bd9be..2a7b157ca 100644
--- a/tests-clar/refs/list.c
+++ b/tests-clar/refs/list.c
@@ -25,7 +25,7 @@ void test_refs_list__all(void)
// try to list all the references in our test repo
git_strarray ref_list;
- cl_git_pass(git_reference_listall(&ref_list, g_repo, GIT_REF_LISTALL));
+ cl_git_pass(git_reference_list(&ref_list, g_repo, GIT_REF_LISTALL));
/*{
unsigned short i;
@@ -46,7 +46,7 @@ void test_refs_list__symbolic_only(void)
// try to list only the symbolic references
git_strarray ref_list;
- cl_git_pass(git_reference_listall(&ref_list, g_repo, GIT_REF_SYMBOLIC));
+ cl_git_pass(git_reference_list(&ref_list, g_repo, GIT_REF_SYMBOLIC));
cl_assert(ref_list.count == 0); /* no symrefs in the test repo */
git_strarray_free(&ref_list);
diff --git a/tests-clar/refs/listall.c b/tests-clar/refs/listall.c
index ced40a26e..7f1de74cc 100644
--- a/tests-clar/refs/listall.c
+++ b/tests-clar/refs/listall.c
@@ -9,7 +9,7 @@ static void ensure_no_refname_starts_with_a_forward_slash(const char *path)
size_t i;
cl_git_pass(git_repository_open(&repo, path));
- cl_git_pass(git_reference_listall(&ref_list, repo, GIT_REF_LISTALL));
+ cl_git_pass(git_reference_list(&ref_list, repo, GIT_REF_LISTALL));
cl_assert(ref_list.count > 0);
diff --git a/tests-clar/repo/open.c b/tests-clar/repo/open.c
index 292466390..c70ec83a9 100644
--- a/tests-clar/repo/open.c
+++ b/tests-clar/repo/open.c
@@ -279,4 +279,4 @@ void test_repo_open__opening_a_non_existing_repository_returns_ENOTFOUND(void)
{
git_repository *repo;
cl_assert_equal_i(GIT_ENOTFOUND, git_repository_open(&repo, "i-do-not/exist"));
-} \ No newline at end of file
+}
diff --git a/tests-clar/revwalk/basic.c b/tests-clar/revwalk/basic.c
index 7d54ce990..a5a9b2eda 100644
--- a/tests-clar/revwalk/basic.c
+++ b/tests-clar/revwalk/basic.c
@@ -73,7 +73,7 @@ static int test_walk(git_revwalk *walk, const git_oid *root,
i = 0;
- while (git_revwalk_next(&oid, walk) == GIT_SUCCESS) {
+ while (git_revwalk_next(&oid, walk) == 0) {
result_array[i++] = get_commit_index(&oid);
/*{
char str[41];
@@ -86,7 +86,7 @@ static int test_walk(git_revwalk *walk, const git_oid *root,
for (i = 0; i < results_count; ++i)
if (memcmp(possible_results[i],
result_array, result_bytes) == 0)
- return GIT_SUCCESS;
+ return 0;
return GIT_ERROR;
}
@@ -125,7 +125,7 @@ void test_revwalk_basic__glob_heads(void)
cl_git_pass(git_revwalk_push_glob(_walk, "heads"));
- while (git_revwalk_next(&oid, _walk) == GIT_SUCCESS) {
+ while (git_revwalk_next(&oid, _walk) == 0) {
i++;
}
@@ -140,7 +140,7 @@ void test_revwalk_basic__push_head(void)
cl_git_pass(git_revwalk_push_head(_walk));
- while (git_revwalk_next(&oid, _walk) == GIT_SUCCESS) {
+ while (git_revwalk_next(&oid, _walk) == 0) {
i++;
}
@@ -156,7 +156,7 @@ void test_revwalk_basic__push_head_hide_ref(void)
cl_git_pass(git_revwalk_push_head(_walk));
cl_git_pass(git_revwalk_hide_ref(_walk, "refs/heads/packed-test"));
- while (git_revwalk_next(&oid, _walk) == GIT_SUCCESS) {
+ while (git_revwalk_next(&oid, _walk) == 0) {
i++;
}
@@ -172,7 +172,7 @@ void test_revwalk_basic__push_head_hide_ref_nobase(void)
cl_git_pass(git_revwalk_push_head(_walk));
cl_git_pass(git_revwalk_hide_ref(_walk, "refs/heads/packed"));
- while (git_revwalk_next(&oid, _walk) == GIT_SUCCESS) {
+ while (git_revwalk_next(&oid, _walk) == 0) {
i++;
}