当前位置: 首页>>代码示例>>C++>>正文


C++ CU_ASSERT_PTR_NOT_NULL_FATAL函数代码示例

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


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

示例1: test_can_read_ihex_rs_from_file_1

void test_can_read_ihex_rs_from_file_1(void)
{
	ihex_recordset_t* r = ihex_rs_from_file("res/hex1.dat");
	
	CU_ASSERT_PTR_NOT_NULL_FATAL(r);
	CU_ASSERT_EQUAL_FATAL(r->ihrs_count, 6);

	IHEX_ASSERT_REC_EQUAL(&(r->ihrs_records[1]), 0x10, 0x0100, IHEX_DATA, 0x21);
}
开发者ID:acolomb,项目名称:libcintelhex,代码行数:9,代码来源:test_parse.c

示例2: test_can_read_ihex_rs_from_file_2

void test_can_read_ihex_rs_from_file_2(void)
{
	ihex_recordset_t* r = ihex_rs_from_file("res/big-a.hex");
	
	CU_ASSERT_PTR_NOT_NULL_FATAL(r);
	CU_ASSERT_EQUAL_FATAL(r->ihrs_count, 214);

	IHEX_ASSERT_REC_EQUAL(&(r->ihrs_records[2]), 0x10, 0x0400, IHEX_DATA, 0x0B);
}
开发者ID:acolomb,项目名称:libcintelhex,代码行数:9,代码来源:test_parse.c

示例3: test_class_db_object_field

void test_class_db_object_field(void) {
    CU_ASSERT_PTR_NOT_NULL_FATAL((object_field = db_object_field_new()));
    CU_ASSERT(!db_object_field_set_name(object_field, "field1"));
    CU_ASSERT(!db_object_field_set_type(object_field, DB_TYPE_INT32));
    CU_ASSERT(!db_object_field_not_empty(object_field));
    CU_ASSERT_PTR_NOT_NULL_FATAL(db_object_field_name(object_field));
    CU_ASSERT(!strcmp(db_object_field_name(object_field), "field1"));
    CU_ASSERT(db_object_field_type(object_field) == DB_TYPE_INT32);

    CU_ASSERT_PTR_NOT_NULL_FATAL((object_field2 = db_object_field_new()));
    CU_ASSERT(!db_object_field_set_name(object_field2, "field2"));
    CU_ASSERT(!db_object_field_set_type(object_field2, DB_TYPE_ENUM));
    CU_ASSERT(!db_object_field_set_enum_set(object_field2, (db_enum_t*)&fake_pointer));
    CU_ASSERT(!db_object_field_not_empty(object_field2));
    CU_ASSERT_PTR_NOT_NULL_FATAL(db_object_field_name(object_field2));
    CU_ASSERT(!strcmp(db_object_field_name(object_field2), "field2"));
    CU_ASSERT(db_object_field_type(object_field2) == DB_TYPE_ENUM);
    CU_ASSERT(db_object_field_enum_set(object_field2) == (db_enum_t*)&fake_pointer);
}
开发者ID:jelu,项目名称:dbo,代码行数:19,代码来源:test_classes.c

示例4: parallel_execute

static void parallel_execute(odp_schedule_sync_t sync, int num_queues,
			     int num_prio, int enable_schd_multi,
			     int enable_excl_atomic)
{
	odp_shm_t shm;
	test_globals_t *globals;
	thread_args_t *args;

	shm = odp_shm_lookup(GLOBALS_SHM_NAME);
	CU_ASSERT_FATAL(shm != ODP_SHM_INVALID);
	globals = odp_shm_addr(shm);
	CU_ASSERT_PTR_NOT_NULL_FATAL(globals);

	shm = odp_shm_lookup(SHM_THR_ARGS_NAME);
	CU_ASSERT_FATAL(shm != ODP_SHM_INVALID);
	args = odp_shm_addr(shm);
	CU_ASSERT_PTR_NOT_NULL_FATAL(args);

	args->globals = globals;
	args->sync = sync;
	args->num_queues = num_queues;
	args->num_prio = num_prio;
	if (enable_excl_atomic)
		args->num_bufs = BUFS_PER_QUEUE_EXCL;
	else
		args->num_bufs = BUFS_PER_QUEUE;
	args->num_workers = globals->num_workers;
	args->enable_schd_multi = enable_schd_multi;
	args->enable_excl_atomic = enable_excl_atomic;

	fill_queues(args);

	/* Create and launch worker threads */
	args->cu_thr.numthrds = globals->num_workers;
	odp_cunit_thread_create(schedule_common_, &args->cu_thr);

	/* Wait for worker threads to terminate */
	odp_cunit_thread_exit(&args->cu_thr);

	/* Cleanup ordered queues for next pass */
	if (sync == ODP_SCHED_SYNC_ORDERED)
		reset_queues(args);
}
开发者ID:nmorey,项目名称:odp,代码行数:43,代码来源:scheduler.c

示例5: core_init_test

static void core_init_test(void) {
	LinphoneCoreVTable v_table;
	LinphoneCore* lc;
	memset (&v_table,0,sizeof(v_table));
	lc = linphone_core_new(&v_table,NULL,NULL,NULL);
	/* until we have good certificates on our test server... */
	linphone_core_verify_server_certificates(lc,FALSE);
	CU_ASSERT_PTR_NOT_NULL_FATAL(lc);
	linphone_core_destroy(lc);
}
开发者ID:zengtaoxian,项目名称:linphone,代码行数:10,代码来源:setup_tester.c

示例6: testTeamDefsModelScriptData

static void testTeamDefsModelScriptData (void)
{
	int i;
	linkedList_t *armourPaths = NULL;

	for (i = 0; i < csi.numTeamDefs; i++) {
		int j;
		const teamDef_t *teamDef = &csi.teamDef[i];
		if (!teamDef->armour)
			continue;

		for (j = 0; j < csi.numODs; j++) {
			const objDef_t *od = INVSH_GetItemByIDX(j);
			if (!INV_IsArmour(od))
				continue;

			/* not for this team */
			if (!CHRSH_IsArmourUseableForTeam(od, teamDef))
				continue;

			if (!LIST_ContainsString(armourPaths, od->armourPath))
				LIST_AddString(&armourPaths, od->armourPath);
		}

		UFO_CU_ASSERT_TRUE_MSG(!LIST_IsEmpty(armourPaths), va("no armour definitions found for team %s - but armour is set to true",
				teamDef->id));

		LIST_Foreach(armourPaths, char const, armourPath) {
			int l;

			for (l = NAME_NEUTRAL; l < NAME_LAST; l++) {
				/* no models for this gender */
				if (!teamDef->numModels[l])
					continue;

				CU_ASSERT_PTR_NOT_NULL_FATAL(teamDef->models[l]);

				for (linkedList_t const* list = teamDef->models[l]; list; list = list->next) {
					teamDef_t::model_t const& m = *static_cast<teamDef_t::model_t const*>(list->data);

					UFO_CU_ASSERT_TRUE_MSG(TEST_CheckModel(va("%s/%s", m.path, m.body)), va("%s does not exist in models/%s (teamDef: %s)",
							m.body, m.path, teamDef->id));
					UFO_CU_ASSERT_TRUE_MSG(TEST_CheckModel(va("%s%s/%s", m.path, armourPath, m.body)), va("%s does not exist in models/%s%s (teamDef: %s)",
							m.body, m.path, armourPath, teamDef->id));

					UFO_CU_ASSERT_TRUE_MSG(TEST_CheckModel(va("%s/%s", m.path, m.head)), va("%s does not exist in models/%s (teamDef: %s)",
							m.head, m.path, teamDef->id));
					UFO_CU_ASSERT_TRUE_MSG(TEST_CheckModel(va("%s%s/%s", m.path, armourPath, m.head)), va("%s does not exist in models/%s%s (teamDef: %s)",
							m.head, m.path, armourPath, teamDef->id));
				}
			}
		}

		LIST_Delete(&armourPaths);
	}
开发者ID:Qazzian,项目名称:ufoai_suspend,代码行数:55,代码来源:test_scripts.cpp

示例7: ipv6_aaaa_query

/* Successful IPv6 AAAA query */
static void ipv6_aaaa_query(void) {
	struct addrinfo *ai;
	int timeout;
	endpoint_t *client;

	if (!belle_sip_tester_ipv6_available()){
		belle_sip_warning("Test skipped, IPv6 connectivity not available.");
		return;
	}

	client = create_endpoint();
	CU_ASSERT_PTR_NOT_NULL_FATAL(client);
	timeout = belle_sip_stack_get_dns_timeout(client->stack);
	client->resolver_ctx = belle_sip_stack_resolve_a(client->stack, IPV6_SIP_DOMAIN, SIP_PORT, AF_INET6, a_resolve_done, client);
	CU_ASSERT_NOT_EQUAL(client->resolver_ctx, NULL);
	CU_ASSERT_TRUE(wait_for(client->stack, &client->resolve_done, 1, timeout));
	CU_ASSERT_PTR_NOT_EQUAL(client->ai_list, NULL);
	if (client->ai_list) {
		struct addrinfo *next;
		struct sockaddr_in6 *sock_in6 = (struct sockaddr_in6 *)client->ai_list->ai_addr;
		CU_ASSERT_EQUAL(ntohs(sock_in6->sin6_port), SIP_PORT);
		/*the IPv6 address shall return first, and must be a real ipv6 address*/
		CU_ASSERT_TRUE(client->ai_list->ai_family==AF_INET6);
		CU_ASSERT_FALSE(IN6_IS_ADDR_V4MAPPED(&sock_in6->sin6_addr));
		ai = belle_sip_ip_address_to_addrinfo(AF_INET6, IPV6_SIP_IP, SIP_PORT);
		CU_ASSERT_PTR_NOT_NULL(ai);
		if (ai) {
			struct in6_addr *ipv6_address = &((struct sockaddr_in6 *)ai->ai_addr)->sin6_addr;
			int i;
			for (i = 0; i < 8; i++) {
				CU_ASSERT_EQUAL(sock_in6->sin6_addr.s6_addr[i], ipv6_address->s6_addr[i]);
			}
			belle_sip_freeaddrinfo(ai);
		}
		next=client->ai_list->ai_next;
		CU_ASSERT_PTR_NOT_NULL(next);
		if (next){
			sock_in6 = (struct sockaddr_in6 *)next->ai_addr;
			CU_ASSERT_TRUE(next->ai_family==AF_INET6);
			CU_ASSERT_TRUE(IN6_IS_ADDR_V4MAPPED(&sock_in6->sin6_addr));
			CU_ASSERT_EQUAL(ntohs(sock_in6->sin6_port), SIP_PORT);
			ai = belle_sip_ip_address_to_addrinfo(AF_INET6, IPV6_SIP_IPV4, SIP_PORT);
			CU_ASSERT_PTR_NOT_NULL(ai);
			if (ai) {
				struct in6_addr *ipv6_address = &((struct sockaddr_in6 *)ai->ai_addr)->sin6_addr;
				int i;
				for (i = 0; i < 8; i++) {
					CU_ASSERT_EQUAL(sock_in6->sin6_addr.s6_addr[i], ipv6_address->s6_addr[i]);
				}
				belle_sip_freeaddrinfo(ai);
			}
		}
	}
	destroy_endpoint(client);
}
开发者ID:HackLinux,项目名称:VideoCallVoIP,代码行数:56,代码来源:belle_sip_resolver_tester.c

示例8: test_class_db_result

void test_class_db_result(void) {
    db_value_set_t* local_value_set = value_set;
    db_value_set_t* local_value_set2 = value_set2;
    db_backend_meta_data_list_t* local_backend_meta_data_list2 = backend_meta_data_list2;

    CU_ASSERT_PTR_NOT_NULL_FATAL((result = db_result_new()));
    CU_ASSERT(!db_result_set_value_set(result, value_set));
    value_set = NULL;
    CU_ASSERT(db_result_value_set(result) == local_value_set);
    CU_ASSERT(!db_result_set_backend_meta_data_list(result, backend_meta_data_list2));
    backend_meta_data_list2 = NULL;
    CU_ASSERT(db_result_backend_meta_data_list(result) == local_backend_meta_data_list2);
    CU_ASSERT(!db_result_not_empty(result));

    CU_ASSERT_PTR_NOT_NULL_FATAL((result2 = db_result_new()));
    CU_ASSERT(!db_result_set_value_set(result2, value_set2));
    value_set2 = NULL;
    CU_ASSERT(db_result_value_set(result2) == local_value_set2);
    CU_ASSERT(!db_result_not_empty(result2));
}
开发者ID:jelu,项目名称:dbo,代码行数:20,代码来源:test_classes.c

示例9: ipv4_a_query_send_failure

/* IPv4 A query send failure */
static void ipv4_a_query_send_failure(void) {
	endpoint_t *client = create_endpoint();

	CU_ASSERT_PTR_NOT_NULL_FATAL(client);
	belle_sip_stack_set_resolver_send_error(client->stack, -1);
	client->resolver_ctx = belle_sip_stack_resolve_a(client->stack, IPV4_SIP_DOMAIN, SIP_PORT, AF_INET, a_resolve_done, client);
	CU_ASSERT_EQUAL(client->resolver_ctx, NULL);
	belle_sip_stack_set_resolver_send_error(client->stack, 0);

	destroy_endpoint(client);
}
开发者ID:HackLinux,项目名称:VideoCallVoIP,代码行数:12,代码来源:belle_sip_resolver_tester.c

示例10: test_escaped_headers

static void test_escaped_headers(void) {
	belle_sip_uri_t *  L_uri = belle_sip_uri_parse("sip:[email protected]?User-to-User=323a313030363a3230385a48363039313941364b4342463845495936%3Bencoding%3Dhex");
	char* l_raw_uri = belle_sip_object_to_string(BELLE_SIP_OBJECT(L_uri));
	belle_sip_object_unref(BELLE_SIP_OBJECT(L_uri));
	L_uri = belle_sip_uri_parse(l_raw_uri);
	belle_sip_free(l_raw_uri);
	CU_ASSERT_PTR_NOT_NULL_FATAL(belle_sip_uri_get_header(L_uri,"User-to-User"));
	CU_ASSERT_STRING_EQUAL(belle_sip_uri_get_header(L_uri,"User-to-User"), "323a313030363a3230385a48363039313941364b4342463845495936;encoding=hex");

	belle_sip_object_unref(L_uri);
}
开发者ID:Gui13,项目名称:belle-sip,代码行数:11,代码来源:belle_sip_uri_tester.c

示例11: test_game

static void test_game(void)
{
    struct Draughts *game;
    game = init_game();
    CU_ASSERT_PTR_NOT_NULL_FATAL(game);
    free(game);
    fake_malloc_params.should_fail = 1;
    struct Draughts *game_fail;
    game_fail = init_game();
    CU_ASSERT_PTR_NULL_FATAL(game_fail);
}
开发者ID:simonppg,项目名称:game,代码行数:11,代码来源:test.c

示例12: ms_tester_create_filters

void ms_tester_create_filters(unsigned int filter_mask) {
	MSSndCardManager *snd_manager;
	MSWebCamManager *cam_manager;
	MSSndCard *playcard;
	MSSndCard *captcard;
	MSWebCam *camera;

	CREATE_FILTER(FILTER_MASK_FILEPLAY, ms_tester_fileplay, MS_FILE_PLAYER_ID);
	CREATE_FILTER(FILTER_MASK_FILEREC, ms_tester_filerec, MS_FILE_REC_ID);
	CREATE_FILTER(FILTER_MASK_DTMFGEN, ms_tester_dtmfgen, MS_DTMF_GEN_ID);
	CREATE_FILTER(FILTER_MASK_TONEDET, ms_tester_tonedet, MS_TONE_DETECTOR_ID);
	CREATE_FILTER(FILTER_MASK_VOIDSOURCE, ms_tester_voidsource, MS_VOID_SOURCE_ID);
	CREATE_FILTER(FILTER_MASK_VOIDSINK, ms_tester_voidsink, MS_VOID_SINK_ID);
	if (filter_mask & FILTER_MASK_ENCODER) {
		CU_ASSERT_PTR_NULL(ms_tester_encoder);
		ms_tester_encoder = ms_filter_create_encoder(ms_tester_codec_mime);
		CU_ASSERT_PTR_NOT_NULL_FATAL(ms_tester_encoder);
	}
	if (filter_mask & FILTER_MASK_DECODER) {
		CU_ASSERT_PTR_NULL(ms_tester_decoder);
		ms_tester_decoder = ms_filter_create_decoder(ms_tester_codec_mime);
		CU_ASSERT_PTR_NOT_NULL_FATAL(ms_tester_decoder);
	}
	CREATE_FILTER(FILTER_MASK_RTPRECV, ms_tester_rtprecv, MS_RTP_RECV_ID);
	CREATE_FILTER(FILTER_MASK_RTPSEND, ms_tester_rtpsend, MS_RTP_SEND_ID);
	CREATE_FILTER(FILTER_MASK_RESAMPLER, ms_tester_resampler, MS_RESAMPLE_ID);
	if (filter_mask & FILTER_MASK_SOUNDWRITE) {
		CU_ASSERT_PTR_NULL(ms_tester_soundwrite);
		snd_manager = ms_snd_card_manager_get();
		playcard = ms_snd_card_manager_get_default_playback_card(snd_manager);
		CU_ASSERT_PTR_NOT_NULL_FATAL(playcard);
		ms_tester_soundwrite = ms_snd_card_create_writer(playcard);
		CU_ASSERT_PTR_NOT_NULL_FATAL(ms_tester_soundwrite);
	}
	if (filter_mask & FILTER_MASK_SOUNDREAD) {
		CU_ASSERT_PTR_NULL(ms_tester_soundread);
		snd_manager = ms_snd_card_manager_get();
		captcard = ms_snd_card_manager_get_default_capture_card(snd_manager);
		CU_ASSERT_PTR_NOT_NULL_FATAL(captcard);
		ms_tester_soundread = ms_snd_card_create_reader(captcard);
		CU_ASSERT_PTR_NOT_NULL_FATAL(ms_tester_soundread);
	}
	if (filter_mask & FILTER_MASK_VIDEOCAPTURE) {
		CU_ASSERT_PTR_NULL(ms_tester_videocapture);
		cam_manager = ms_web_cam_manager_get();
		camera = ms_web_cam_manager_get_default_cam(cam_manager);
		CU_ASSERT_PTR_NOT_NULL_FATAL(camera);
		ms_tester_videocapture = ms_web_cam_create_reader(camera);
		CU_ASSERT_PTR_NOT_NULL_FATAL(ms_tester_videocapture);
	}
}
开发者ID:biddyweb,项目名称:azfone-ios,代码行数:51,代码来源:mediastreamer2_tester_private.c

示例13: test_headers

static void test_headers(void) {
	belle_sip_uri_t *  L_uri = belle_sip_uri_parse("sip:192.168.0.1?toto=titi");
	char* l_raw_uri = belle_sip_object_to_string(BELLE_SIP_OBJECT(L_uri));
	belle_sip_object_unref(BELLE_SIP_OBJECT(L_uri));
	L_uri = belle_sip_uri_parse(l_raw_uri);
	belle_sip_free(l_raw_uri);
	CU_ASSERT_PTR_NOT_NULL_FATAL(belle_sip_uri_get_header(L_uri,"toto"));
	CU_ASSERT_STRING_EQUAL(belle_sip_uri_get_header(L_uri,"toto"), "titi");

	CU_ASSERT_PTR_NULL(belle_sip_uri_get_header(L_uri,"bla"));
	belle_sip_object_unref(BELLE_SIP_OBJECT(L_uri));
	L_uri = belle_sip_uri_parse("sip:192.168.0.1?toto=titi&header2=popo&header3=");
	l_raw_uri = belle_sip_object_to_string(BELLE_SIP_OBJECT(L_uri));
	belle_sip_object_unref(BELLE_SIP_OBJECT(L_uri));
	L_uri = belle_sip_uri_parse(l_raw_uri);
	belle_sip_free(l_raw_uri);

	CU_ASSERT_PTR_NOT_NULL_FATAL(belle_sip_uri_get_header(L_uri,"toto"));
	CU_ASSERT_STRING_EQUAL(belle_sip_uri_get_header(L_uri,"header2"), "popo");
	belle_sip_object_unref(L_uri);
}
开发者ID:Gui13,项目名称:belle-sip,代码行数:21,代码来源:belle_sip_uri_tester.c

示例14: CreateInstallation

static installation_t* CreateInstallation (const char *name, const vec2_t pos)
{
	const installationTemplate_t *installationTemplate = INS_GetInstallationTemplateFromInstallationID("ufoyard");
	installation_t *installation = INS_GetFirstUnfoundedInstallation();

	CU_ASSERT_PTR_NOT_NULL_FATAL(installationTemplate);

	CU_ASSERT_PTR_NOT_NULL_FATAL(installation);

	CU_ASSERT_FALSE(installation->founded);

	INS_SetUpInstallation(installation, installationTemplate, pos, name);
	CU_ASSERT_EQUAL(installation->installationStatus, INSTALLATION_UNDER_CONSTRUCTION);

	/* fake the build time */
	installation->buildStart = ccs.date.day - installation->installationTemplate->buildTime;
	INS_UpdateInstallationData();
	CU_ASSERT_EQUAL(installation->installationStatus, INSTALLATION_WORKING);

	return installation;
}
开发者ID:chrisglass,项目名称:ufoai,代码行数:21,代码来源:test_campaign.c

示例15: test_register_channel_inactive

static void test_register_channel_inactive(void){
	belle_sip_listening_point_t *lp=belle_sip_provider_get_listening_point(prov,"TCP");
	CU_ASSERT_PTR_NOT_NULL_FATAL(lp);
	belle_sip_stack_set_inactive_transport_timeout(stack,5);
	belle_sip_listening_point_clean_channels(lp);
	CU_ASSERT_EQUAL(belle_sip_listening_point_get_channel_count(lp),0);
	register_test("tcp",1);
	CU_ASSERT_EQUAL(belle_sip_listening_point_get_channel_count(lp),1);
	belle_sip_stack_sleep(stack,5000);
	CU_ASSERT_EQUAL(belle_sip_listening_point_get_channel_count(lp),0);
	belle_sip_stack_set_inactive_transport_timeout(stack,3600);
}
开发者ID:Gui13,项目名称:belle-sip,代码行数:12,代码来源:belle_sip_register_tester.c


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