• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ cl_assert_equal_s函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中cl_assert_equal_s函数的典型用法代码示例。如果您正苦于以下问题:C++ cl_assert_equal_s函数的具体用法?C++ cl_assert_equal_s怎么用?C++ cl_assert_equal_s使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了cl_assert_equal_s函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: test_refs_branches_delete__can_not_delete_a_branch_pointed_at_by_HEAD

void test_refs_branches_delete__can_not_delete_a_branch_pointed_at_by_HEAD(void)
{
	git_reference *head;
	git_reference *branch;

	/* Ensure HEAD targets the local master branch */
	cl_git_pass(git_reference_lookup(&head, repo, GIT_HEAD_FILE));
	cl_assert_equal_s("refs/heads/master", git_reference_symbolic_target(head));
	git_reference_free(head);

	cl_git_pass(git_branch_lookup(&branch, repo, "master", GIT_BRANCH_LOCAL));
	cl_git_fail(git_branch_delete(branch));
	git_reference_free(branch);
}
开发者ID:0CV0,项目名称:libgit2,代码行数:14,代码来源:delete.c


示例2: test_diff_stats__numstat

void test_diff_stats__numstat(void)
{
	git_buf buf = GIT_BUF_INIT;
	const char *stat =
	"3       2       file2.txt\n"
	"4       2       file3.txt\n";

	diff_stats_from_commit_oid(
		&_stats, "cd471f0d8770371e1bc78bcbb38db4c7e4106bd2", false);

	cl_git_pass(git_diff_stats_to_buf(&buf, _stats, GIT_DIFF_STATS_NUMBER, 0));
	cl_assert_equal_s(stat, git_buf_cstr(&buf));
	git_buf_free(&buf);
}
开发者ID:fbezdeka,项目名称:libgit2,代码行数:14,代码来源:stats.c


示例3: test_refs_branches_move__moving_the_branch_pointed_at_by_HEAD_updates_HEAD

void test_refs_branches_move__moving_the_branch_pointed_at_by_HEAD_updates_HEAD(void)
{
	git_reference *branch;
	git_reference *new_branch;

	cl_git_pass(git_reference_lookup(&branch, repo, "refs/heads/master"));
	cl_git_pass(git_branch_move(&new_branch, branch, "master2", 0));
	git_reference_free(branch);
	git_reference_free(new_branch);

	cl_git_pass(git_repository_head(&branch, repo));
	cl_assert_equal_s("refs/heads/master2", git_reference_name(branch));
	git_reference_free(branch);
}
开发者ID:CodeSmithyIDE,项目名称:libgit2,代码行数:14,代码来源:move.c


示例4: test_odb_backend_nobackend__write_fails_gracefully

void test_odb_backend_nobackend__write_fails_gracefully(void)
{
	git_oid id;
	git_odb *odb;
	const git_error *err;

	git_repository_odb(&odb, _repo);
	cl_git_fail(git_odb_write(&id, odb, "Hello world!\n", 13, GIT_OBJ_BLOB));

	err = giterr_last();
	cl_assert_equal_s(err->message, "cannot write object - unsupported in the loaded odb backends");

	git_odb_free(odb);
}
开发者ID:Arhzi,项目名称:libgit2,代码行数:14,代码来源:nobackend.c


示例5: test_repo_init__can_reinit_an_initialized_repository

void test_repo_init__can_reinit_an_initialized_repository(void)
{
	git_repository *reinit;

	cl_git_pass(git_futils_mkdir("extended", NULL, 0775, 0));
	cl_git_pass(git_repository_init(&_repo, "extended", false));

	cl_git_pass(git_repository_init(&reinit, "extended", false));

	cl_assert_equal_s(git_repository_path(_repo), git_repository_path(reinit));

	git_repository_free(reinit);
	cleanup_repository("extended");
}
开发者ID:ralpheav,项目名称:PM_GIT,代码行数:14,代码来源:init.c


示例6: confirm_submodule_status

static int confirm_submodule_status(
	const char *path, unsigned int status_flags, void *payload)
{
	submodule_expectations *exp = payload;

	while (git__suffixcmp(exp->paths[exp->counter], "/") == 0)
		exp->counter++;

	cl_assert_equal_s(exp->paths[exp->counter++], path);

	GIT_UNUSED(status_flags);

	return 0;
}
开发者ID:0CV0,项目名称:libgit2,代码行数:14,代码来源:status.c


示例7: check_fromurl

static void check_fromurl(const char *expected_result, const char *input, int should_fail)
{
	git_buf buf = GIT_BUF_INIT;

	assert(should_fail || expected_result);

	if (!should_fail) {
		cl_git_pass(git_path_fromurl(&buf, input));
		cl_assert_equal_s(expected_result, git_buf_cstr(&buf));
	} else
		cl_git_fail(git_path_fromurl(&buf, input));

	git_buf_dispose(&buf);
}
开发者ID:CodeSmithyIDE,项目名称:libgit2,代码行数:14,代码来源:path.c


示例8: test_refs_read__loose_first

void test_refs_read__loose_first(void)
{
   // assure that a loose reference is looked up before a packed reference
	git_reference *reference;

	cl_git_pass(git_reference_lookup(&reference, g_repo, packed_head_name));
	git_reference_free(reference);
	cl_git_pass(git_reference_lookup(&reference, g_repo, packed_test_head_name));
	cl_assert(git_reference_type(reference) & GIT_REF_OID);
	cl_assert(git_reference_is_packed(reference) == 0);
	cl_assert_equal_s(reference->name, packed_test_head_name);

	git_reference_free(reference);
}
开发者ID:duralog,项目名称:node-sencillo,代码行数:14,代码来源:read.c


示例9: test_rebase_merge__finish_with_ids

void test_rebase_merge__finish_with_ids(void)
{
	git_rebase *rebase;
	git_reference *head_ref;
	git_oid branch_id, upstream_id;
	git_annotated_commit *branch_head, *upstream_head;
	git_rebase_operation *rebase_operation;
	git_oid commit_id;
	git_reflog *reflog;
	const git_reflog_entry *reflog_entry;
	int error;

	cl_git_pass(git_oid_fromstr(&branch_id, "d616d97082eb7bb2dc6f180a7cca940993b7a56f"));
	cl_git_pass(git_oid_fromstr(&upstream_id, "f87d14a4a236582a0278a916340a793714256864"));

	cl_git_pass(git_annotated_commit_lookup(&branch_head, repo, &branch_id));
	cl_git_pass(git_annotated_commit_lookup(&upstream_head, repo, &upstream_id));

	cl_git_pass(git_rebase_init(&rebase, repo, branch_head, upstream_head, NULL, NULL));

	cl_git_pass(git_rebase_next(&rebase_operation, rebase));
	cl_git_pass(git_rebase_commit(&commit_id, rebase, NULL, signature,
		NULL, NULL));

	cl_git_fail(error = git_rebase_next(&rebase_operation, rebase));
	cl_assert_equal_i(GIT_ITEROVER, error);

	cl_git_pass(git_rebase_finish(rebase, signature));

	cl_assert_equal_i(GIT_REPOSITORY_STATE_NONE, git_repository_state(repo));

	cl_git_pass(git_reference_lookup(&head_ref, repo, "HEAD"));
	cl_assert_equal_i(GIT_REF_OID, git_reference_type(head_ref));
	cl_assert_equal_oid(&commit_id, git_reference_target(head_ref));

	/* reflogs are not updated as if we were operating on proper
	 * branches.  check that the last reflog entry is the rebase.
	 */
	cl_git_pass(git_reflog_read(&reflog, repo, "HEAD"));
	cl_assert(reflog_entry = git_reflog_entry_byindex(reflog, 0));
	cl_assert_equal_oid(&commit_id, git_reflog_entry_id_new(reflog_entry));
	cl_assert_equal_s("rebase: Modification 3 to gravy", git_reflog_entry_message(reflog_entry));
	git_reflog_free(reflog);

	git_annotated_commit_free(branch_head);
	git_annotated_commit_free(upstream_head);
	git_reference_free(head_ref);
	git_rebase_free(rebase);
}
开发者ID:J1978,项目名称:libgit2,代码行数:49,代码来源:merge.c


示例10: test_reset_hard__resetting_reverts_modified_files

void test_reset_hard__resetting_reverts_modified_files(void)
{
    git_buf path = GIT_BUF_INIT, content = GIT_BUF_INIT;
    int i;
    static const char *files[4] = {
        "current_file",
        "modified_file",
        "staged_new_file",
        "staged_changes_modified_file"
    };
    static const char *before[4] = {
        "current_file\n",
        "modified_file\nmodified_file\n",
        "staged_new_file\n",
        "staged_changes_modified_file\nstaged_changes_modified_file\nstaged_changes_modified_file\n"
    };
    static const char *after[4] = {
        "current_file\n",
        "modified_file\n",
        NULL,
        "staged_changes_modified_file\n"
    };
    const char *wd = git_repository_workdir(repo);

    cl_assert(wd);

    for (i = 0; i < 4; ++i) {
        cl_git_pass(git_buf_joinpath(&path, wd, files[i]));
        cl_git_pass(git_futils_readbuffer(&content, path.ptr));
        cl_assert_equal_s(before[i], content.ptr);
    }

    cl_git_pass(git_revparse_single(&target, repo, "26a125e"));

    cl_git_pass(git_reset(repo, target, GIT_RESET_HARD, NULL));

    for (i = 0; i < 4; ++i) {
        cl_git_pass(git_buf_joinpath(&path, wd, files[i]));
        if (after[i]) {
            cl_git_pass(git_futils_readbuffer(&content, path.ptr));
            cl_assert(strequal_ignore_eol(after[i], content.ptr));
        } else {
            cl_assert(!git_path_exists(path.ptr));
        }
    }

    git_buf_free(&content);
    git_buf_free(&path);
}
开发者ID:jasperla,项目名称:libgit2,代码行数:49,代码来源:hard.c


示例11: index_iterator_test

static void index_iterator_test(
	const char *sandbox,
	const char *start,
	const char *end,
	git_iterator_flag_t flags,
	int expected_count,
	const char **expected_names,
	const char **expected_oids)
{
	git_index *index;
	git_iterator *i;
	const git_index_entry *entry;
	int error, count = 0, caps;
	git_repository *repo = cl_git_sandbox_init(sandbox);
	git_iterator_options iter_opts = GIT_ITERATOR_OPTIONS_INIT;

	cl_git_pass(git_repository_index(&index, repo));
	caps = git_index_caps(index);

	iter_opts.flags = flags;
	iter_opts.start = start;
	iter_opts.end = end;

	cl_git_pass(git_iterator_for_index(&i, repo, index, &iter_opts));

	while (!(error = git_iterator_advance(&entry, i))) {
		cl_assert(entry);

		if (expected_names != NULL)
			cl_assert_equal_s(expected_names[count], entry->path);

		if (expected_oids != NULL) {
			git_oid oid;
			cl_git_pass(git_oid_fromstr(&oid, expected_oids[count]));
			cl_assert_equal_oid(&oid, &entry->id);
		}

		count++;
	}

	cl_assert_equal_i(GIT_ITEROVER, error);
	cl_assert(!entry);
	cl_assert_equal_i(expected_count, count);

	git_iterator_free(i);

	cl_assert(caps == git_index_caps(index));
	git_index_free(index);
}
开发者ID:VishnuTSuresh,项目名称:alerttool-client,代码行数:49,代码来源:iterator.c


示例12: test_online_clone__empty_repository

void test_online_clone__empty_repository(void)
{
	git_reference *head;

	cl_git_pass(git_clone(&g_repo, LIVE_EMPTYREPO_URL, "./foo", &g_options));

	cl_assert_equal_i(true, git_repository_is_empty(g_repo));
	cl_assert_equal_i(true, git_repository_head_unborn(g_repo));

	cl_git_pass(git_reference_lookup(&head, g_repo, GIT_HEAD_FILE));
	cl_assert_equal_i(GIT_REF_SYMBOLIC, git_reference_type(head));
	cl_assert_equal_s("refs/heads/master", git_reference_symbolic_target(head));

	git_reference_free(head);
}
开发者ID:RsrchBoy,项目名称:p5-Git-Raw,代码行数:15,代码来源:clone.c


示例13: test_network_remote_remotes__pushurl

void test_network_remote_remotes__pushurl(void)
{
	const char *name = git_remote_name(_remote);
	git_remote *mod;

	cl_git_pass(git_remote_set_pushurl(_repo, name, "git://github.com/libgit2/notlibgit2"));
	cl_git_pass(git_remote_lookup(&mod, _repo, name));
	cl_assert_equal_s(git_remote_pushurl(mod), "git://github.com/libgit2/notlibgit2");
	git_remote_free(mod);

	cl_git_pass(git_remote_set_pushurl(_repo, name, NULL));
	cl_git_pass(git_remote_lookup(&mod, _repo, name));
	cl_assert(git_remote_pushurl(mod) == NULL);
	git_remote_free(mod);
}
开发者ID:Angolier,项目名称:sonic-pi,代码行数:15,代码来源:remotes.c


示例14: test_object_shortid__select

void test_object_shortid__select(void)
{
	git_oid full;
	git_object *obj;
	git_buf shorty = {0};

	git_oid_fromstr(&full, "ce013625030ba8dba906f756967f9e9ca394464a");
	cl_git_pass(git_object_lookup(&obj, _repo, &full, GIT_OBJ_ANY));
	cl_git_pass(git_object_short_id(&shorty, obj));
	cl_assert_equal_i(7, shorty.size);
	cl_assert_equal_s("ce01362", shorty.ptr);
	git_object_free(obj);

	git_oid_fromstr(&full, "038d718da6a1ebbc6a7780a96ed75a70cc2ad6e2");
	cl_git_pass(git_object_lookup(&obj, _repo, &full, GIT_OBJ_ANY));
	cl_git_pass(git_object_short_id(&shorty, obj));
	cl_assert_equal_i(7, shorty.size);
	cl_assert_equal_s("038d718", shorty.ptr);
	git_object_free(obj);

	git_oid_fromstr(&full, "dea509d097ce692e167dfc6a48a7a280cc5e877e");
	cl_git_pass(git_object_lookup(&obj, _repo, &full, GIT_OBJ_ANY));
	cl_git_pass(git_object_short_id(&shorty, obj));
	cl_assert_equal_i(9, shorty.size);
	cl_assert_equal_s("dea509d09", shorty.ptr);
	git_object_free(obj);

	git_oid_fromstr(&full, "dea509d0b3cb8ee0650f6ca210bc83f4678851ba");
	cl_git_pass(git_object_lookup(&obj, _repo, &full, GIT_OBJ_ANY));
	cl_git_pass(git_object_short_id(&shorty, obj));
	cl_assert_equal_i(9, shorty.size);
	cl_assert_equal_s("dea509d0b", shorty.ptr);
	git_object_free(obj);

	git_buf_free(&shorty);
}
开发者ID:1336,项目名称:libgit2,代码行数:36,代码来源:shortid.c


示例15: test_diff_stats__mode_change

void test_diff_stats__mode_change(void)
{
	git_buf buf = GIT_BUF_INIT;
	const char *stat =
	" file1.txt.renamed | 0\n" \
	" 1 file changed, 0 insertions(+), 0 deletions(-)\n" \
		" mode change 100644 => 100755 file1.txt.renamed\n";

	diff_stats_from_commit_oid(
		&_stats, "7ade76dd34bba4733cf9878079f9fd4a456a9189", false);

	cl_git_pass(git_diff_stats_to_buf(&buf, _stats, GIT_DIFF_STATS_FULL | GIT_DIFF_STATS_INCLUDE_SUMMARY, 0));
	cl_assert_equal_s(stat, git_buf_cstr(&buf));
	git_buf_free(&buf);
}
开发者ID:Kat7984,项目名称:libgit2,代码行数:15,代码来源:stats.c


示例16: test_config_read__case_sensitive

void test_config_read__case_sensitive(void)
{
	git_config *cfg;
	int i;

	cl_git_pass(git_config_open_ondisk(&cfg, cl_fixture("config/config1")));

	cl_git_pass(git_config_get_string_buf(&buf, cfg, "this.that.other"));
	cl_assert_equal_s("true", git_buf_cstr(&buf));
	git_buf_clear(&buf);

	cl_git_pass(git_config_get_string_buf(&buf, cfg, "this.That.other"));
	cl_assert_equal_s("yes", git_buf_cstr(&buf));

	cl_git_pass(git_config_get_bool(&i, cfg, "this.that.other"));
	cl_assert(i == 1);
	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(&i, cfg, "this.thaT.other"));

	git_config_free(cfg);
}
开发者ID:CodeSmithyIDE,项目名称:libgit2,代码行数:24,代码来源:read.c


示例17: test_nav__nav_it_theta_opts_no_diff

void test_nav__nav_it_theta_opts_no_diff(void)
{
    int i;

    ssm_options_t *opts_nd = ssm_options_new();
    opts_nd->noises_off = SSM_NO_DIFF;
    ssm_nav_t *nav_nd = ssm_nav_new(jparameters, opts_nd);

    cl_check(nav_nd->theta_no_icsv_no_icdiff->length == 7);
    cl_check(nav_nd->theta_icsv_icdiff->length == 3);

    char *expected_names[] = {"pr_I_nyc", "pr_I_paris", "pr_S_paris"};
    for(i=0; i<nav_nd->theta_icsv_icdiff->length; i++) {
        cl_assert_equal_s(nav_nd->theta_icsv_icdiff->p[i]->name, expected_names[i]);
    }

    char *expected_names_no[] = {"r0_nyc", "r0_paris", "pr_v", "rep_all_CDC_inc", "rep_all_google_inc", "rep_nyc_CDC_inc", "rep_paris_CDC_prev"};
    for(i=0; i<nav_nd->theta_no_icsv_no_icdiff->length; i++) {
        cl_assert_equal_s(nav_nd->theta_no_icsv_no_icdiff->p[i]->name, expected_names_no[i]);
    }

    ssm_options_free(opts_nd);
    ssm_nav_free(nav_nd);
}
开发者ID:nvdnkpr,项目名称:ssm,代码行数:24,代码来源:nav.c


示例18: assert_correct_reflog

static void assert_correct_reflog(const char *name)
{
	git_reflog *log;
	const git_reflog_entry *entry;
	char expected_log_message[128] = {0};

	sprintf(expected_log_message, "clone: from %s", cl_git_fixture_url("testrepo.git"));

	cl_git_pass(git_reflog_read(&log, g_repo, name));
	cl_assert_equal_i(1, git_reflog_entrycount(log));
	entry = git_reflog_entry_byindex(log, 0);
	cl_assert_equal_s(expected_log_message, git_reflog_entry_message(entry));

	git_reflog_free(log);
}
开发者ID:1336,项目名称:libgit2,代码行数:15,代码来源:nonetwork.c


示例19: test_index_reuc__write

void test_index_reuc__write(void)
{
	git_oid ancestor_oid, our_oid, their_oid;
	const git_index_reuc_entry *reuc;

	git_index_clear(repo_index);

	/* Write out of order to ensure sorting is correct */
	git_oid_fromstr(&ancestor_oid, TWO_ANCESTOR_OID);
	git_oid_fromstr(&our_oid, TWO_OUR_OID);
	git_oid_fromstr(&their_oid, TWO_THEIR_OID);

	cl_git_pass(git_index_reuc_add(repo_index, "two.txt",
		0100644, &ancestor_oid,
		0100644, &our_oid,
		0100644, &their_oid));

	git_oid_fromstr(&ancestor_oid, ONE_ANCESTOR_OID);
	git_oid_fromstr(&our_oid, ONE_OUR_OID);
	git_oid_fromstr(&their_oid, ONE_THEIR_OID);

	cl_git_pass(git_index_reuc_add(repo_index, "one.txt",
		0100644, &ancestor_oid,
		0100644, &our_oid,
		0100644, &their_oid));

	cl_git_pass(git_index_write(repo_index));
	cl_assert_equal_i(2, git_index_reuc_entrycount(repo_index));

	/* ensure sort order was round-tripped correct */
	cl_assert(reuc = git_index_reuc_get_byindex(repo_index, 0));
	cl_assert_equal_s("one.txt", reuc->path);

	cl_assert(reuc = git_index_reuc_get_byindex(repo_index, 1));
	cl_assert_equal_s("two.txt", reuc->path);
}
开发者ID:DaneTheory,项目名称:libgit2,代码行数:36,代码来源:reuc.c


示例20: test_core_buffer__base64

void test_core_buffer__base64(void)
{
	git_buf buf = GIT_BUF_INIT;

	/*     t  h  i  s
	 * 0x 74 68 69 73
     * 0b 01110100 01101000 01101001 01110011
	 * 0b 011101 000110 100001 101001 011100 110000
	 * 0x 1d 06 21 29 1c 30
	 *     d  G  h  p  c  w
	 */
	cl_git_pass(git_buf_put_base64(&buf, "this", 4));
	cl_assert_equal_s("dGhpcw==", buf.ptr);

	git_buf_clear(&buf);
	cl_git_pass(git_buf_put_base64(&buf, "this!", 5));
	cl_assert_equal_s("dGhpcyE=", buf.ptr);

	git_buf_clear(&buf);
	cl_git_pass(git_buf_put_base64(&buf, "this!\n", 6));
	cl_assert_equal_s("dGhpcyEK", buf.ptr);

	git_buf_free(&buf);
}
开发者ID:duralog,项目名称:node-sencillo,代码行数:24,代码来源:buffer.c



注:本文中的cl_assert_equal_s函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ cl_assert_equal_sz函数代码示例发布时间:2022-05-30
下一篇:
C++ cl_assert_equal_oid函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap