summaryrefslogtreecommitdiff
path: root/tests/libgit2/graph
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2022-01-23 09:47:01 -0500
committerEdward Thomson <ethomson@edwardthomson.com>2022-06-20 17:05:29 -0400
commit3fbf580c91935ccdea25a135204419991f503b63 (patch)
tree53ec861796641faf8895a1f19444c1939ac6be9a /tests/libgit2/graph
parent61838295a055c8c7a4a7eb730538c6e08a38dd6a (diff)
downloadlibgit2-3fbf580c91935ccdea25a135204419991f503b63.tar.gz
oid: give oids a type
`git_oid`s now have a type, and we require the oid type when creating the object id from creation functions.
Diffstat (limited to 'tests/libgit2/graph')
-rw-r--r--tests/libgit2/graph/ahead_behind.c6
-rw-r--r--tests/libgit2/graph/commitgraph.c20
-rw-r--r--tests/libgit2/graph/descendant_of.c4
-rw-r--r--tests/libgit2/graph/reachable_from_any.c2
4 files changed, 16 insertions, 16 deletions
diff --git a/tests/libgit2/graph/ahead_behind.c b/tests/libgit2/graph/ahead_behind.c
index 77d7768af..e333992de 100644
--- a/tests/libgit2/graph/ahead_behind.c
+++ b/tests/libgit2/graph/ahead_behind.c
@@ -10,7 +10,7 @@ void test_graph_ahead_behind__initialize(void)
git_oid oid;
cl_git_pass(git_repository_open(&_repo, cl_fixture("testrepo.git")));
- cl_git_pass(git_oid_fromstr(&oid, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644"));
+ cl_git_pass(git_oid_fromstr(&oid, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644", GIT_OID_SHA1));
cl_git_pass(git_commit_lookup(&commit, _repo, &oid));
}
@@ -29,8 +29,8 @@ void test_graph_ahead_behind__returns_correct_result(void)
git_oid oid2;
git_commit *other;
- cl_git_pass(git_oid_fromstr(&oid, "e90810b8df3e80c413d903f631643c716887138d"));
- cl_git_pass(git_oid_fromstr(&oid2, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644"));
+ cl_git_pass(git_oid_fromstr(&oid, "e90810b8df3e80c413d903f631643c716887138d", GIT_OID_SHA1));
+ cl_git_pass(git_oid_fromstr(&oid2, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644", GIT_OID_SHA1));
cl_git_pass(git_graph_ahead_behind(&ahead, &behind, _repo, &oid, &oid2));
cl_assert_equal_sz(2, ahead);
diff --git a/tests/libgit2/graph/commitgraph.c b/tests/libgit2/graph/commitgraph.c
index 850f1947c..8d914ce11 100644
--- a/tests/libgit2/graph/commitgraph.c
+++ b/tests/libgit2/graph/commitgraph.c
@@ -19,28 +19,28 @@ void test_graph_commitgraph__parse(void)
cl_git_pass(git_commit_graph_file_open(&file, git_str_cstr(&commit_graph_path)));
cl_assert_equal_i(git_commit_graph_file_needs_refresh(file, git_str_cstr(&commit_graph_path)), 0);
- cl_git_pass(git_oid_fromstr(&id, "5001298e0c09ad9c34e4249bc5801c75e9754fa5"));
+ cl_git_pass(git_oid_fromstr(&id, "5001298e0c09ad9c34e4249bc5801c75e9754fa5", GIT_OID_SHA1));
cl_git_pass(git_commit_graph_entry_find(&e, file, &id, GIT_OID_SHA1_HEXSIZE));
cl_assert_equal_oid(&e.sha1, &id);
- cl_git_pass(git_oid_fromstr(&id, "418382dff1ffb8bdfba833f4d8bbcde58b1e7f47"));
+ cl_git_pass(git_oid_fromstr(&id, "418382dff1ffb8bdfba833f4d8bbcde58b1e7f47", GIT_OID_SHA1));
cl_assert_equal_oid(&e.tree_oid, &id);
cl_assert_equal_i(e.generation, 1);
cl_assert_equal_i(e.commit_time, UINT64_C(1273610423));
cl_assert_equal_i(e.parent_count, 0);
- cl_git_pass(git_oid_fromstr(&id, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644"));
+ cl_git_pass(git_oid_fromstr(&id, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644", GIT_OID_SHA1));
cl_git_pass(git_commit_graph_entry_find(&e, file, &id, GIT_OID_SHA1_HEXSIZE));
cl_assert_equal_oid(&e.sha1, &id);
cl_assert_equal_i(e.generation, 5);
cl_assert_equal_i(e.commit_time, UINT64_C(1274813907));
cl_assert_equal_i(e.parent_count, 2);
- cl_git_pass(git_oid_fromstr(&id, "9fd738e8f7967c078dceed8190330fc8648ee56a"));
+ cl_git_pass(git_oid_fromstr(&id, "9fd738e8f7967c078dceed8190330fc8648ee56a", GIT_OID_SHA1));
cl_git_pass(git_commit_graph_entry_parent(&parent, file, &e, 0));
cl_assert_equal_oid(&parent.sha1, &id);
cl_assert_equal_i(parent.generation, 4);
- cl_git_pass(git_oid_fromstr(&id, "c47800c7266a2be04c571c04d5a6614691ea99bd"));
+ cl_git_pass(git_oid_fromstr(&id, "c47800c7266a2be04c571c04d5a6614691ea99bd", GIT_OID_SHA1));
cl_git_pass(git_commit_graph_entry_parent(&parent, file, &e, 1));
cl_assert_equal_oid(&parent.sha1, &id);
cl_assert_equal_i(parent.generation, 3);
@@ -62,26 +62,26 @@ void test_graph_commitgraph__parse_octopus_merge(void)
cl_git_pass(git_str_joinpath(&commit_graph_path, git_repository_path(repo), "objects/info/commit-graph"));
cl_git_pass(git_commit_graph_file_open(&file, git_str_cstr(&commit_graph_path)));
- cl_git_pass(git_oid_fromstr(&id, "d71c24b3b113fd1d1909998c5bfe33b86a65ee03"));
+ cl_git_pass(git_oid_fromstr(&id, "d71c24b3b113fd1d1909998c5bfe33b86a65ee03", GIT_OID_SHA1));
cl_git_pass(git_commit_graph_entry_find(&e, file, &id, GIT_OID_SHA1_HEXSIZE));
cl_assert_equal_oid(&e.sha1, &id);
- cl_git_pass(git_oid_fromstr(&id, "348f16ffaeb73f319a75cec5b16a0a47d2d5e27c"));
+ cl_git_pass(git_oid_fromstr(&id, "348f16ffaeb73f319a75cec5b16a0a47d2d5e27c", GIT_OID_SHA1));
cl_assert_equal_oid(&e.tree_oid, &id);
cl_assert_equal_i(e.generation, 7);
cl_assert_equal_i(e.commit_time, UINT64_C(1447083009));
cl_assert_equal_i(e.parent_count, 3);
- cl_git_pass(git_oid_fromstr(&id, "ad2ace9e15f66b3d1138922e6ffdc3ea3f967fa6"));
+ cl_git_pass(git_oid_fromstr(&id, "ad2ace9e15f66b3d1138922e6ffdc3ea3f967fa6", GIT_OID_SHA1));
cl_git_pass(git_commit_graph_entry_parent(&parent, file, &e, 0));
cl_assert_equal_oid(&parent.sha1, &id);
cl_assert_equal_i(parent.generation, 6);
- cl_git_pass(git_oid_fromstr(&id, "483065df53c0f4a02cdc6b2910b05d388fc17ffb"));
+ cl_git_pass(git_oid_fromstr(&id, "483065df53c0f4a02cdc6b2910b05d388fc17ffb", GIT_OID_SHA1));
cl_git_pass(git_commit_graph_entry_parent(&parent, file, &e, 1));
cl_assert_equal_oid(&parent.sha1, &id);
cl_assert_equal_i(parent.generation, 2);
- cl_git_pass(git_oid_fromstr(&id, "815b5a1c80ca749d705c7aa0cb294a00cbedd340"));
+ cl_git_pass(git_oid_fromstr(&id, "815b5a1c80ca749d705c7aa0cb294a00cbedd340", GIT_OID_SHA1));
cl_git_pass(git_commit_graph_entry_parent(&parent, file, &e, 2));
cl_assert_equal_oid(&parent.sha1, &id);
cl_assert_equal_i(parent.generation, 6);
diff --git a/tests/libgit2/graph/descendant_of.c b/tests/libgit2/graph/descendant_of.c
index 8e9952a09..0eacb314a 100644
--- a/tests/libgit2/graph/descendant_of.c
+++ b/tests/libgit2/graph/descendant_of.c
@@ -9,7 +9,7 @@ void test_graph_descendant_of__initialize(void)
cl_git_pass(git_repository_open(&_repo, cl_fixture("testrepo.git")));
- git_oid_fromstr(&oid, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644");
+ git_oid_fromstr(&oid, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&commit, _repo, &oid));
}
@@ -50,6 +50,6 @@ void test_graph_descendant_of__nopath(void)
{
git_oid oid;
- git_oid_fromstr(&oid, "e90810b8df3e80c413d903f631643c716887138d");
+ git_oid_fromstr(&oid, "e90810b8df3e80c413d903f631643c716887138d", GIT_OID_SHA1);
cl_assert_equal_i(0, git_graph_descendant_of(_repo, git_commit_id(commit), &oid));
}
diff --git a/tests/libgit2/graph/reachable_from_any.c b/tests/libgit2/graph/reachable_from_any.c
index 9693d7d67..d246cdbc0 100644
--- a/tests/libgit2/graph/reachable_from_any.c
+++ b/tests/libgit2/graph/reachable_from_any.c
@@ -17,7 +17,7 @@ void test_graph_reachable_from_any__initialize(void)
repo = cl_git_sandbox_init(TEST_REPO_PATH);
- git_oid_fromstr(&oid, "539bd011c4822c560c1d17cab095006b7a10f707");
+ git_oid_fromstr(&oid, "539bd011c4822c560c1d17cab095006b7a10f707", GIT_OID_SHA1);
cl_git_pass(git_commit_lookup(&commit, repo, &oid));
cl_git_pass(git_reset(repo, (git_object *)commit, GIT_RESET_HARD, NULL));
git_commit_free(commit);