mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-29 08:11:58 +00:00
Moved tag tests to object suite.
This commit is contained in:
parent
9a39a36424
commit
6bb7499312
@ -30,18 +30,18 @@ exit:
|
|||||||
|
|
||||||
|
|
||||||
// Fixture setup and teardown
|
// Fixture setup and teardown
|
||||||
void test_tag_read__initialize(void)
|
void test_object_tag_read__initialize(void)
|
||||||
{
|
{
|
||||||
g_repo = cl_git_sandbox_init("testrepo");
|
g_repo = cl_git_sandbox_init("testrepo");
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_tag_read__cleanup(void)
|
void test_object_tag_read__cleanup(void)
|
||||||
{
|
{
|
||||||
cl_git_sandbox_cleanup();
|
cl_git_sandbox_cleanup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void test_tag_read__parse(void)
|
void test_object_tag_read__parse(void)
|
||||||
{
|
{
|
||||||
// read and parse a tag from the repository
|
// read and parse a tag from the repository
|
||||||
git_tag *tag1, *tag2;
|
git_tag *tag1, *tag2;
|
||||||
@ -72,7 +72,7 @@ void test_tag_read__parse(void)
|
|||||||
git_commit_free(commit);
|
git_commit_free(commit);
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_tag_read__list(void)
|
void test_object_tag_read__list(void)
|
||||||
{
|
{
|
||||||
// list all tag names from the repository
|
// list all tag names from the repository
|
||||||
git_strarray tag_list;
|
git_strarray tag_list;
|
||||||
@ -84,7 +84,7 @@ void test_tag_read__list(void)
|
|||||||
git_strarray_free(&tag_list);
|
git_strarray_free(&tag_list);
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_tag_read__list_pattern(void)
|
void test_object_tag_read__list_pattern(void)
|
||||||
{
|
{
|
||||||
// list all tag names from the repository matching a specified pattern
|
// list all tag names from the repository matching a specified pattern
|
||||||
cl_git_pass(ensure_tag_pattern_match(g_repo, "", 3));
|
cl_git_pass(ensure_tag_pattern_match(g_repo, "", 3));
|
||||||
@ -96,7 +96,7 @@ void test_tag_read__list_pattern(void)
|
|||||||
cl_git_pass(ensure_tag_pattern_match(g_repo, "e90810[ab]", 1));
|
cl_git_pass(ensure_tag_pattern_match(g_repo, "e90810[ab]", 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_tag_read__parse_without_tagger(void)
|
void test_object_tag_read__parse_without_tagger(void)
|
||||||
{
|
{
|
||||||
// read and parse a tag without a tagger field
|
// read and parse a tag without a tagger field
|
||||||
git_repository *bad_tag_repo;
|
git_repository *bad_tag_repo;
|
@ -59,19 +59,19 @@ static int loose_object_mode(const char *repository_folder, git_object *object)
|
|||||||
|
|
||||||
|
|
||||||
// Fixture setup and teardown
|
// Fixture setup and teardown
|
||||||
void test_tag_write__initialize(void)
|
void test_object_tag_write__initialize(void)
|
||||||
{
|
{
|
||||||
g_repo = cl_git_sandbox_init("testrepo");
|
g_repo = cl_git_sandbox_init("testrepo");
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_tag_write__cleanup(void)
|
void test_object_tag_write__cleanup(void)
|
||||||
{
|
{
|
||||||
cl_git_sandbox_cleanup();
|
cl_git_sandbox_cleanup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void test_tag_write__basic(void)
|
void test_object_tag_write__basic(void)
|
||||||
{
|
{
|
||||||
// write a tag to the repository and read it again
|
// write a tag to the repository and read it again
|
||||||
git_tag *tag;
|
git_tag *tag;
|
||||||
@ -123,7 +123,7 @@ void test_tag_write__basic(void)
|
|||||||
git_tag_free(tag);
|
git_tag_free(tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_tag_write__overwrite(void)
|
void test_object_tag_write__overwrite(void)
|
||||||
{
|
{
|
||||||
// Attempt to write a tag bearing the same name than an already existing tag
|
// Attempt to write a tag bearing the same name than an already existing tag
|
||||||
git_oid target_id, tag_id;
|
git_oid target_id, tag_id;
|
||||||
@ -150,7 +150,7 @@ void test_tag_write__overwrite(void)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_tag_write__replace(void)
|
void test_object_tag_write__replace(void)
|
||||||
{
|
{
|
||||||
// Replace an already existing tag
|
// Replace an already existing tag
|
||||||
git_oid target_id, tag_id, old_tag_id;
|
git_oid target_id, tag_id, old_tag_id;
|
||||||
@ -187,7 +187,7 @@ void test_tag_write__replace(void)
|
|||||||
git_reference_free(ref_tag);
|
git_reference_free(ref_tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_tag_write__lightweight(void)
|
void test_object_tag_write__lightweight(void)
|
||||||
{
|
{
|
||||||
// write a lightweight tag to the repository and read it again
|
// write a lightweight tag to the repository and read it again
|
||||||
git_oid target_id, object_id;
|
git_oid target_id, object_id;
|
||||||
@ -216,7 +216,7 @@ void test_tag_write__lightweight(void)
|
|||||||
git_reference_free(ref_tag);
|
git_reference_free(ref_tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_tag_write__lightweight_over_existing(void)
|
void test_object_tag_write__lightweight_over_existing(void)
|
||||||
{
|
{
|
||||||
// Attempt to write a lightweight tag bearing the same name than an already existing tag
|
// Attempt to write a lightweight tag bearing the same name than an already existing tag
|
||||||
git_oid target_id, object_id, existing_object_id;
|
git_oid target_id, object_id, existing_object_id;
|
||||||
@ -238,7 +238,7 @@ void test_tag_write__lightweight_over_existing(void)
|
|||||||
git_object_free(target);
|
git_object_free(target);
|
||||||
}
|
}
|
||||||
|
|
||||||
void test_tag_write__delete(void)
|
void test_object_tag_write__delete(void)
|
||||||
{
|
{
|
||||||
// Delete an already existing tag
|
// Delete an already existing tag
|
||||||
git_reference *ref_tag;
|
git_reference *ref_tag;
|
Loading…
Reference in New Issue
Block a user