本文整理汇总了C++中cl_fixture_cleanup函数的典型用法代码示例。如果您正苦于以下问题:C++ cl_fixture_cleanup函数的具体用法?C++ cl_fixture_cleanup怎么用?C++ cl_fixture_cleanup使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cl_fixture_cleanup函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: test_network_remote_local__update_tips_for_new_remote
void test_network_remote_local__update_tips_for_new_remote(void) {
git_repository *src_repo;
git_repository *dst_repo;
git_remote *new_remote;
git_reference* branch;
/* Copy test repo */
cl_fixture_sandbox("testrepo.git");
cl_git_pass(git_repository_open(&src_repo, "testrepo.git"));
/* Set up an empty bare repo to push into */
cl_git_pass(git_repository_init(&dst_repo, "./localbare.git", 1));
/* Push to bare repo */
cl_git_pass(git_remote_create(&new_remote, src_repo, "bare", "./localbare.git"));
cl_git_pass(git_remote_push(new_remote, &push_array, NULL));
/* Make sure remote branch has been created */
cl_git_pass(git_branch_lookup(&branch, src_repo, "bare/master", GIT_BRANCH_REMOTE));
git_reference_free(branch);
git_remote_free(new_remote);
git_repository_free(dst_repo);
cl_fixture_cleanup("localbare.git");
git_repository_free(src_repo);
cl_fixture_cleanup("testrepo.git");
}
开发者ID:rlugojr,项目名称:libgit2,代码行数:26,代码来源:local.c
示例2: test_diff_submodules__cleanup
void test_diff_submodules__cleanup(void)
{
cl_git_sandbox_cleanup();
cl_fixture_cleanup("testrepo.git");
cl_fixture_cleanup("submod2_target");
}
开发者ID:dmgctrl,项目名称:libgit2,代码行数:7,代码来源:submodules.c
示例3: test_online_clone__bitbucket_style
void test_online_clone__bitbucket_style(void)
{
git_cred_userpass_payload user_pass = {
"libgit2", "libgit2"
};
g_options.fetch_opts.callbacks.credentials = git_cred_userpass;
g_options.fetch_opts.callbacks.payload = &user_pass;
cl_git_pass(git_clone(&g_repo, BB_REPO_URL, "./foo", &g_options));
git_repository_free(g_repo); g_repo = NULL;
cl_fixture_cleanup("./foo");
/* User and pass from URL */
user_pass.password = "wrong";
cl_git_pass(git_clone(&g_repo, BB_REPO_URL_WITH_PASS, "./foo", &g_options));
git_repository_free(g_repo); g_repo = NULL;
cl_fixture_cleanup("./foo");
/* Wrong password in URL, fall back to user_pass */
user_pass.password = "libgit2";
cl_git_pass(git_clone(&g_repo, BB_REPO_URL_WITH_WRONG_PASS, "./foo", &g_options));
git_repository_free(g_repo); g_repo = NULL;
cl_fixture_cleanup("./foo");
}
开发者ID:RsrchBoy,项目名称:p5-Git-Raw,代码行数:25,代码来源:clone.c
示例4: test_repo_setters__cleanup
void test_repo_setters__cleanup(void)
{
git_repository_free(repo);
repo = NULL;
cl_fixture_cleanup("testrepo.git");
cl_fixture_cleanup("new_workdir");
}
开发者ID:1336,项目名称:libgit2,代码行数:8,代码来源:setters.c
示例5: test_index_tests__add_invalid_filename
/* Test that writing an invalid filename fails */
void test_index_tests__add_invalid_filename(void)
{
git_repository *repo;
p_mkdir("invalid", 0700);
cl_git_pass(git_repository_init(&repo, "./invalid", 0));
cl_must_pass(p_mkdir("./invalid/subdir", 0777));
/* cl_git_mkfile() needs the dir to exist */
if (!git_path_exists("./invalid/.GIT"))
cl_must_pass(p_mkdir("./invalid/.GIT", 0777));
if (!git_path_exists("./invalid/.GiT"))
cl_must_pass(p_mkdir("./invalid/.GiT", 0777));
add_invalid_filename(repo, ".git/hello");
add_invalid_filename(repo, ".GIT/hello");
add_invalid_filename(repo, ".GiT/hello");
add_invalid_filename(repo, "./.git/hello");
add_invalid_filename(repo, "./foo");
add_invalid_filename(repo, "./bar");
add_invalid_filename(repo, "subdir/../bar");
git_repository_free(repo);
cl_fixture_cleanup("invalid");
}
开发者ID:1336,项目名称:libgit2,代码行数:28,代码来源:tests.c
示例6: test_online_clone__credentials
void test_online_clone__credentials(void)
{
/* Remote URL environment variable must be set.
* User and password are optional.
*/
const char *remote_url = cl_getenv("GITTEST_REMOTE_URL");
git_cred_userpass_payload user_pass = {
cl_getenv("GITTEST_REMOTE_USER"),
cl_getenv("GITTEST_REMOTE_PASS")
};
if (!remote_url) return;
if (cl_getenv("GITTEST_REMOTE_DEFAULT")) {
g_options.remote_callbacks.credentials = cred_default;
} else {
g_options.remote_callbacks.credentials = git_cred_userpass;
g_options.remote_callbacks.payload = &user_pass;
}
cl_git_pass(git_clone(&g_repo, remote_url, "./foo", &g_options));
git_repository_free(g_repo);
g_repo = NULL;
cl_fixture_cleanup("./foo");
}
开发者ID:jasperla,项目名称:libgit2,代码行数:25,代码来源:clone.c
示例7: test_object_commit_commitstagedfile__cleanup
void test_object_commit_commitstagedfile__cleanup(void)
{
git_repository_free(repo);
repo = NULL;
cl_fixture_cleanup("treebuilder");
}
开发者ID:0CV0,项目名称:libgit2,代码行数:7,代码来源:commitstagedfile.c
示例8: cleanup_fixture_submodules
static void cleanup_fixture_submodules(void *payload)
{
cl_git_sandbox_cleanup(); /* either "submodules" or "submod2" */
if (payload)
cl_fixture_cleanup(payload);
}
开发者ID:Nikpolik,项目名称:apm,代码行数:7,代码来源:submodule_helpers.c
示例9: test_network_remotelocal__cleanup
void test_network_remotelocal__cleanup(void)
{
git_remote_free(remote);
git_buf_free(&file_path_buf);
git_repository_free(repo);
cl_fixture_cleanup("remotelocal");
}
开发者ID:gitpan,项目名称:Git-XS,代码行数:7,代码来源:remotelocal.c
示例10: test_refs_branches_create__cleanup
void test_refs_branches_create__cleanup(void)
{
git_object_free(target);
git_repository_free(repo);
cl_fixture_cleanup("testrepo.git");
}
开发者ID:Asquera,项目名称:libgit2,代码行数:7,代码来源:create.c
示例11: cleanup_repository
static void cleanup_repository(void *path)
{
git_repository_free(_repo);
_repo = NULL;
cl_fixture_cleanup((const char *)path);
}
开发者ID:Arhzi,项目名称:libgit2,代码行数:7,代码来源:init.c
示例12: test_network_remote_local__push_to_non_bare_remote
void test_network_remote_local__push_to_non_bare_remote(void)
{
char *refspec_strings[] = {
"master:master",
};
git_strarray array = {
refspec_strings,
1,
};
/* Shouldn't be able to push to a non-bare remote */
git_remote *localremote;
git_fetch_options fetch_opts = GIT_FETCH_OPTIONS_INIT;
/* Get some commits */
connect_to_local_repository(cl_fixture("testrepo.git"));
cl_git_pass(git_remote_fetch(remote, &array, &fetch_opts, NULL));
/* Set up an empty non-bare repo to push into */
{
git_repository *remoterepo = NULL;
cl_git_pass(git_repository_init(&remoterepo, "localnonbare", 0));
git_repository_free(remoterepo);
}
/* Connect to the bare repo */
cl_git_pass(git_remote_create_anonymous(&localremote, repo, "./localnonbare"));
cl_git_pass(git_remote_connect(localremote, GIT_DIRECTION_PUSH, NULL, NULL, NULL));
/* Try to push */
cl_git_fail_with(GIT_EBAREREPO, git_remote_upload(localremote, &push_array, NULL));
/* Clean up */
git_remote_free(localremote);
cl_fixture_cleanup("localbare.git");
}
开发者ID:rlugojr,项目名称:libgit2,代码行数:35,代码来源:local.c
示例13: test_network_remote_local__push_to_bare_remote
void test_network_remote_local__push_to_bare_remote(void)
{
char *refspec_strings[] = {
"master:master",
};
git_strarray array = {
refspec_strings,
1,
};
/* Should be able to push to a bare remote */
git_remote *localremote;
/* Get some commits */
connect_to_local_repository(cl_fixture("testrepo.git"));
cl_git_pass(git_remote_fetch(remote, &array, NULL, NULL));
/* Set up an empty bare repo to push into */
{
git_repository *localbarerepo;
cl_git_pass(git_repository_init(&localbarerepo, "./localbare.git", 1));
git_repository_free(localbarerepo);
}
/* Connect to the bare repo */
cl_git_pass(git_remote_create_anonymous(&localremote, repo, "./localbare.git"));
cl_git_pass(git_remote_connect(localremote, GIT_DIRECTION_PUSH, NULL, NULL, NULL));
/* Try to push */
cl_git_pass(git_remote_upload(localremote, &push_array, NULL));
/* Clean up */
git_remote_free(localremote);
cl_fixture_cleanup("localbare.git");
}
开发者ID:rlugojr,项目名称:libgit2,代码行数:35,代码来源:local.c
示例14: test_online_clone__clone_mirror
void test_online_clone__clone_mirror(void)
{
git_buf path = GIT_BUF_INIT;
git_remote *remote;
git_reference *head;
git_remote_callbacks callbacks = GIT_REMOTE_CALLBACKS_INIT;
bool fetch_progress_cb_was_called = false;
cl_git_pass(git_repository_init(&g_repo, "./foo.git", true));
cl_git_pass(git_remote_create(&remote, g_repo, "origin", LIVE_REPO_URL));
callbacks.transfer_progress = &fetch_progress;
callbacks.payload = &fetch_progress_cb_was_called;
git_remote_set_callbacks(remote, &callbacks);
git_remote_clear_refspecs(remote);
cl_git_pass(git_remote_add_fetch(remote, "+refs/*:refs/*"));
cl_git_pass(git_clone_into(g_repo, remote, NULL, NULL, NULL));
cl_git_pass(git_reference_lookup(&head, g_repo, "HEAD"));
cl_assert_equal_i(GIT_REF_SYMBOLIC, git_reference_type(head));
cl_assert_equal_s("refs/heads/master", git_reference_symbolic_target(head));
cl_assert_equal_i(true, fetch_progress_cb_was_called);
git_remote_free(remote);
git_reference_free(head);
git_buf_free(&path);
git_repository_free(g_repo);
g_repo = NULL;
cl_fixture_cleanup("./foo.git");
}
开发者ID:DonkeyWs,项目名称:libgit2,代码行数:35,代码来源:clone.c
示例15: test_refs_branches_delete__cleanup
void test_refs_branches_delete__cleanup(void)
{
git_reference_free(fake_remote);
git_repository_free(repo);
cl_fixture_cleanup("testrepo.git");
}
开发者ID:Asquera,项目名称:libgit2,代码行数:7,代码来源:delete.c
示例16: test_index_tests__write_invalid_filename
/* Test that writing an invalid filename fails */
void test_index_tests__write_invalid_filename(void)
{
git_repository *repo;
git_index *index;
git_oid expected;
p_mkdir("read_tree", 0700);
cl_git_pass(git_repository_init(&repo, "./read_tree", 0));
cl_git_pass(git_repository_index(&index, repo));
cl_assert(git_index_entrycount(index) == 0);
cl_git_mkfile("./read_tree/.git/hello", NULL);
cl_git_pass(git_index_add_bypath(index, ".git/hello"));
/* write-tree */
cl_git_fail(git_index_write_tree(&expected, index));
git_index_free(index);
git_repository_free(repo);
cl_fixture_cleanup("read_tree");
}
开发者ID:lznuaa,项目名称:libgit2,代码行数:26,代码来源:tests.c
示例17: test_commit_commit__cleanup
void test_commit_commit__cleanup(void)
{
git_repository_free(_repo);
_repo = NULL;
cl_fixture_cleanup("testrepo.git");
}
开发者ID:DonkeyWs,项目名称:libgit2,代码行数:7,代码来源:commit.c
示例18: test_index_tests__remove_entry
void test_index_tests__remove_entry(void)
{
git_repository *repo;
git_index *index;
p_mkdir("index_test", 0770);
cl_git_pass(git_repository_init(&repo, "index_test", 0));
cl_git_pass(git_repository_index(&index, repo));
cl_assert(git_index_entrycount(index) == 0);
cl_git_mkfile("index_test/hello", NULL);
cl_git_pass(git_index_add_bypath(index, "hello"));
cl_git_pass(git_index_write(index));
cl_git_pass(git_index_read(index, true)); /* reload */
cl_assert(git_index_entrycount(index) == 1);
cl_assert(git_index_get_bypath(index, "hello", 0) != NULL);
cl_git_pass(git_index_remove(index, "hello", 0));
cl_git_pass(git_index_write(index));
cl_git_pass(git_index_read(index, true)); /* reload */
cl_assert(git_index_entrycount(index) == 0);
cl_assert(git_index_get_bypath(index, "hello", 0) == NULL);
git_index_free(index);
git_repository_free(repo);
cl_fixture_cleanup("index_test");
}
开发者ID:1336,项目名称:libgit2,代码行数:30,代码来源:tests.c
示例19: test_index_addall__cleanup
void test_index_addall__cleanup(void)
{
git_repository_free(g_repo);
g_repo = NULL;
cl_fixture_cleanup(TEST_DIR);
}
开发者ID:CODECOMMUNITY,项目名称:libgit2,代码行数:7,代码来源:addall.c
示例20: test_repo_init__extended_with_template_and_shared_mode
void test_repo_init__extended_with_template_and_shared_mode(void)
{
git_repository_init_options opts = GIT_REPOSITORY_INIT_OPTIONS_INIT;
int filemode = true;
const char *repo_path = NULL;
cl_set_cleanup(&cleanup_repository, "init_shared_from_tpl");
template_sandbox("template");
opts.flags = GIT_REPOSITORY_INIT_MKPATH |
GIT_REPOSITORY_INIT_EXTERNAL_TEMPLATE;
opts.template_path = "template";
opts.mode = GIT_REPOSITORY_INIT_SHARED_GROUP;
cl_git_pass(git_repository_init_ext(&_repo, "init_shared_from_tpl", &opts));
cl_assert(!git_repository_is_bare(_repo));
cl_assert(!git__suffixcmp(git_repository_path(_repo), "/init_shared_from_tpl/.git/"));
filemode = cl_repo_get_bool(_repo, "core.filemode");
repo_path = git_repository_path(_repo);
assert_mode_seems_okay(repo_path, "hooks",
GIT_FILEMODE_TREE | GIT_REPOSITORY_INIT_SHARED_GROUP, true, filemode);
assert_mode_seems_okay(repo_path, "info",
GIT_FILEMODE_TREE | GIT_REPOSITORY_INIT_SHARED_GROUP, true, filemode);
assert_mode_seems_okay(repo_path, "description",
GIT_FILEMODE_BLOB, false, filemode);
validate_templates(_repo, "template");
cl_fixture_cleanup("template");
}
开发者ID:Arhzi,项目名称:libgit2,代码行数:33,代码来源:init.c
注:本文中的cl_fixture_cleanup函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论