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

C++ cut_assert_not_null函数代码示例

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

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



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

示例1: test_output_stream

void
test_output_stream (void)
{
    GError *error = NULL;
    GInputStream *stream;
    char buffer[4096];
    gsize bytes_read;

    process = gcut_process_new(cuttest_echo_path, "XXX", NULL);

    stream = gcut_process_get_output_stream(process);
    cut_assert_not_null(stream);

    gcut_process_run(process, &error);
    gcut_assert_error(error);
    wait_exited();

    g_input_stream_read_all(stream,
                            buffer, sizeof(buffer),
                            &bytes_read,
                            NULL,
                            &error);
    gcut_assert_error(error);
    cut_assert_equal_memory("XXX\n", 4, buffer, bytes_read);
}
开发者ID:clear-code,项目名称:cutter,代码行数:25,代码来源:test-gcut-process.c


示例2: test_mifare_desfire_get_tag_friendly_name

void
test_mifare_desfire_get_tag_friendly_name (void)
{
    const char *name = freefare_get_tag_friendly_name (tag);

    cut_assert_not_null (name, cut_message ("freefare_get_tag_friendly_name() failed"));
}
开发者ID:jofell,项目名称:CocoaTag,代码行数:7,代码来源:test_mifare_desfire.c


示例3: test_set_data

void
test_set_data (void)
{
    CutTestData *current_test_data;
    const gchar name[] = "sample test data";
    const gchar value[] = "sample test value";

    cut_assert_false(cut_test_context_have_data(context));

    test_data = cut_test_data_new(name, g_strdup(value), string_data_free);
    cut_test_context_set_data(context, test_data);
    g_object_unref(test_data);
    test_data = NULL;
    cut_assert_false(destroy_called);
    cut_assert_equal_string(NULL, destroyed_string);

    cut_assert_true(cut_test_context_have_data(context));
    current_test_data = cut_test_context_get_current_data(context);
    cut_assert_not_null(current_test_data);
    cut_assert_equal_string(value, cut_test_data_get_value(current_test_data));

    cut_assert_false(destroy_called);
    cut_assert_equal_string(NULL, destroyed_string);
    g_object_unref(context);
    context = NULL;
    cut_assert_true(destroy_called);
    cut_assert_equal_string(value, destroyed_string);
}
开发者ID:clear-code,项目名称:cutter,代码行数:28,代码来源:test-cut-test-context.c


示例4: test_create_with_null_path

void
test_create_with_null_path(void)
{
  inverted_index = grn_ii_create(context, NULL, lexicon, 0);
  ((grn_db_obj *)inverted_index)->header.domain = GRN_DB_VOID;
  cut_assert_not_null(inverted_index);
}
开发者ID:XLPE,项目名称:groonga,代码行数:7,代码来源:test-inverted-index.c


示例5: cut_assert_new_from_xml_error_helper

static void
cut_assert_new_from_xml_error_helper(const gchar *expected, const gchar *xml)
{
    result = cut_test_result_new_from_xml(xml, -1, &error);
    cut_assert_null(result);
    cut_assert_not_null(error);
    cut_assert_equal_string(expected, error->message);
}
开发者ID:andrewdavis12,项目名称:cutter,代码行数:8,代码来源:test-cut-test-result.c


示例6: test_reverse_list

void
test_reverse_list(void)
{
    List *l = list_prepend(NULL, INT_TO_POINTER(1));
    l = list_prepend(l, INT_TO_POINTER(2));
    l = list_prepend(l, INT_TO_POINTER(3));

    l = list_reverse(l);

    cut_assert_not_null(l);
    cut_assert_equal_pointer(INT_TO_POINTER(1), l->data);
    cut_assert_not_null(l->next);
    cut_assert_equal_pointer(INT_TO_POINTER(2), l->next->data);
    cut_assert_not_null(l->next->next);
    cut_assert_equal_pointer(INT_TO_POINTER(3), l->next->next->data);
    cut_assert_null(l->next->next->next);
}
开发者ID:lubomir,项目名称:stest,代码行数:17,代码来源:test-list.c


示例7: test_open_invalid_segment_file

void
test_open_invalid_segment_file(void)
{
    grn_io *io;
    gchar *id_string;

    io = grn_io_create(context, path, 10, 10, 10, grn_io_auto, GRN_IO_EXPIRE_SEGMENT);
    cut_assert_not_null(io);
    id_string = grn_io_header(io);
    strcpy(id_string, "WRONG-ID");
    grn_io_close(context, io);

    inverted_index = grn_ii_open(context, path, lexicon);
    cut_assert_null(inverted_index);

    cut_assert_not_null(strstr(g_list_nth_data((GList *)messages(), 1), "syscall error"));
}
开发者ID:kazu,项目名称:groonga,代码行数:17,代码来源:test-inverted-index.c


示例8: test_csint

CUT_EXPORT void test_csint(void)
{
    cs_init();
    CSint *vint = CSINT(0);
    cut_assert_not_null(vint);

    vint = CSINT(-1);
    cut_assert_not_null(vint);

    vint = CSINT(1);
    cut_assert_not_null(vint);

    vint = CSINT(INT_MIN);
    cut_assert_not_null(vint);

    vint = CSINT(INT_MAX);
    cut_assert_not_null(vint);

    /* overflow */
    vint = CSINT(INT_MAX+1);
    cut_assert_not_null(vint);

    vint = CSINT(INT_MIN-1);
    cut_assert_not_null(vint);
}
开发者ID:kenhys,项目名称:gauche-izc,代码行数:25,代码来源:test_domain.c


示例9: test_prepending_into_null

void
test_prepending_into_null(void)
{
    int x = 0;
    List *l = list_prepend(NULL, &x);
    cut_assert_not_null(l);
    cut_assert_null(l->next);
    cut_assert_equal_pointer(&x, l->data);
}
开发者ID:lubomir,项目名称:stest,代码行数:9,代码来源:test-list.c


示例10: create_properties_table

static void
create_properties_table(void)
{
  const gchar *table_name = "properties";
  properties = grn_table_create(&context, table_name, strlen(table_name), NULL,
                                GRN_OBJ_TABLE_HASH_KEY|GRN_OBJ_PERSISTENT,
                                grn_ctx_at(&context, GRN_DB_SHORT_TEXT), NULL);
  cut_assert_not_null(properties);
}
开发者ID:WEIC-DEV,项目名称:groonga,代码行数:9,代码来源:test-table-select.c


示例11: run

static gboolean
run (void)
{
    cut_assert_not_null(test_case);

    run_context = cut_test_runner_new();
    return cut_test_runner_run_test_case(CUT_TEST_RUNNER(run_context),
                                         test_case);
}
开发者ID:andrewdavis12,项目名称:cutter,代码行数:9,代码来源:test-cut-loader.c


示例12: test_fixture_function

void
test_fixture_function (gconstpointer data)
{
    const FixtureTestData *test_data = data;
    CutStartupFunction expected_startup_function = NULL;
    CutStartupFunction actual_startup_function = NULL;
    CutShutdownFunction expected_shutdown_function = NULL;
    CutShutdownFunction actual_shutdown_function = NULL;
    CutSetupFunction expected_setup_function = NULL;
    CutSetupFunction actual_setup_function = NULL;
    CutTeardownFunction expected_teardown_function = NULL;
    CutTeardownFunction actual_teardown_function = NULL;
    gchar *so_filename;

    loader = loader_new("fixture", test_data->file_name);
    test_case = cut_loader_load_test_case(loader);
    cut_assert(test_case);

    g_object_get(G_OBJECT(loader),
                 "so-filename", &so_filename,
                 NULL);
    module = g_module_open(so_filename,
                           G_MODULE_BIND_LAZY | G_MODULE_BIND_LOCAL);
    g_free(so_filename);
    cut_assert_not_null(module);
    if (test_data->startup_function_name)
        cut_assert_true(g_module_symbol(module,
                                        test_data->startup_function_name,
                                        (gpointer)&expected_startup_function));
    if (test_data->setup_function_name)
        cut_assert_true(g_module_symbol(module,
                                        test_data->setup_function_name,
                                        (gpointer)&expected_setup_function));
    if (test_data->teardown_function_name)
        cut_assert_true(g_module_symbol(module,
                                        test_data->teardown_function_name,
                                        (gpointer)&expected_teardown_function));
    if (test_data->shutdown_function_name)
        cut_assert_true(g_module_symbol(module,
                                        test_data->shutdown_function_name,
                                        (gpointer)&expected_shutdown_function));

    g_object_get(G_OBJECT(test_case),
                 "startup-function", &actual_startup_function,
                 "setup-function", &actual_setup_function,
                 "teardown-function", &actual_teardown_function,
                 "shutdown-function", &actual_shutdown_function,
                 NULL);
    cut_assert_equal_pointer(expected_startup_function,
                             actual_startup_function);
    cut_assert_equal_pointer(expected_setup_function,
                             actual_setup_function);
    cut_assert_equal_pointer(expected_teardown_function,
                             actual_teardown_function);
    cut_assert_equal_pointer(expected_shutdown_function,
                             actual_shutdown_function);
}
开发者ID:andrewdavis12,项目名称:cutter,代码行数:57,代码来源:test-cut-loader.c


示例13: test_fail_to_load

void
test_fail_to_load (void)
{
    loader = loader_new("module", "cannot-load-module." G_MODULE_SUFFIX);
    cut_assert_not_null(loader);

    test_case = cut_loader_load_test_case(loader);
    cut_assert_null(test_case);
}
开发者ID:andrewdavis12,项目名称:cutter,代码行数:9,代码来源:test-cut-loader.c


示例14: create_terms_table

static void
create_terms_table(void)
{
  terms = grn_table_create(&context, "terms", 5, NULL,
                           GRN_OBJ_TABLE_PAT_KEY|GRN_OBJ_PERSISTENT,
                           grn_ctx_at(&context, GRN_DB_SHORT_TEXT), NULL);
  cut_assert_not_null(terms);
  grn_test_assert(grn_obj_set_info(&context, terms, GRN_INFO_DEFAULT_TOKENIZER,
				   grn_ctx_at(&context, GRN_DB_BIGRAM)));

  index_body = grn_column_create(&context, terms, "docs_body", 4, NULL,
                                 GRN_OBJ_COLUMN_INDEX|GRN_OBJ_PERSISTENT|GRN_OBJ_WITH_POSITION,
                                 docs);
  cut_assert_not_null(index_body);

  GRN_UINT32_SET(&context, &int_buf, grn_obj_id(&context, body));
  grn_obj_set_info(&context, index_body, GRN_INFO_SOURCE, &int_buf);
}
开发者ID:WEIC-DEV,项目名称:groonga,代码行数:18,代码来源:test-table-select.c


示例15: assert_equal_attachment

static void
assert_equal_attachment (MzAttachment *expected, MzAttachment *actual)
{
    cut_assert_not_null(actual);
    cut_assert_equal_string(expected->charset, actual->charset);
    cut_assert_equal_string(expected->filename, actual->filename);
    cut_assert_equal_memory(expected->data, expected->data_length,
                            actual->data, actual->data_length);
}
开发者ID:clear-code,项目名称:milter-zipcrypt,代码行数:9,代码来源:test-utils.c


示例16: test_scalar_index

void
test_scalar_index(void)
{
  gchar *db_path;
  const gchar *name;
  grn_obj *users, *items, *checks, *checked;

  grn_obj_close(context, db);

  remove_tmp_directory();
  g_mkdir_with_parents(tmp_directory, 0700);
  db_path = g_build_filename(tmp_directory, "inverted-index", NULL);
  db = grn_db_create(context, db_path, NULL);
  g_free(db_path);

  name = "users";
  users = grn_table_create(context, name, strlen(name), NULL,
                           GRN_OBJ_TABLE_NO_KEY|GRN_OBJ_PERSISTENT, NULL, 0);
  cut_assert_not_null(users);

  name = "items";
  items = grn_table_create(context, name, strlen(name), NULL,
                           GRN_OBJ_TABLE_NO_KEY|GRN_OBJ_PERSISTENT, NULL, 0);
  cut_assert_not_null(items);

  name = "checks";
  checks = grn_column_create(context, users, name, strlen(name), NULL,
                             GRN_OBJ_COLUMN_SCALAR|GRN_OBJ_PERSISTENT, items);
  cut_assert_not_null(checks);

  name = "checked";
  checked = grn_column_create(context, items, name, strlen(name), NULL,
                              GRN_OBJ_COLUMN_INDEX|GRN_OBJ_PERSISTENT, users);
  cut_assert_not_null(checked);

  grn_test_assert(set_index_source(checked, checks));

  insert_and_search(users, items, checks, checked);

  grn_obj_close(context, checks);
  grn_obj_close(context, checked);
  grn_obj_close(context, items);
  grn_obj_close(context, users);
}
开发者ID:XLPE,项目名称:groonga,代码行数:44,代码来源:test-inverted-index.c


示例17: test_match_equal

void
test_match_equal(void)
{
  grn_obj *v;

  prepare_data();

  cut_assert_not_null((cond = grn_expr_create(&context, NULL, 0)));
  v = grn_expr_add_var(&context, cond, NULL, 0);
  GRN_RECORD_INIT(v, 0, grn_obj_id(&context, docs));

  grn_expr_append_obj(&context, cond, v, GRN_OP_PUSH, 1);
  GRN_TEXT_SETS(&context, &text_buf, "body");
  grn_expr_append_const(&context, cond, &text_buf, GRN_OP_PUSH, 1);
  grn_expr_append_op(&context, cond, GRN_OP_GET_VALUE, 2);
  GRN_TEXT_SETS(&context, &text_buf, "moge");
  grn_expr_append_const(&context, cond, &text_buf, GRN_OP_PUSH, 1);
  grn_expr_append_op(&context, cond, GRN_OP_MATCH, 2);

  grn_expr_append_obj(&context, cond, v, GRN_OP_PUSH, 1);
  GRN_TEXT_SETS(&context, &text_buf, "size");
  grn_expr_append_const(&context, cond, &text_buf, GRN_OP_PUSH, 1);
  grn_expr_append_op(&context, cond, GRN_OP_GET_VALUE, 2);
  GRN_UINT32_SET(&context, &int_buf, 14);
  grn_expr_append_const(&context, cond, &int_buf, GRN_OP_PUSH, 1);
  grn_expr_append_op(&context, cond, GRN_OP_EQUAL, 2);

  grn_expr_append_op(&context, cond, GRN_OP_AND, 2);

  grn_expr_compile(&context, cond);

  res = grn_table_create(&context, NULL, 0, NULL,
                         GRN_TABLE_HASH_KEY|GRN_OBJ_WITH_SUBREC, docs, NULL);
  cut_assert_not_null(res);

  cut_assert_not_null(grn_table_select(&context, docs, cond, res, GRN_OP_OR));

  grn_test_assert_select(&context,
                         gcut_take_new_list_string("moge moge moge",
                                                   "moge hoge hoge",
                                                   NULL),
                         res,
                         "body");
}
开发者ID:WEIC-DEV,项目名称:groonga,代码行数:44,代码来源:test-table-select.c


示例18: test_args_algo

void
test_args_algo()
{
    char *hash = password_hash("password", "algorithm",
                               NULL, BCRYPT_BLOWFISH_COST);
    cut_assert_not_null(hash);
    cut_assert_equal_int(60, strlen(hash));
    cut_assert_match("\\$2y\\$10\\$.*", hash);
    free(hash);
}
开发者ID:kjdev,项目名称:php-password-hashing,代码行数:10,代码来源:hash.c


示例19: test_equal_by_nonexistent_reference_key

void
test_equal_by_nonexistent_reference_key(void)
{
  grn_obj *v;

  prepare_data();

  GRN_EXPR_CREATE_FOR_QUERY(&context, docs, cond, v);
  cut_assert_not_null(cond);
  cut_assert_not_null(v);
  PARSE(cond, "author == \"nonexistent\"", GRN_EXPR_SYNTAX_SCRIPT);
  res = grn_table_select(&context, docs, cond, NULL, GRN_OP_OR);
  cut_assert_not_null(res);

  grn_test_assert_select(&context,
                         NULL,
                         res,
                         "body");
}
开发者ID:WEIC-DEV,项目名称:groonga,代码行数:19,代码来源:test-table-select.c


示例20: test_op_table_scan

void
test_op_table_scan(void)
{
  grn_obj *cond, *expr, *v, *res, textbuf, intbuf;
  GRN_TEXT_INIT(&textbuf, 0);
  GRN_UINT32_INIT(&intbuf, 0);

  prepare_data(&textbuf, &intbuf);

  cut_assert_not_null((cond = grn_expr_create(&context, NULL, 0)));
  v = grn_expr_add_var(&context, cond, NULL, 0);
  GRN_RECORD_INIT(v, 0, grn_obj_id(&context, docs));
  grn_expr_append_obj(&context, cond, v);
  GRN_TEXT_SETS(&context, &textbuf, "size");
  grn_expr_append_const(&context, cond, &textbuf);
  grn_expr_append_op(&context, cond, GRN_OP_OBJ_GET_VALUE, 2);
  GRN_UINT32_SET(&context, &intbuf, 14);
  grn_expr_append_const(&context, cond, &intbuf);
  grn_expr_append_op(&context, cond, GRN_OP_EQUAL, 2);
  grn_expr_compile(&context, cond);

  res = grn_table_create(&context, NULL, 0, NULL,
                         GRN_TABLE_HASH_KEY|GRN_OBJ_WITH_SUBREC, docs, 0);
  cut_assert_not_null(res);

  cut_assert_not_null((expr = grn_expr_create(&context, NULL, 0)));
  grn_expr_append_obj(&context, expr, docs);
  grn_expr_append_obj(&context, expr, cond);
  grn_expr_append_obj(&context, expr, res);
  GRN_UINT32_SET(&context, &intbuf, GRN_SEL_OR);
  grn_expr_append_const(&context, expr, &intbuf);
  grn_expr_append_op(&context, expr, GRN_OP_TABLE_SCAN, 4);

  grn_expr_exec(&context, expr);

  cut_assert_equal_uint(3, grn_table_size(&context, res));

  grn_test_assert(grn_obj_close(&context, expr));
  grn_test_assert(grn_obj_close(&context, res));
  grn_test_assert(grn_obj_close(&context, cond));
  grn_test_assert(grn_obj_close(&context, &textbuf));
  grn_test_assert(grn_obj_close(&context, &intbuf));
}
开发者ID:ikdttr,项目名称:groonga,代码行数:43,代码来源:test-expr.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ cut_assert_true函数代码示例发布时间:2022-05-30
下一篇:
C++ cut_assert_false函数代码示例发布时间: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