您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ CU_ASSERT_FALSE函数代码示例

51自学网 2021-06-01 20:07:26
  C++
这篇教程C++ CU_ASSERT_FALSE函数代码示例写得很实用,希望能帮到您。

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

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

示例1: testSchedulerCheck

static void testSchedulerCheck (void){	std::string s_one("one");	std::string s_two("two");	std::string s_three("three");	std::string s_four("four");	std::string s_five("five");	ScheduleEventPtr three = Schedule_Event(4, nullptr, nullptr, nullptr, static_cast<void*>(&s_three));	ScheduleEventPtr four = Schedule_Event(4, nullptr, nullptr, nullptr, static_cast<void*>(&s_four));	ScheduleEventPtr five = Schedule_Event(4, nullptr, nullptr, nullptr, static_cast<void*>(&s_five));	ScheduleEventPtr one = Schedule_Event(3, nullptr, delayCheck, nullptr, static_cast<void*>(&s_one));	ScheduleEventPtr two = Schedule_Event(3, nullptr, nullptr, nullptr, static_cast<void*>(&s_two));	ScheduleEventPtr e = Dequeue_Event(1);	CU_ASSERT_FALSE(e);	e = Dequeue_Event(2);	CU_ASSERT_FALSE(e);	/* one is delayed via check function - so we get the 2nd event at the first dequeue here */	e = Dequeue_Event(3);	CU_ASSERT_EQUAL_FATAL(e, two);	/* now we are ready for the 1st event */	e = Dequeue_Event(5);	CU_ASSERT_EQUAL_FATAL(e, one);	/* the remaining events are in order */	e = Dequeue_Event(5);	CU_ASSERT_EQUAL_FATAL(e, three);	e = Dequeue_Event(5);	CU_ASSERT_EQUAL_FATAL(e, four);	e = Dequeue_Event(5);	CU_ASSERT_EQUAL_FATAL(e, five);}
开发者ID:cigo,项目名称:ufoai,代码行数:32,


示例2: test_hashMap_containsValue

void test_hashMap_containsValue(void) {    char * key = "key";    char * value = "value";    char * key2 = "key2";    char * value2 = "value2";    char * neValue = "notExisting";    char * key3 = "key3";    char * value3 = NULL;    hashMap_clear(map, false, false);    // Add one entry    hashMap_put(map, key, value);    // Add second entry    hashMap_put(map, key2, value2);    CU_ASSERT_TRUE(hashMap_containsValue(map, value));    CU_ASSERT_TRUE(hashMap_containsValue(map, value2));    CU_ASSERT_FALSE(hashMap_containsValue(map, neValue));    CU_ASSERT_FALSE(hashMap_containsValue(map, NULL));    // Add third entry with NULL value    hashMap_put(map, key3, value3);    CU_ASSERT_TRUE(hashMap_containsValue(map, value3));}
开发者ID:ecros,项目名称:celix,代码行数:27,


示例3: change_expires

static void change_expires(){	LinphoneCoreManager* lcm = create_lcm();	stats* counters = &lcm->stat;	LinphoneProxyConfig* proxy_config;	register_with_refresh_base(lcm->lc,FALSE,NULL,NULL);	linphone_core_get_default_proxy(lcm->lc,&proxy_config);	linphone_proxy_config_edit(proxy_config);	reset_counters(counters); /*clear stats*/	/*nothing is supposed to arrive until done*/	CU_ASSERT_FALSE(wait_for_until(lcm->lc,lcm->lc,&counters->number_of_LinphoneRegistrationCleared,1,3000));	linphone_proxy_config_set_expires(proxy_config,3);	linphone_proxy_config_done(proxy_config);	CU_ASSERT_TRUE(wait_for(lcm->lc,lcm->lc,&counters->number_of_LinphoneRegistrationOk,1));	/*wait 2s without receive refresh*/	CU_ASSERT_FALSE(wait_for_until(lcm->lc,lcm->lc,&counters->number_of_LinphoneRegistrationOk,2,2000));	/* now, it should be ok*/	CU_ASSERT_TRUE(wait_for(lcm->lc,lcm->lc,&counters->number_of_LinphoneRegistrationOk,2));	linphone_core_manager_destroy(lcm);}
开发者ID:xiaolds,项目名称:VideoCallVoIP,代码行数:26,


示例4: test_compareStrAndNum

static void test_compareStrAndNum() {    int32_t num;    CU_ASSERT_TRUE(compareStrAndNum("abcd", 1, "afgh", 1, NULL));    CU_ASSERT_TRUE(compareStrAndNum("ABCD", 4, "abcd", 4, NULL));    CU_ASSERT_TRUE(compareStrAndNum("AbCd", 3, "AbCE", 3, NULL));    CU_ASSERT_TRUE(compareStrAndNum("ABCD", 1, "a", 1, NULL));    CU_ASSERT_FALSE(compareStrAndNum("abcd", 1, "efgh", 1, NULL));    CU_ASSERT_FALSE(compareStrAndNum("ABCD", 4, "abcd", 3, NULL));    CU_ASSERT_TRUE(compareStrAndNum("abcd", 4, "abcd1", 5, NULL));    CU_ASSERT_TRUE(compareStrAndNum("abcd", 4, "abcd123", 7, NULL));    CU_ASSERT_FALSE(compareStrAndNum("abcd", 4, "abcd12A", 7, NULL));    CU_ASSERT_FALSE(compareStrAndNum("abcd", 4, "abcdB12", 7, NULL));    CU_ASSERT_FALSE(compareStrAndNum("abdd", 4, "abcd132", 7, NULL));#define TEST_COMPARE_STR_AND_NUM(s1, l1, s2, l2, v, r)              /    do {                                                            /        num = -1;                                                    /        CU_ASSERT_EQUAL(compareStrAndNum(s1, l1, s2, l2, &num),r);  /        CU_ASSERT_EQUAL(num, v);                                    /    } while(0);                                                     /    TEST_COMPARE_STR_AND_NUM("abcd", 4, "abcd", 4, -1, TRUE);    TEST_COMPARE_STR_AND_NUM("abcd", 4, "abcd1", 5, 1, TRUE);    TEST_COMPARE_STR_AND_NUM("abcd", 4, "abcd123", 7, 123, TRUE);    TEST_COMPARE_STR_AND_NUM("abcd", 4, "abcd12A", 7, -1, FALSE);    TEST_COMPARE_STR_AND_NUM("abcd", 4, "abcdB12", 7, -1, FALSE);    TEST_COMPARE_STR_AND_NUM("abdd", 4, "abcd132", 7, -1, FALSE);}
开发者ID:llahti,项目名称:scpi-parser,代码行数:31,


示例5: test_grid_is_row_complete

void test_grid_is_row_complete(){    // Create a grid.    int numberOfRows = 4;    int numberOfColumns = 4;    TrnGrid* grid = trn_grid_new(numberOfRows, numberOfColumns);    // Last row is void only.    CU_ASSERT_FALSE( trn_grid_is_row_complete(grid,numberOfRows) );    // Last row is full.    TrnPositionInGrid pos;    int columnIndex;    pos.rowIndex = numberOfRows-1 ;    for (columnIndex = 0 ; columnIndex < grid->numberOfColumns ; columnIndex++) {        pos.columnIndex = columnIndex;        trn_grid_set_cell(grid, pos, TRN_TETROMINO_I);    }    CU_ASSERT_TRUE( trn_grid_is_row_complete(grid,numberOfRows) );    // Last row is full except last element.     pos.rowIndex = numberOfRows-1 ;    pos.columnIndex = numberOfColumns-1 ;    trn_grid_set_cell(grid, pos, TRN_TETROMINO_VOID);    CU_ASSERT_FALSE( trn_grid_is_row_complete(grid,numberOfRows) );}
开发者ID:FredericN,项目名称:tetrinria,代码行数:26,


示例6: nomls_tests

void nomls_tests(){	size_t first_diff = 0;	int test_result;	unchanged_users_v = apol_vector_create(free);	changed_users_v = apol_vector_create(free);	apol_vector_t *correct_unchanged_users_v = string_array_to_vector(nomls_unchanged_users);	apol_vector_t *correct_changed_users_v = string_array_to_vector(nomls_changed_users);	build_nomls_vecs();	apol_vector_sort(unchanged_users_v, compare_str, NULL);	apol_vector_sort(correct_unchanged_users_v, compare_str, NULL);	CU_ASSERT_FALSE(test_result =			apol_vector_compare(unchanged_users_v, correct_unchanged_users_v, compare_str, NULL, &first_diff));	if (test_result) {		print_test_failure(unchanged_users_v, correct_unchanged_users_v, first_diff, "Unchanged MLS Users");	}	apol_vector_sort(changed_users_v, compare_str, NULL);	apol_vector_sort(correct_changed_users_v, compare_str, NULL);	CU_ASSERT_FALSE(test_result =			apol_vector_compare(changed_users_v, correct_changed_users_v, compare_str, NULL, &first_diff));	if (test_result) {		print_test_failure(changed_users_v, correct_changed_users_v, first_diff, "Changed MLS Users");	}	apol_vector_destroy(&unchanged_users_v);	apol_vector_destroy(&changed_users_v);	apol_vector_destroy(&correct_unchanged_users_v);	apol_vector_destroy(&correct_changed_users_v);}
开发者ID:0xroot,项目名称:setools3,代码行数:31,


示例7: test_string_ends_with

static void test_string_ends_with() {	CU_ASSERT_TRUE(string_ends_with("MiArchivo.txt", "txt"));	CU_ASSERT_TRUE(string_ends_with("MiArchivo.txt", "MiArchivo.txt"));	CU_ASSERT_FALSE(string_ends_with("MiArchivo.doc", "txt"));	CU_ASSERT_FALSE(string_ends_with("MiDoc", "txt"));	CU_ASSERT_FALSE(string_ends_with("", "txt"));}
开发者ID:nnico15m,项目名称:so-commons-library,代码行数:7,


示例8: testNTH

void testNTH(){    list_t *l = list_new();    for (int i = 0; i < 100; ++i)        {            int *x = malloc(sizeof(int));            *x = i;            list_add(l, x);        }    int *x;    for (int i = 0; i < 100; ++i)        {            CU_ASSERT(list_nth(l, i, (void **)&x));            CU_ASSERT_EQUAL(*x, i);        }    CU_ASSERT_FALSE(list_nth(l, -1, (void **)&x));    CU_ASSERT_EQUAL(x, NULL);    CU_ASSERT_FALSE(list_nth(l, 100, (void **)&x));    CU_ASSERT_EQUAL(x, NULL);    list_foreach(l, free);    list_free(l);}
开发者ID:JohanWindahl,项目名称:ioopm15,代码行数:26,


示例9: test_string_starts_with

static void test_string_starts_with() {	CU_ASSERT_TRUE(string_starts_with("#Comentario", "#"));	CU_ASSERT_TRUE(string_starts_with("Comentario", "Comen"));	CU_ASSERT_FALSE(string_starts_with("Comentario", "comen"));	CU_ASSERT_FALSE(string_starts_with("Comentario", "lala"));	CU_ASSERT_FALSE(string_starts_with("", "#"));}
开发者ID:nnico15m,项目名称:so-commons-library,代码行数:7,


示例10: testUriComponentsChecker

/* * From 19.1.1 SIP and SIPS URI Components * 									   				dialog										reg./redir. Contact/			default  Req.-URI  To  From  Contact   R-R/Route  externaluser          --          o      o    o       o          o         opassword      --          o      o    o       o          o         ohost          --          m      m    m       m          m         mport          (1)         o      -    -       o          o         ouser-param    ip          o      o    o       o          o         omethod        INVITE      -      -    -       -          -         omaddr-param   --          o      -    -       o          o         ottl-param     1           o      -    -       o          -         otransp.-param (2)         o      -    -       o          o         olr-param      --          o      -    -       -          o         oother-param   --          o      o    o       o          o         oheaders       --          -      -    -       o          -         o*/void testUriComponentsChecker() {	belle_sip_uri_t* uri = belle_sip_uri_parse("sip:hostonly");	CU_ASSERT_TRUE(belle_sip_uri_check_components_from_request_uri(uri));	belle_sip_object_unref(uri);	{	belle_sip_header_from_t*	header = belle_sip_header_from_parse("From: sip:linphone.org:5061");	CU_ASSERT_FALSE(belle_sip_uri_check_components_from_context(belle_sip_header_address_get_uri(BELLE_SIP_HEADER_ADDRESS(header)),NULL,"From"));	belle_sip_object_unref(header);	}	{	belle_sip_header_to_t*	header = belle_sip_header_to_parse("To: sip:linphone.org?header=interdit");	CU_ASSERT_FALSE(belle_sip_uri_check_components_from_context(belle_sip_header_address_get_uri(BELLE_SIP_HEADER_ADDRESS(header)),NULL,"To"));	belle_sip_object_unref(header);	}	{	belle_sip_header_contact_t*	header = belle_sip_header_contact_parse("Contact: <sip:linphone.org;lr>");	CU_ASSERT_FALSE(belle_sip_uri_check_components_from_context(belle_sip_header_address_get_uri(BELLE_SIP_HEADER_ADDRESS(header)),"REGISTER","Contact"));	CU_ASSERT_TRUE(belle_sip_uri_check_components_from_context(belle_sip_header_address_get_uri(BELLE_SIP_HEADER_ADDRESS(header)),NULL,"Contact"));	belle_sip_object_unref(header);	}	{	belle_sip_header_record_route_t*	header = belle_sip_header_record_route_parse("Record-Route: <sip:linphone.org;ttl=interdit>");	CU_ASSERT_FALSE(belle_sip_uri_check_components_from_context(belle_sip_header_address_get_uri(BELLE_SIP_HEADER_ADDRESS(header)),NULL,"Record-Route"));	belle_sip_object_unref(header);	}	{	belle_sip_uri_t* uri = belle_sip_uri_parse("sip:linphone.org:5061?header=toto");	CU_ASSERT_TRUE(belle_sip_uri_check_components_from_context(uri,NULL,"Any"));	belle_sip_object_unref(uri);	}}
开发者ID:Gui13,项目名称:belle-sip,代码行数:49,


示例11: test_error_level

void test_error_level() {	CU_ASSERT_TRUE(set_log_lvl(ERROR));	char *test_msg = "Test msg";	int deep = 1;	CU_ASSERT_FALSE(debug(deep, test_msg));	CU_ASSERT_FALSE(info(deep, test_msg));	CU_ASSERT_FALSE(warn(deep, test_msg));	CU_ASSERT_TRUE(error(deep, test_msg));}
开发者ID:jorgemtnz,项目名称:simpleFileServer,代码行数:9,


示例12: test_is_multicast

static void test_is_multicast(void) {	CU_ASSERT_TRUE(ms_is_multicast("224.1.2.3"));	CU_ASSERT_TRUE(ms_is_multicast("239.0.0.0"));	CU_ASSERT_TRUE(ms_is_multicast("ff02::3:2"));	CU_ASSERT_FALSE(ms_is_multicast("192.68.0.1"));	CU_ASSERT_FALSE(ms_is_multicast("::1"));}
开发者ID:tiena2cva,项目名称:Linphone,代码行数:9,


示例13: xmms_metadata_test_xform_init

static gbooleanxmms_metadata_test_xform_init (xmms_xform_t *xform){	const gchar *musicbrainz_va_id = "89ad4ac3-39f7-470e-963a-56509c546377";	const gchar *title, *rpgain;	gint track, totaltracks, compilation;	CU_ASSERT_FALSE (xmms_xform_metadata_mapper_match (xform, "missing", "missing", -1));	/* Basic string mapping */	CU_ASSERT_TRUE (xmms_xform_metadata_mapper_match (xform, "title", "the title", -1));	CU_ASSERT_TRUE (xmms_xform_metadata_get_str (xform, XMMS_MEDIALIB_ENTRY_PROPERTY_TITLE, &title));	CU_ASSERT_STRING_EQUAL ("the title", title);	/* Mapping track number, without total tracks */	CU_ASSERT_TRUE (xmms_xform_metadata_mapper_match (xform, "tracknr", "1", -1));	CU_ASSERT_TRUE (xmms_xform_metadata_get_int (xform, XMMS_MEDIALIB_ENTRY_PROPERTY_TRACKNR, &track));	CU_ASSERT_FALSE (xmms_xform_metadata_get_int (xform, XMMS_MEDIALIB_ENTRY_PROPERTY_TOTALTRACKS, &totaltracks));	CU_ASSERT_EQUAL (1, track);	/* Mapping track number, with total tracks */	CU_ASSERT_TRUE (xmms_xform_metadata_mapper_match (xform, "tracknr", "1/10", -1));	CU_ASSERT_TRUE (xmms_xform_metadata_get_int (xform, XMMS_MEDIALIB_ENTRY_PROPERTY_TRACKNR, &track));	CU_ASSERT_TRUE (xmms_xform_metadata_get_int (xform, XMMS_MEDIALIB_ENTRY_PROPERTY_TOTALTRACKS, &totaltracks));	CU_ASSERT_EQUAL (1, track);	CU_ASSERT_EQUAL (10, totaltracks);	/* Broken track number */	CU_ASSERT_FALSE (xmms_xform_metadata_mapper_match (xform, "tracknr", "bad", -1));	/* Mapping compilation indicator to boolean compilation */	CU_ASSERT_TRUE (xmms_xform_metadata_mapper_match (xform, "compilation", "1", -1));	CU_ASSERT_TRUE (xmms_xform_metadata_get_int (xform, XMMS_MEDIALIB_ENTRY_PROPERTY_COMPILATION, &compilation));	CU_ASSERT_EQUAL (TRUE, compilation);	/* Mapping compilation indicator to boolean compilation */	CU_ASSERT_TRUE (xmms_xform_metadata_mapper_match (xform, "compilation", musicbrainz_va_id, -1));	CU_ASSERT_TRUE (xmms_xform_metadata_get_int (xform, XMMS_MEDIALIB_ENTRY_PROPERTY_COMPILATION, &compilation));	CU_ASSERT_EQUAL (TRUE, compilation);	/* Mapping replaygain to the format the replaygain xform expects */	CU_ASSERT_TRUE (xmms_xform_metadata_mapper_match (xform, "replaygain_track_gain", "-14.69", -1));	CU_ASSERT_TRUE (xmms_xform_metadata_get_str (xform, XMMS_MEDIALIB_ENTRY_PROPERTY_GAIN_TRACK, &rpgain));	CU_ASSERT_STRING_EQUAL ("0.18428", rpgain);	CU_ASSERT_TRUE (xmms_xform_metadata_mapper_match (xform, "replaygain_track_gain", "-14.69 dB", -1));	CU_ASSERT_TRUE (xmms_xform_metadata_get_str (xform, XMMS_MEDIALIB_ENTRY_PROPERTY_GAIN_TRACK, &rpgain));	CU_ASSERT_STRING_EQUAL ("0.18428", rpgain);	CU_ASSERT_TRUE (xmms_xform_metadata_mapper_match (xform, "coverart", "test", 10));	xmms_xform_outdata_type_add (xform, XMMS_STREAM_TYPE_MIMETYPE, "audio/pcm", XMMS_STREAM_TYPE_END);	return TRUE;}
开发者ID:chrippa,项目名称:xmms2,代码行数:56,


示例14: test_compareStr

static void test_compareStr() {    CU_ASSERT_TRUE(compareStr("abcd", 1, "afgh", 1));    CU_ASSERT_TRUE(compareStr("ABCD", 4, "abcd", 4));    CU_ASSERT_TRUE(compareStr("AbCd", 3, "AbCE", 3));    CU_ASSERT_TRUE(compareStr("ABCD", 1, "a", 1));    CU_ASSERT_FALSE(compareStr("abcd", 1, "efgh", 1));    CU_ASSERT_FALSE(compareStr("ABCD", 4, "abcd", 3));}
开发者ID:llahti,项目名称:scpi-parser,代码行数:10,


示例15: test_vqec_seq_num_le

static void test_vqec_seq_num_le (void) {    result = vqec_seq_num_le(5,4);    CU_ASSERT_FALSE(result);    result = vqec_seq_num_le(5,5);    CU_ASSERT(result);    result = vqec_seq_num_le(5,6);    CU_ASSERT(result);    result = vqec_seq_num_le(0xb,0x8000000b);    CU_ASSERT(result);    result = vqec_seq_num_le(0xb,0x8000000c);    CU_ASSERT_FALSE(result);}
开发者ID:MichaelSchmid,项目名称:cisco-vqe-client,代码行数:12,


示例16: _dead_thread_two

static void _dead_thread_two (void){	s4_transaction_t *trans = s4_begin (s4, 0);	CU_ASSERT_PTR_NOT_NULL (trans);	g_usleep (G_USEC_PER_SEC / 2);	CU_ASSERT_TRUE (s4_add (trans, "b", val, "a", val, "src"));	g_usleep (G_USEC_PER_SEC);	CU_ASSERT_FALSE (s4_add (trans, "a", val, "b", val, "src"));	CU_ASSERT_FALSE (s4_commit (trans));	CU_ASSERT_EQUAL (s4_errno (), S4E_DEADLOCK);}
开发者ID:dchokola,项目名称:s4,代码行数:13,


示例17: TestGridCellIsInGrid

void TestGridCellIsInGrid(){    // Create a grid.    int numberOfRows = 2;    int numberOfColumns = 3;    TrnGrid* grid = trn_grid_new(numberOfRows, numberOfColumns);    TrnPositionInGrid pos;    int rowIndex;    int columnIndex;    // Check position that are in grid    for (rowIndex = 0 ; rowIndex < numberOfRows; rowIndex++) {        pos.rowIndex = rowIndex;        for (columnIndex = 0 ; columnIndex < numberOfColumns ; columnIndex++) {            pos.columnIndex = columnIndex;            CU_ASSERT_TRUE(trn_grid_cell_is_in_grid(grid, pos));        }    }    // Check row out of grid from top.    pos.rowIndex = -1;    for (columnIndex = 0 ; columnIndex < numberOfColumns ; columnIndex++) {        pos.columnIndex = columnIndex;        CU_ASSERT_FALSE(trn_grid_cell_is_in_grid(grid, pos));    }    // Check row out of grid from bottom.    pos.rowIndex = numberOfRows;    for (columnIndex = 0 ; columnIndex < numberOfColumns ; columnIndex++) {        pos.columnIndex = columnIndex;        CU_ASSERT_FALSE(trn_grid_cell_is_in_grid(grid, pos));    }    // Check column out of grid from left.    pos.columnIndex = -1;    for (rowIndex = 0 ; rowIndex < numberOfRows; rowIndex++) {        pos.rowIndex = rowIndex;        CU_ASSERT_FALSE(trn_grid_cell_is_in_grid(grid, pos));    }    // Check column out of grid from right.    pos.columnIndex = numberOfColumns;    for (rowIndex = 0 ; rowIndex < numberOfRows; rowIndex++) {        pos.rowIndex = rowIndex;        CU_ASSERT_FALSE(trn_grid_cell_is_in_grid(grid, pos));    }}
开发者ID:FredericN,项目名称:tetrinria,代码行数:48,


示例18: test_singlePattern

void test_singlePattern(void){    HObs hObs = NULL;    RU8 pattern[] = { 0x01, 0x02, 0x03, 0x04 };    RU8 buffer1[] = { 0x02, 0x04, 0xFF, 0xEF, 0x01, 0x02, 0x03, 0x04 };    RU8 buffer2[] = { 0x02, 0x04, 0xFF, 0xEF, 0x01, 0x02, 0x03, 0x04, 0xEE, 0x6F };    RU8 buffer3[] = { 0x02, 0x04, 0xFF, 0xEF, 0x01, 0x02, 0x01, 0x04, 0xEE, 0x6F };    RU8 buffer4[] = { 0x02, 0x04, 0xFF, 0xEF, 0x01, 0x02, 0x03, 0x04, 0xEE, 0x6F, 0x01, 0x02, 0x03, 0x04 };    RU32 context = 0;    PVOID hitCtx = NULL;    RU8* hitLoc = NULL;    hObs = obsLib_new( 0, 0 );    CU_ASSERT_TRUE_FATAL( rpal_memory_isValid( hObs ) );    CU_ASSERT_TRUE_FATAL( obsLib_addPattern( hObs, (RPU8)&pattern, sizeof( pattern ), &context ) );    // 1 pattern found end of buffer    CU_ASSERT_TRUE_FATAL( obsLib_setTargetBuffer( hObs, buffer1, sizeof( buffer1 ) ) );    CU_ASSERT_TRUE( obsLib_nextHit( hObs, &hitCtx, &hitLoc ) );    CU_ASSERT_EQUAL( hitCtx, &context );    CU_ASSERT_EQUAL( hitLoc, buffer1 + sizeof( buffer1 ) - 4 );    CU_ASSERT_FALSE( obsLib_nextHit( hObs, &hitCtx, &hitLoc ) );    // 1 pattern found middle of buffer    CU_ASSERT_TRUE_FATAL( obsLib_setTargetBuffer( hObs, buffer2, sizeof( buffer2 ) ) );    CU_ASSERT_TRUE( obsLib_nextHit( hObs, &hitCtx, &hitLoc ) );    CU_ASSERT_EQUAL( hitCtx, &context );    CU_ASSERT_EQUAL( hitLoc, buffer2 + sizeof( buffer2 ) - 6 );    CU_ASSERT_FALSE( obsLib_nextHit( hObs, &hitCtx, &hitLoc ) );    // 0 pattern found    CU_ASSERT_TRUE_FATAL( obsLib_setTargetBuffer( hObs, buffer3, sizeof( buffer3 ) ) );    CU_ASSERT_FALSE( obsLib_nextHit( hObs, &hitCtx, &hitLoc ) );    // 2 pattern found end and middle of buffer    CU_ASSERT_TRUE_FATAL( obsLib_setTargetBuffer( hObs, buffer4, sizeof( buffer4 ) ) );    CU_ASSERT_TRUE( obsLib_nextHit( hObs, &hitCtx, &hitLoc ) );    CU_ASSERT_EQUAL( hitCtx, &context );    CU_ASSERT_EQUAL( hitLoc, buffer4 + sizeof( buffer4 ) - 10 );    CU_ASSERT_TRUE( obsLib_nextHit( hObs, &hitCtx, &hitLoc ) );    CU_ASSERT_EQUAL( hitCtx, &context );    CU_ASSERT_EQUAL( hitLoc, buffer4 + sizeof( buffer4 ) - 4 );    CU_ASSERT_FALSE( obsLib_nextHit( hObs, &hitCtx, &hitLoc ) );    obsLib_free( hObs );}
开发者ID:certego,项目名称:limacharlie,代码行数:48,


示例19: proxy_transport_change_with_wrong_port_givin_up

static void proxy_transport_change_with_wrong_port_givin_up() {	LinphoneCoreManager* lcm = create_lcm();	stats* counters = &lcm->stat;	LinphoneProxyConfig* proxy_config;	LinphoneAuthInfo *info=linphone_auth_info_new(test_username,NULL,test_password,NULL,auth_domain,NULL); /*create authentication structure from identity*/	char route[256];	LCSipTransports transport= {LC_SIP_TRANSPORT_RANDOM,LC_SIP_TRANSPORT_RANDOM,LC_SIP_TRANSPORT_RANDOM,LC_SIP_TRANSPORT_RANDOM};	sprintf(route,"sip:%s",test_route);	linphone_core_add_auth_info(lcm->lc,info); /*add authentication info to LinphoneCore*/	register_with_refresh_base_3(lcm->lc, FALSE, auth_domain, "sip2.linphone.org:5987", 0,transport,LinphoneRegistrationProgress);	linphone_core_get_default_proxy(lcm->lc,&proxy_config);	linphone_proxy_config_edit(proxy_config);	CU_ASSERT_FALSE(wait_for_until(lcm->lc,lcm->lc,&counters->number_of_LinphoneRegistrationCleared,1,3000));	linphone_proxy_config_enableregister(proxy_config,FALSE);	linphone_proxy_config_done(proxy_config);	CU_ASSERT(wait_for(lcm->lc,lcm->lc,&counters->number_of_LinphoneRegistrationCleared,1));	CU_ASSERT_EQUAL(counters->number_of_LinphoneRegistrationOk,0);	CU_ASSERT_EQUAL(counters->number_of_LinphoneRegistrationProgress,1);	CU_ASSERT_EQUAL(counters->number_of_LinphoneRegistrationFailed,0);	linphone_core_manager_destroy(lcm);}
开发者ID:xiaolds,项目名称:VideoCallVoIP,代码行数:28,


示例20: test_string_function_registry

void test_string_function_registry(){  function_registry* fr = string_function_registry();  char* tester = "hello";  /* start the tests */  printf("Test string_function_registry: ");  CU_ASSERT_TRUE(!strcmp(fr->name, "string"));  /* test the copy function */  char* cpy = (char*)fr->copy(tester);  CU_ASSERT_TRUE(!strcmp(cpy, tester));  /* test to be sure that it is actually a copy */  tester = "world";  CU_ASSERT_FALSE(!strcmp(cpy, tester));  /* free memory */  fr->destroy(cpy);  free(fr);  /* finish the test */  test_failure();  printf("/n");}
开发者ID:Triangled,项目名称:fossology,代码行数:25,


示例21: testItemToHeadgear

static void testItemToHeadgear (void){	inventory_t inv;	const objDef_t *od;	const invDef_t *container;	item_t item;	ResetInventoryList();	OBJZERO(inv);	od = INVSH_GetItemByIDSilent("irgoggles");	CU_ASSERT_PTR_NOT_NULL_FATAL(od);	container = INVSH_GetInventoryDefinitionByID("headgear");	CU_ASSERT_PTR_NOT_NULL_FATAL(container);	item.t = od;	item.m = NULL;	item.a = 0;	CU_ASSERT_FALSE(INVSH_ExistsInInventory(&inv, container, &item));	CU_ASSERT_PTR_NOT_NULL(i.AddToInventory(&i, &inv, &item, container, NONE, NONE, 1));	CU_ASSERT_TRUE(INVSH_ExistsInInventory(&inv, container, &item));	CU_ASSERT_PTR_NULL(i.AddToInventory(&i, &inv, &item, container, NONE, NONE, 1));}
开发者ID:MyWifeRules,项目名称:ufoai-1,代码行数:29,


示例22: test_llist_rm_first

void test_llist_rm_first(void) {  Llist list = NULL;  Node arc1;  Node arc2;  node_alloc(&arc1);  node_alloc(&arc2);  arc1.score = 150;  arc2.score = 151;  /* See if trying to suppress an element of an empty list works */  CU_ASSERT_TRUE(llist_rm_first(&list));  /* Add something in order to suppress it later */  llist_add(arc1, &list);  llist_add(arc2, &list);  /* Suppress the first element of the list */  llist_rm_first(&list);  /* See if the remaining list have arc2 has its first element */  CU_ASSERT_TRUE(node_is_equal(list->value, arc1));  /* See deleting an element returns 0 */  CU_ASSERT_FALSE(llist_rm_first(&list));  /* Confirm the list is now a NULL pointer */  CU_ASSERT_PTR_NULL(list);  node_free(&arc1);  node_free(&arc2);}
开发者ID:C40417,项目名称:chessaint,代码行数:31,


示例23: test_hashMap_remove

void test_hashMap_remove(void) {    char * key = "key";    char * value = "value";    char * key2 = NULL;    char * value2 = "value2";    char * removeKey;    hashMap_clear(map, false, false);    // Add one entry    hashMap_put(map, key, value);    // Add second entry with null key    hashMap_put(map, key2, value2);    // Remove unexisting entry for map    removeKey = "unexisting";    hashMap_remove(map, removeKey);    CU_ASSERT_EQUAL(map->size, 2);    CU_ASSERT_FALSE(hashMap_isEmpty(map));    hashMap_remove(map, key);    CU_ASSERT_EQUAL(map->size, 1);    hashMap_remove(map, key2);    CU_ASSERT_EQUAL(map->size, 0);    CU_ASSERT_TRUE(hashMap_isEmpty(map));    // Remove unexisting entry for empty map    removeKey = "unexisting";    hashMap_remove(map, removeKey);    CU_ASSERT_EQUAL(map->size, 0);    CU_ASSERT_TRUE(hashMap_isEmpty(map));}
开发者ID:ecros,项目名称:celix,代码行数:34,


示例24: test_cimunit_init_event_with_thread

static void test_cimunit_init_event_with_thread(void){    char event_name[] = "test";    char thread_name[] = "thread";    cimunit_event_t event;    cimunit_event_init_with_thread(&event, event_name, thread_name);      /// - Verify the event name is initialized    CU_ASSERT_PTR_NOT_NULL_FATAL(event.event_name);    CU_ASSERT_STRING_EQUAL(event.event_name, event_name);    /// - Verify the thread name is initialized    CU_ASSERT_PTR_NOT_NULL_FATAL(event.thread_name);    CU_ASSERT_STRING_EQUAL(event.thread_name, thread_name);        CU_ASSERT_FALSE(event.is_action);      /// - No cross platform tests for mutex configuration      /// - Verify the dependent events list is empty    CU_ASSERT_PTR_NULL(event.action_events);      cimunit_event_destroy(&event);}
开发者ID:dframpto,项目名称:cimunit,代码行数:25,


示例25: io_recv_error_without_active_register

static void io_recv_error_without_active_register(){	LinphoneCoreManager *mgr;	LinphoneCore* lc;	int register_ok;	stats* counters ;	int number_of_udp_proxy=0;	MSList* proxys;	mgr=configure_lcm();	lc=mgr->lc;	counters = get_stats(lc);		register_ok=counters->number_of_LinphoneRegistrationOk;	number_of_udp_proxy=get_number_of_udp_proxy(lc);	for (proxys=ms_list_copy(linphone_core_get_proxy_config_list(lc));proxys!=NULL;proxys=proxys->next) {		LinphoneProxyConfig* proxy_cfg=(LinphoneProxyConfig*)proxys->data;		linphone_proxy_config_edit(proxy_cfg);		linphone_proxy_config_enable_register(proxy_cfg,FALSE);		linphone_proxy_config_done(proxy_cfg);	}	ms_list_free(proxys);	CU_ASSERT_TRUE(wait_for(lc,lc,&counters->number_of_LinphoneRegistrationCleared,register_ok /*because 1 udp*/));	sal_set_recv_error(lc->sal, 0);	/*nothing should happen because no active registration*/	CU_ASSERT_FALSE(wait_for(lc,lc,&counters->number_of_LinphoneRegistrationProgress,2*(register_ok-number_of_udp_proxy) /*because 1 udp*/));	CU_ASSERT_EQUAL(counters->number_of_LinphoneRegistrationFailed,0)	sal_set_recv_error(lc->sal, 1); /*reset*/	linphone_core_manager_destroy(mgr);}
开发者ID:rogerhzh,项目名称:linphone_linux_XIA,代码行数:35,


示例26: rer_test_flags

void rer_test_flags(){	{		RER rer=rer_create("foo", "bar", "");		CU_ASSERT_PTR_NOT_NULL_FATAL(rer);		int flags = rer_getflags(rer);		CU_ASSERT_EQUAL(flags, 0);		flags = rer_setflag(rer, RER_F_GLOBAL);		CU_ASSERT_EQUAL(flags, RER_F_GLOBAL);		flags = rer_setflag(rer, RER_F_DRY_RUN);		CU_ASSERT_EQUAL(flags, RER_F_GLOBAL | RER_F_DRY_RUN);		flags = rer_getflags(rer);		CU_ASSERT_EQUAL(flags, RER_F_GLOBAL | RER_F_DRY_RUN);		flags = rer_clrflag(rer, RER_F_GLOBAL);		CU_ASSERT_EQUAL(flags, RER_F_DRY_RUN);		int ret = rer_chkflag(rer, RER_F_DRY_RUN);		CU_ASSERT_TRUE(ret);		ret = rer_chkflag(rer, RER_F_GLOBAL);		CU_ASSERT_FALSE(ret);		flags = rer_clrflag(rer, RER_F_DRY_RUN);		CU_ASSERT_EQUAL(flags, 0);		rer_destroy(rer);	}	{		RER rer=rer_create("foo", "bar", "g");		CU_ASSERT_PTR_NOT_NULL_FATAL(rer);		int flags = rer_getflags(rer);		CU_ASSERT_EQUAL(flags, RER_F_GLOBAL);		rer_destroy(rer);	}}
开发者ID:serpent7776,项目名称:rer,代码行数:31,


示例27: test_set_possible_timeslot

static void test_set_possible_timeslot(void) {    init_test_exam();    exam *test_exams[] = {exam1, exam2, exam3, exam4,                            exam5, exam6, exam7, exam8};    init_test_array_exams(8, test_exams);    preprocess(exams);    /* Timeslots for Exam 1 : same as availabilities (0 exams scheduled) */    bool *timeslots_exam1 = set_possible_timeslot(exams->data[0], exams,                                                    MAX_TIMESLOT);    for(int i = 0; i < MAX_TIMESLOT; i++)        CU_ASSERT_EQUAL(timeslots_exam1[i], exams->data[0]->availabilities[i]);    free(timeslots_exam1);    /* Schedule Exam 1 at timeslot 2 (index 1)*/    exams->data[0]->timeslot = 1;    /* Timeslots for Exam 7 : conflict with Exam 1 */    bool *timeslots_exam7 = set_possible_timeslot(exams->data[6], exams,                                                    MAX_TIMESLOT);    CU_ASSERT_EQUAL(timeslots_exam7[0], exams->data[6]->availabilities[0]);    /* Conflict */    CU_ASSERT_FALSE(timeslots_exam7[1]);    CU_ASSERT_EQUAL(timeslots_exam7[2], exams->data[6]->availabilities[2]);    CU_ASSERT_EQUAL(timeslots_exam7[3], exams->data[6]->availabilities[3]);    CU_ASSERT_EQUAL(timeslots_exam7[4], exams->data[6]->availabilities[4]);    free(timeslots_exam7);    clean_array_exams();}
开发者ID:Kent1,项目名称:Horaires,代码行数:26,


示例28: test_fo_tableExists

/*** @brief fo_tableExists() tests:*   - Check for an existing table*   - Check for table that does not exist*   - Check for a non table entities (sequence, constraint, ...)* @return void*/void test_fo_tableExists(){  PGconn* pgConn;  int nonexistant_table;  int existing_table;  char* DBConfFile = dbConf;  char* ErrorBuf;  pgConn = fo_dbconnect(DBConfFile, &ErrorBuf);  CU_ASSERT_PTR_NOT_NULL(pgConn);  nonexistant_table = fo_tableExists(pgConn, "nonexistanttable");  CU_ASSERT_FALSE(nonexistant_table);  PGresult* result = PQexec(pgConn, "CREATE table exists()");  CU_ASSERT_PTR_NOT_NULL_FATAL(result);  CU_ASSERT_FALSE_FATAL(fo_checkPQcommand(pgConn, result, "create", __FILE__, __LINE__));  existing_table = fo_tableExists(pgConn, "exists");  CU_ASSERT_TRUE(existing_table);  PQfinish(pgConn);  return;}
开发者ID:7hibault,项目名称:fossology,代码行数:32,



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


C++ CU_ASSERT_FATAL函数代码示例
C++ CU_ASSERT_EQUAL_FATAL函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。