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

C++ CU_ASSERT_PTR_NOT_NULL函数代码示例

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

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



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

示例1: test_func_syslog

static void test_func_syslog(void)
{
	struct filter_context_t ctx;
	struct property_list_t properties;
	struct message_t msg_in;
	struct message_t msg_out;

	const char SCRIPT[] =
		"function filter(mout, min)\n"
		"	syslog(LOG_NOTICE, 'executing filter: testing syslog')\n"
		"	return FILTER_DISCARD\n"
		"end\n"
		"\n"
		;

	memset(&msg_in, 0, sizeof(msg_in));
	memset(&msg_out, 0, sizeof(msg_out));

	CU_ASSERT_PTR_NOT_NULL(filter);
	CU_ASSERT_PTR_NOT_NULL(filter->init);
	CU_ASSERT_PTR_NOT_NULL(filter->func);
	CU_ASSERT_PTR_NOT_NULL(filter->exit);

	proplist_init(&properties);
	proplist_set(&properties, "script", tmpfilename);

	prepare_script(SCRIPT);

	CU_ASSERT_EQUAL_FATAL(filter->init(&ctx, &properties), EXIT_SUCCESS);

	CU_ASSERT_EQUAL(filter->func(&msg_out, &msg_in, &ctx, &properties), FILTER_DISCARD);

	CU_ASSERT_EQUAL(filter->exit(&ctx), FILTER_SUCCESS);
	proplist_free(&properties);
}
开发者ID:mariokonrad,项目名称:navd,代码行数:35,代码来源:test_filter_lua.c


示例2: test_existance

static void test_existance(void)
{
	CU_ASSERT_PTR_NOT_NULL(filter);
	CU_ASSERT_PTR_NOT_NULL(filter->init);
	CU_ASSERT_PTR_NOT_NULL(filter->exit);
	CU_ASSERT_PTR_NOT_NULL(filter->func);
}
开发者ID:mariokonrad,项目名称:navd,代码行数:7,代码来源:test_filter_lua.c


示例3: test_find_index

void test_find_index(void)
{
	FILENODE *node[5];
	FILENODE *current_node;
	GtkTreeIter iter;
	int index[11] = {4, 3, 2, 1, 0, 3, 2, 4, 0, 1, 1};
	int i = 0;
	init_file_list();

	node[0] = append_file("file1", "schema", "table", "geom_column", "-1", 'c', &iter);
	CU_ASSERT_PTR_NOT_NULL(node[0]);
	node[1] = append_file("file2", "schema", "table", "geom_column", "-1", 'c', &iter);
	CU_ASSERT_PTR_NOT_NULL(node[1]);
	node[2] = append_file("file3", "schema", "table", "geom_column", "-1", 'c', &iter);
	CU_ASSERT_PTR_NOT_NULL(node[2]);
	node[3] = append_file("file4", "schema", "table", "geom_column", "-1", 'c', &iter);
	CU_ASSERT_PTR_NOT_NULL(node[3]);
	node[4] = append_file("file5", "schema", "table", "geom_column", "-1", 'c', &iter);
	CU_ASSERT_PTR_NOT_NULL(node[4]);

	for (i = 0; i < 11; i++)
	{
		current_node = find_file_by_index(index[i]);
		CU_ASSERT_PTR_EQUAL(node[index[i]], current_node);
	}

	destroy_file_list();

}
开发者ID:bnordgren,项目名称:postgis,代码行数:29,代码来源:cu_list.c


示例4: t_mutable_string_parse_int

void t_mutable_string_parse_int(void) {
	mutable_string_t a;

	CU_ASSERT_PTR_NOT_NULL(
		mutable_string_init_with_value(
			&a, TEST_STR_NUMERIC_1
		)
	);
	CU_ASSERT_EQUAL(
		mutable_string_parse_int(&a),
		123
	);
	CU_ASSERT_EQUAL(
		mutable_string_parse_long(&a),
		123
	);
	CU_ASSERT_EQUAL(
		mutable_string_parse_long_long(&a),
		123
	);
	
	CU_ASSERT_PTR_NOT_NULL(
		mutable_string_assign(
			&a, TEST_STR_NUMERIC_2
		)
	);
	CU_ASSERT_EQUAL(
		mutable_string_parse_double(&a),
		1.23
	);
	mutable_string_free(&a);
}
开发者ID:manchicken,项目名称:libmanchicken,代码行数:32,代码来源:t_mutable_string.c


示例5: test_next_nonEmptyList

void test_next_nonEmptyList(void) {
  list_t* lista = list_init();

  addElement(lista, (void*)a);
  addElement(lista, (void*)b);
  addElement(lista, (void*)c);
  iterator_t* i=iterator_init(lista);

  payload_t * corrente = next(i);
  CU_ASSERT_PTR_NOT_NULL(corrente);
  CU_ASSERT_PTR_EQUAL(corrente, lista->head->payload);

  corrente = next(i);
  CU_ASSERT_PTR_NOT_NULL(corrente);
  CU_ASSERT_PTR_EQUAL(corrente, lista->head->next->payload);

  corrente = next(i);
  CU_ASSERT_PTR_NOT_NULL(corrente);
  CU_ASSERT_PTR_EQUAL(corrente, lista->tail->payload);

  corrente = next(i);
  CU_ASSERT_PTR_NULL(corrente);

  iterator_destroy(i);
  list_destroy(lista);
}
开发者ID:andijcr,项目名称:tsar_lib,代码行数:26,代码来源:testList.c


示例6: test_existance

static void test_existance(void)
{
	CU_ASSERT_PTR_NOT_NULL(proc);
	CU_ASSERT_PTR_NOT_NULL(proc->init);
	CU_ASSERT_PTR_NOT_NULL(proc->func);
	CU_ASSERT_PTR_NOT_NULL(proc->exit);
}
开发者ID:mariokonrad,项目名称:navd,代码行数:7,代码来源:test_destination_logbook.c


示例7: test_file_path

static void test_file_path() {
	belle_generic_uri_t* source_uri = belle_generic_uri_parse("/index.html");
	char* source_uri_raw = belle_sip_object_to_string(source_uri);
	belle_generic_uri_t* first_uri = belle_generic_uri_parse(source_uri_raw);
	belle_generic_uri_t* uri=BELLE_GENERIC_URI(belle_sip_object_clone(BELLE_SIP_OBJECT(first_uri)));
	belle_sip_free(source_uri_raw);
	belle_sip_object_unref(source_uri);
	belle_sip_object_unref(first_uri);

	CU_ASSERT_PTR_NULL(belle_generic_uri_get_scheme(uri));
	CU_ASSERT_PTR_NULL(belle_generic_uri_get_host(uri));
	CU_ASSERT_STRING_EQUAL(belle_generic_uri_get_path(uri),"/index.html");

	belle_sip_object_unref(uri);

	source_uri = belle_generic_uri_parse("file:///tmp/absolute-file");
	CU_ASSERT_PTR_NOT_NULL(source_uri);
	if (source_uri!=NULL){
		CU_ASSERT_STRING_EQUAL(belle_generic_uri_get_scheme(source_uri),"file");
		CU_ASSERT_PTR_NULL(belle_generic_uri_get_host(source_uri));
		CU_ASSERT_STRING_EQUAL(belle_generic_uri_get_path(source_uri),"/tmp/absolute-file");
		belle_sip_object_unref(source_uri);
	}

	/*this is INVALID*/
	source_uri = belle_generic_uri_parse("file://./relative-file");
	CU_ASSERT_PTR_NOT_NULL(source_uri);

	/* PATH segment always start by / */
	source_uri = belle_generic_uri_parse("./relative-file");
	CU_ASSERT_PTR_NULL(source_uri);
	if (source_uri!=NULL){
		belle_sip_object_unref(source_uri);
	}
}
开发者ID:HackLinux,项目名称:VideoCallVoIP,代码行数:35,代码来源:belle_generic_uri_tester.c


示例8: test_pl_create_delete

void test_pl_create_delete(void) {
    
    int rc;
    pooled_list *pl = NULL;
    
    rc = pl_create(&pl, sizeof(my_message_t), ELEM_COUNT_DEFAULT);
    
    /* make sure object creation successful before proceeding */
    CU_ASSERT_EQUAL_FATAL(rc, PL_SUCCESS);
    CU_ASSERT_PTR_NOT_NULL_FATAL(pl);
    
    /* Check all default internal values */
    CU_ASSERT((int)pl->elem_size == (int)sizeof(my_message_t));
    CU_ASSERT(pl->elem_count    == ELEM_COUNT_DEFAULT);
    CU_ASSERT(pl->count_free    == ELEM_COUNT_DEFAULT);
    CU_ASSERT(pl->count_total   == ELEM_COUNT_DEFAULT);
    CU_ASSERT(pl->count_current == 0);
    
    /* Check address node list */
    CU_ASSERT_PTR_NOT_NULL(pl->addr_list);   /* address node exists */
    CU_ASSERT_PTR_NULL(pl->addr_list->next); /* no second node */
    CU_ASSERT_PTR_NOT_NULL(pl->addr_list->addr); /* memory block allocated */
    CU_ASSERT_PTR_EQUAL(pl->active_memblock, pl->addr_list); /*active blk set*/
    
    /* check datablock pointers */
    CU_ASSERT_PTR_NULL(pl->head); /* head pointer unset */
    CU_ASSERT_PTR_NULL(pl->tail); /* tail pointer unset */
    CU_ASSERT_PTR_EQUAL(pl->next_free, pl->addr_list->addr); /* next_free set */ 
    
    destroy_pl_object(&pl);
}
开发者ID:somebloke,项目名称:flame-libmboard,代码行数:31,代码来源:test_pl_create.c


示例9: __db_result_list_next

db_result_t* __db_result_list_next(void* data, int finish) {
    db_value_set_t* value_set;
    db_result_t* result;

    CU_ASSERT_FATAL(data == &fake_pointer);

    if (finish) {
        return NULL;
    }

    if (__db_result_list_next_count > 2) {
        return NULL;
    }

    CU_ASSERT_PTR_NOT_NULL_FATAL((value_set = db_value_set_new(2)));
    CU_ASSERT(db_value_set_size(value_set) == 2);
    CU_ASSERT_PTR_NOT_NULL(db_value_set_at(value_set, 0));
    CU_ASSERT_PTR_NOT_NULL(db_value_set_at(value_set, 1));
    CU_ASSERT_PTR_NULL(db_value_set_at(value_set, 2));
    CU_ASSERT_PTR_NOT_NULL(db_value_set_get(value_set, 0));
    CU_ASSERT_PTR_NOT_NULL(db_value_set_get(value_set, 1));
    CU_ASSERT_PTR_NULL(db_value_set_get(value_set, 2));

    CU_ASSERT_PTR_NOT_NULL_FATAL((result = db_result_new()));
    CU_ASSERT(!db_result_set_value_set(result, value_set));
    CU_ASSERT(!db_result_not_empty(result));

    __db_result_list_next_count++;

    return result;
}
开发者ID:jelu,项目名称:dbo,代码行数:31,代码来源:test_classes.c


示例10: test_class_db_result_list

void test_class_db_result_list(void) {
    db_result_t* local_result = result;
    db_result_t* local_result2 = result2;

    CU_ASSERT_PTR_NOT_NULL_FATAL((result_list = db_result_list_new()));

    CU_ASSERT_FATAL(!db_result_list_add(result_list, result));
    result = NULL;
    CU_ASSERT_FATAL(!db_result_list_add(result_list, result2));
    result2 = NULL;

    CU_ASSERT(db_result_list_size(result_list) == 2);
    CU_ASSERT(db_result_list_begin(result_list) == local_result);
    CU_ASSERT(db_result_list_next(result_list) == local_result2);

    db_result_list_free(result_list);
    result_list = NULL;
    CU_PASS("db_result_list_free");
    CU_PASS("db_result_free");

    CU_ASSERT_PTR_NOT_NULL_FATAL((result_list = db_result_list_new()));

    CU_ASSERT_FATAL(!db_result_list_set_next(result_list, __db_result_list_next, &fake_pointer, 2));

    CU_ASSERT(db_result_list_size(result_list) == 2);
    CU_ASSERT_PTR_NOT_NULL(db_result_list_begin(result_list));
    CU_ASSERT_PTR_NOT_NULL(db_result_list_next(result_list));

    db_result_list_free(result_list);
    result_list = NULL;
    CU_PASS("db_result_list_free");
    CU_PASS("db_result_free");
}
开发者ID:jelu,项目名称:dbo,代码行数:33,代码来源:test_classes.c


示例11: test_class_db_clause

void test_class_db_clause(void) {
    CU_ASSERT_PTR_NOT_NULL_FATAL((clause = db_clause_new()));

    CU_ASSERT(!db_clause_set_table(clause, "table"));
    CU_ASSERT(!db_clause_set_field(clause, "field"));
    CU_ASSERT(!db_clause_set_type(clause, DB_CLAUSE_NOT_EQUAL));
    CU_ASSERT(!db_clause_set_operator(clause, DB_CLAUSE_OPERATOR_OR));
    CU_ASSERT_PTR_NOT_NULL_FATAL(db_clause_get_value(clause));
    CU_ASSERT(!db_value_from_int32(db_clause_get_value(clause), 1));
    CU_ASSERT(!db_clause_not_empty(clause));

    CU_ASSERT_PTR_NOT_NULL_FATAL(db_clause_table(clause));
    CU_ASSERT(!strcmp(db_clause_table(clause), "table"));
    CU_ASSERT_PTR_NOT_NULL_FATAL(db_clause_field(clause));
    CU_ASSERT(!strcmp(db_clause_field(clause), "field"));
    CU_ASSERT(db_clause_type(clause) == DB_CLAUSE_NOT_EQUAL);
    CU_ASSERT(db_clause_operator(clause) == DB_CLAUSE_OPERATOR_OR);
    CU_ASSERT_PTR_NOT_NULL(db_clause_value(clause));
    CU_ASSERT_PTR_NULL(db_clause_next(clause));

    CU_ASSERT_PTR_NOT_NULL_FATAL((clause2 = db_clause_new()));

    CU_ASSERT(!db_clause_set_type(clause2, DB_CLAUSE_NESTED));
    CU_ASSERT(!db_clause_set_operator(clause2, DB_CLAUSE_OPERATOR_OR));
    CU_ASSERT(!db_clause_set_list(clause2, (db_clause_list_t*)&fake_pointer));
    CU_ASSERT(!db_clause_not_empty(clause2));

    CU_ASSERT(db_clause_type(clause2) == DB_CLAUSE_NESTED);
    CU_ASSERT(db_clause_operator(clause2) == DB_CLAUSE_OPERATOR_OR);
    CU_ASSERT(db_clause_list(clause2) == (db_clause_list_t*)&fake_pointer);
    CU_ASSERT_PTR_NOT_NULL(db_clause_value(clause2));
}
开发者ID:jelu,项目名称:dbo,代码行数:32,代码来源:test_classes.c


示例12: test_class_db_backend_meta_data_list

void test_class_db_backend_meta_data_list(void) {
    db_backend_meta_data_t* local_backend_meta_data = backend_meta_data;
    db_backend_meta_data_t* local_backend_meta_data2 = backend_meta_data2;
    db_backend_meta_data_t* local_backend_meta_data3 = backend_meta_data3;
    db_backend_meta_data_t* local_backend_meta_data4 = backend_meta_data4;

    CU_ASSERT_PTR_NOT_NULL_FATAL((backend_meta_data_list = db_backend_meta_data_list_new()));
    CU_ASSERT_FATAL(!db_backend_meta_data_list_add(backend_meta_data_list, backend_meta_data));
    backend_meta_data = NULL;
    CU_ASSERT_FATAL(!db_backend_meta_data_list_add(backend_meta_data_list, backend_meta_data2));
    backend_meta_data2 = NULL;
    CU_ASSERT(db_backend_meta_data_list_find(backend_meta_data_list, "name1") == local_backend_meta_data);
    CU_ASSERT(db_backend_meta_data_list_find(backend_meta_data_list, "name2") == local_backend_meta_data2);

    CU_ASSERT_PTR_NOT_NULL_FATAL((backend_meta_data_list2 = db_backend_meta_data_list_new()));
    CU_ASSERT_FATAL(!db_backend_meta_data_list_copy(backend_meta_data_list2, backend_meta_data_list));
    CU_ASSERT_PTR_NOT_NULL(db_backend_meta_data_list_find(backend_meta_data_list2, "name1"));
    CU_ASSERT_PTR_NOT_NULL(db_backend_meta_data_list_find(backend_meta_data_list2, "name2"));
    db_backend_meta_data_list_free(backend_meta_data_list2);
    backend_meta_data_list2 = NULL;
    CU_PASS("db_backend_meta_data_list_free");

    CU_ASSERT_PTR_NOT_NULL_FATAL((backend_meta_data_list2 = db_backend_meta_data_list_new()));
    CU_ASSERT_FATAL(!db_backend_meta_data_list_add(backend_meta_data_list2, backend_meta_data3));
    backend_meta_data3 = NULL;
    CU_ASSERT_FATAL(!db_backend_meta_data_list_add(backend_meta_data_list2, backend_meta_data4));
    backend_meta_data4 = NULL;
    CU_ASSERT(db_backend_meta_data_list_find(backend_meta_data_list2, "name3") == local_backend_meta_data3);
    CU_ASSERT(db_backend_meta_data_list_find(backend_meta_data_list2, "name4") == local_backend_meta_data4);
}
开发者ID:jelu,项目名称:dbo,代码行数:30,代码来源:test_classes.c


示例13: testItemMove

static void testItemMove (void)
{
	Inventory inv;
	const objDef_t* od;
	const invDef_t* container, *containerTo;
	Item* addedItem;

	ResetInventoryList();

	od = INVSH_GetItemByIDSilent("assault");
	CU_ASSERT_PTR_NOT_NULL(od);

	container = INVSH_GetInventoryDefinitionByID("right");
	CU_ASSERT_PTR_NOT_NULL(container);

	Item item(od);

	CU_ASSERT(inv.containsItem(container->id, &item) == false);

	addedItem = i.addToInventory(&inv, &item, container, NONE, NONE, 1);
	CU_ASSERT_PTR_NOT_NULL(addedItem);

	CU_ASSERT(inv.containsItem(container->id, &item) == true);

	containerTo = INVSH_GetInventoryDefinitionByID("backpack");
	CU_ASSERT_PTR_NOT_NULL(containerTo);

	CU_ASSERT_EQUAL(IA_MOVE, i.moveInInventory(&inv, container, addedItem, containerTo, NONE, NONE, nullptr, nullptr));

	CU_ASSERT(inv.containsItem(container->id, &item) == false);
	CU_ASSERT(inv.containsItem(containerTo->id, &item) == true);
}
开发者ID:cigo,项目名称:ufoai,代码行数:32,代码来源:test_inventory.cpp


示例14: testItemDel

static void testItemDel (void)
{
	Inventory inv;
	const objDef_t* od;
	const invDef_t* container;
	Item* addedItem;

	ResetInventoryList();

	od = INVSH_GetItemByIDSilent("assault");
	CU_ASSERT_PTR_NOT_NULL(od);

	container = INVSH_GetInventoryDefinitionByID("right");
	CU_ASSERT_PTR_NOT_NULL(container);

	Item item(od);

	CU_ASSERT(inv.containsItem(container->id, &item) == false);

	addedItem = i.addToInventory(&inv, &item, container, NONE, NONE, 1);

	CU_ASSERT(inv.containsItem(container->id, &item) == true);

	CU_ASSERT(i.removeFromInventory(&inv, container, addedItem));

	CU_ASSERT(inv.containsItem(container->id, &item) == false);
}
开发者ID:cigo,项目名称:ufoai,代码行数:27,代码来源:test_inventory.cpp


示例15: test_create_new_program_with_broken_fragment_shader

static void test_create_new_program_with_broken_fragment_shader(void)
{
	char *vertexShader = pgTestsCreateAssetPath("test_01.vsh");
	char *fragmentShader = pgTestsCreateAssetPath("test_02_broken.fsh");
	PGProgram program = NULL;
	
	PGResult result = pgProgramCreateAndBuild(&program, vertexShader, fragmentShader);
	
	CU_ASSERT_EQUAL(result, PGR_CouldNotCompileShader);
	
	CU_ASSERT_NOT_EQUAL(pgProgramVertexShader(program), 0);
	CU_ASSERT_EQUAL(pgProgramFragmentShader(program), 0);
	CU_ASSERT_EQUAL(pgProgramGlHandle(program), 0);
	
	CU_ASSERT_PTR_NOT_NULL(pgProgramVertexShaderCompileLog(program));
	CU_ASSERT_PTR_NOT_NULL(pgProgramFragmentShaderCompileLog(program));
	CU_ASSERT_PTR_NOT_NULL(pgProgramLinkLog(program));
	
	CU_ASSERT_EQUAL(strlen(pgProgramVertexShaderCompileLog(program)), 0);
	CU_ASSERT_NOT_EQUAL(strlen(pgProgramFragmentShaderCompileLog(program)), 0);
	CU_ASSERT_EQUAL(strlen(pgProgramLinkLog(program)), 0);
	
	pgProgramDestroy(&program);
	
	CU_ASSERT_PTR_NULL(program);
	
	free(vertexShader);
	free(fragmentShader);
}
开发者ID:mnem,项目名称:pictogram,代码行数:29,代码来源:PGProgramCompiler.c


示例16: test_cimunit_event_add_multiple_actions

static void test_cimunit_event_add_multiple_actions(void)
{
    cimunit_event_t condition;
    cimunit_event_t action1;
    cimunit_event_t action2;

    cimunit_event_init(&condition, "condition");
    cimunit_event_init(&action1, "action1");
    cimunit_event_init(&action2, "action2");
    cimunit_event_add_action(&condition, &action1);
  
    /// - Run SUT
    cimunit_event_add_action(&condition, &action2);

    /// - Verify both items are in the list
    CU_ASSERT_PTR_NOT_NULL(cimunit_event_list_find(condition.action_events,
                                                   action1.event_name));
    CU_ASSERT_PTR_NOT_NULL(cimunit_event_list_find(condition.action_events,
                                                   action2.event_name));

    /// - Clean up
    cimunit_event_destroy(&condition);
    cimunit_event_destroy(&action1);
    cimunit_event_destroy(&action2);
}
开发者ID:dframpto,项目名称:cimunit,代码行数:25,代码来源:test_cimunit_event.c


示例17: testItemAdd

static void testItemAdd (void)
{
	inventory_t inv;
	const objDef_t *od;
	item_t item;
	const invDef_t *container;

	ResetInventoryList();

	OBJZERO(inv);

	od = INVSH_GetItemByIDSilent("assault");
	CU_ASSERT_PTR_NOT_NULL(od);

	container = INVSH_GetInventoryDefinitionByID("right");
	CU_ASSERT_PTR_NOT_NULL(container);

	item.t = od;
	item.m = NULL;
	item.a = 0;

	CU_ASSERT(INVSH_ExistsInInventory(&inv, container, &item) == false);

	CU_ASSERT_PTR_NOT_NULL(i.AddToInventory(&i, &inv, &item, container, NONE, NONE, 1));

	CU_ASSERT(INVSH_ExistsInInventory(&inv, container, &item) == true);
}
开发者ID:MyWifeRules,项目名称:ufoai-1,代码行数:27,代码来源:test_inventory.cpp


示例18: identify_test

static void identify_test(void) {

    WsXmlDocH response;
    static int i = 0;
    char *xp = NULL;

    wsmc_reinit_conn(cl);
    options = wsmc_options_init();

    response = wsmc_action_identify(cl, options);
    CU_ASSERT_TRUE(wsmc_get_response_code(cl) == tests[i].final_status);

    CU_ASSERT_PTR_NOT_NULL(response);
    if (response == NULL) {
        goto RETURN;
    }

    if (tests[i].value1 != NULL) {
        xp = ws_xml_get_xpath_value(response, tests[i].expr1);
        CU_ASSERT_PTR_NOT_NULL(xp);
        if (xp) {
          CU_ASSERT_STRING_EQUAL(xp, tests[i].value1 );
        }
    }

RETURN:
    if (response) {
      ws_xml_destroy_doc(response);
    }
    u_free(xp);
    wsmc_options_destroy(options);
    i++;
}
开发者ID:Openwsman,项目名称:wsmancli,代码行数:33,代码来源:identify.c


示例19: test_init_exit

static void test_init_exit(void)
{
	struct filter_context_t ctx;
	struct property_list_t properties;

	const char SCRIPT[] = "\n";

	memset(&ctx, 0, sizeof(ctx));

	CU_ASSERT_PTR_NOT_NULL(filter);
	CU_ASSERT_PTR_NOT_NULL(filter->init);
	CU_ASSERT_PTR_NOT_NULL(filter->exit);

	proplist_init(&properties);

	CU_ASSERT_EQUAL(filter->init(NULL, NULL), EXIT_FAILURE);
	CU_ASSERT_EQUAL(filter->init(NULL, &properties), EXIT_FAILURE);
	CU_ASSERT_EQUAL(filter->init(&ctx, NULL), EXIT_FAILURE);
	CU_ASSERT_EQUAL(filter->init(&ctx, &properties), EXIT_FAILURE);

	proplist_set(&properties, "script", "");

	CU_ASSERT_EQUAL_FATAL(filter->init(&ctx, &properties), EXIT_FAILURE);

	prepare_script(SCRIPT);

	proplist_set(&properties, "script", tmpfilename);
	CU_ASSERT_EQUAL(filter->init(&ctx, &properties), EXIT_SUCCESS);
	CU_ASSERT_NOT_EQUAL(ctx.data, NULL);

	CU_ASSERT_EQUAL(filter->exit(&ctx), EXIT_SUCCESS);
	proplist_free(&properties);
}
开发者ID:mariokonrad,项目名称:navd,代码行数:33,代码来源:test_filter_lua.c


示例20: make_new_list

void test_prepend
    (
    void
    )
{
uint32_t arr[] = {1, 2, 4, 8, 16, 32, 64, 128, 256, 512};
uint32_t i;
list * new_list = make_new_list();
node * cur = NULL;
CU_ASSERT_PTR_NOT_NULL(new_list);
for(i = 0; i < 10; i++)
    {
    prepend(new_list, &(arr[i]));
    }
cur = get_head(new_list);
CU_ASSERT_PTR_NOT_NULL(cur);
i = 9;
while(cur != NULL)
    {
    CU_ASSERT_EQUAL(*(uint32_t *)cur->data, arr[i]);
    cur = cur->next;
    i--;
    }
cur = NULL;
cur = get_tail(new_list);
CU_ASSERT_PTR_NOT_NULL(cur);
i = 0;
while(cur != NULL)
    {
    CU_ASSERT_EQUAL(*(uint32_t *)cur->data, arr[i]);
    cur = cur->prev;
    i++;
    }
CU_ASSERT_EQUAL(new_list->size, 10);
}
开发者ID:Tepman2,项目名称:project_euler,代码行数:35,代码来源:test_list.c



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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