本文整理汇总了C++中POINTERS_EQUAL函数的典型用法代码示例。如果您正苦于以下问题:C++ POINTERS_EQUAL函数的具体用法?C++ POINTERS_EQUAL怎么用?C++ POINTERS_EQUAL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了POINTERS_EQUAL函数的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: TEST
TEST(String, SplitShell)
{
char **argv;
int argc;
POINTERS_EQUAL(NULL, string_split_shell (NULL, NULL));
/* test with an empty string */
argc = -1;
argv = string_split_shell ("", &argc);
LONGS_EQUAL(0, argc);
CHECK(argv);
POINTERS_EQUAL(NULL, argv[0]);
string_free_split (argv);
/* test with a real string (command + arguments) */
argv = string_split_shell ("/path/to/bin arg1 \"arg2 here\" 'arg3 here'",
&argc);
LONGS_EQUAL(4, argc);
CHECK(argv);
STRCMP_EQUAL("/path/to/bin", argv[0]);
STRCMP_EQUAL("arg1", argv[1]);
STRCMP_EQUAL("arg2 here", argv[2]);
STRCMP_EQUAL("arg3 here", argv[3]);
POINTERS_EQUAL(NULL, argv[4]);
string_free_split (argv);
/* free split with NULL */
string_free_split_shared (NULL);
}
开发者ID:mimi1vx,项目名称:weechat,代码行数:30,代码来源:test-string.cpp
示例2: TEST
TEST(RandomClass, CreateXOrShiftObject)
{
Random* pRandom;
uint32_t nResult = 0;
pRandom = random_new(setXorShiftSeed, nextXorShiftUInt32);
POINTERS_EQUAL(setXorShiftSeed, pRandom->setSeed);
POINTERS_EQUAL(nextXorShiftUInt32, pRandom->getNextUInt32);
}
开发者ID:abencz,项目名称:OpENer,代码行数:8,代码来源:randomTests.cpp
示例3: TEST
TEST(TestMemoryAllocatorTest, SetCurrentMallocAllocator)
{
allocator = new TestMemoryAllocator("malloc_allocator");
setCurrentMallocAllocator(allocator);
POINTERS_EQUAL(allocator, getCurrentMallocAllocator());
setCurrentMallocAllocatorToDefault();
POINTERS_EQUAL(defaultMallocAllocator(), getCurrentMallocAllocator());
}
开发者ID:WilcoBT,项目名称:cpputest,代码行数:8,代码来源:TestMemoryAllocatorTest.cpp
示例4: TEST
TEST(MockSupport_c, whenReturnValueIsGivenReturnConstPointerValueOrDefaultShouldIgnoreTheDefault)
{
const void* defaultValue = (void*) 10;
const void* expectedValue = (void*) 27;
mock_c()->expectOneCall("foo")->andReturnConstPointerValue(expectedValue);
POINTERS_EQUAL(expectedValue, mock_c()->actualCall("foo")->returnConstPointerValueOrDefault(defaultValue));
POINTERS_EQUAL(expectedValue, mock_c()->returnConstPointerValueOrDefault(defaultValue));
}
开发者ID:DynonAvionics,项目名称:cpputest,代码行数:8,代码来源:MockSupport_cTest.cpp
示例5: TEST
TEST(HttpdSingletonTestGroup, Instantiate)
{
HttpdSingleton *Httpd = HttpdSingleton::Instantiate();
CHECK(Httpd != NULL);
POINTERS_EQUAL(Httpd, HttpdSingleton::Instantiate());
POINTERS_EQUAL(Httpd, HttpdSingleton::Instantiate());
HttpdSingleton::Instantiate(false);
};
开发者ID:edkit,项目名称:edkit-agent,代码行数:9,代码来源:HttpdSingleton.cpp
示例6: TEST
TEST(MockNamedValueComparatorRepository, installMultipleComparator)
{
TypeForTestingExpectedFunctionCallComparator comparator1, comparator2, comparator3;
MockNamedValueComparatorRepository repository;
repository.installComparator("type1", comparator1);
repository.installComparator("type2", comparator2);
repository.installComparator("type3", comparator3);
POINTERS_EQUAL(&comparator3, repository.getComparatorForType("type3"));
POINTERS_EQUAL(&comparator2, repository.getComparatorForType("type2"));
POINTERS_EQUAL(&comparator1, repository.getComparatorForType("type1"));
}
开发者ID:conniechen19870216,项目名称:kavonUT,代码行数:11,代码来源:MockExpectedCallTest.cpp
示例7: TEST
TEST(CircularBuffer, shouldHaveGetAndIncrementFunction) {
uint16_t *buf = (uint16_t*) malloc(sizeof(uint16_t)*4);
CircularBuffer cb = CircularBuffer_New(buf, 4, 2);
POINTERS_EQUAL( CircularBuffer_GetNextBuffer( cb ), buf );
POINTERS_EQUAL( CircularBuffer_GetNextBuffer( cb ), buf+2 );
free( buf );
free( cb );
}
开发者ID:havardh,项目名称:bitless,代码行数:11,代码来源:CircularBufferTest.cpp
示例8: functionThatReturnsAValue
static int functionThatReturnsAValue()
{
CHECK(0 == 0);
CHECK_TEXT(0 == 0, "Shouldn't fail");
CHECK_TRUE(0 == 0);
CHECK_TRUE_TEXT(0 == 0, "Shouldn't fail");
CHECK_FALSE(0 != 0);
CHECK_FALSE_TEXT(0 != 0, "Shouldn't fail");
LONGS_EQUAL(1,1);
LONGS_EQUAL_TEXT(1, 1, "Shouldn't fail");
BYTES_EQUAL(0xab,0xab);
BYTES_EQUAL_TEXT(0xab, 0xab, "Shouldn't fail");
CHECK_EQUAL(100,100);
CHECK_EQUAL_TEXT(100, 100, "Shouldn't fail");
STRCMP_EQUAL("THIS", "THIS");
STRCMP_EQUAL_TEXT("THIS", "THIS", "Shouldn't fail");
DOUBLES_EQUAL(1.0, 1.0, .01);
DOUBLES_EQUAL_TEXT(1.0, 1.0, .01, "Shouldn't fail");
POINTERS_EQUAL(0, 0);
POINTERS_EQUAL_TEXT(0, 0, "Shouldn't fail");
MEMCMP_EQUAL("THIS", "THIS", 5);
MEMCMP_EQUAL_TEXT("THIS", "THIS", 5, "Shouldn't fail");
BITS_EQUAL(0x01, (unsigned char )0x01, 0xFF);
BITS_EQUAL(0x0001, (unsigned short )0x0001, 0xFFFF);
BITS_EQUAL(0x00000001, (unsigned long )0x00000001, 0xFFFFFFFF);
BITS_EQUAL_TEXT(0x01, (unsigned char )0x01, 0xFF, "Shouldn't fail");
return 0;
}
开发者ID:Andne,项目名称:cpputest,代码行数:28,代码来源:TestUTestMacro.cpp
示例9: TEST
TEST(MockNamedValueHandlerRepository, installCopier)
{
TypeForTestingExpectedFunctionCallCopier copier;
MockNamedValueComparatorsAndCopiersRepository repository;
repository.installCopier("typeName", copier);
POINTERS_EQUAL(&copier, repository.getCopierForType("typeName"));
}
开发者ID:KisImre,项目名称:cpputest,代码行数:7,代码来源:MockExpectedCallTest.cpp
示例10: TEST
TEST(String, Duplicate)
{
const char *str_test = "test";
char *str;
POINTERS_EQUAL(NULL, string_strndup (NULL, 0));
str = string_strndup (str_test, 0);
CHECK(str);
CHECK(str != str_test);
STRCMP_EQUAL(str, "");
free (str);
str = string_strndup (str_test, 2);
CHECK(str);
CHECK(str != str_test);
STRCMP_EQUAL(str, "te");
free (str);
str = string_strndup (str_test, 500);
CHECK(str);
CHECK(str != str_test);
STRCMP_EQUAL(str, str_test);
free (str);
}
开发者ID:Petzku,项目名称:weechat,代码行数:25,代码来源:test-string.cpp
示例11: TEST
TEST(MemoryLeakWarningLocalDetectorTest, localDetectorIsGlobalDetector)
{
MemoryLeakDetector* globalDetector = MemoryLeakWarningPlugin::getGlobalDetector();
MemoryLeakWarningPlugin memoryLeakWarningPlugin("TestMemoryLeakWarningPlugin", NULL);
MemoryLeakDetector* localDetector = memoryLeakWarningPlugin.getMemoryLeakDetector();
POINTERS_EQUAL(globalDetector, localDetector);
}
开发者ID:KevinWMatthews,项目名称:cpputest,代码行数:7,代码来源:MemoryLeakWarningTest.cpp
示例12: TEST
TEST(SimpleString, copyInBufferWithEmptyBuffer)
{
SimpleString str("Hello World");
char* buffer= NULL;
str.copyToBuffer(buffer, 0);
POINTERS_EQUAL(NULL, buffer);
}
开发者ID:dhbw-fn-micro,项目名称:cpputest,代码行数:7,代码来源:SimpleStringTest.cpp
示例13: TEST
/* START: nullInterfaceTest */
TEST(LightDriver, NullInterfaceDoesNotCrash)
{
LightDriver_SetInterface(NULL);
LightDriver_TurnOn(&testDriver);
LightDriver_TurnOff(&testDriver);
LightDriver_Destroy(&testDriver);
POINTERS_EQUAL(NONSENSE_POINTER, savedDriver);
}
开发者ID:ykumano,项目名称:TDDforEmbeddedC,代码行数:9,代码来源:LightDriverTest.cpp
示例14: TEST
TEST(CallStackTestGroup, GetNameBigLevel)
{
CallStack TestCallStack;
TestSuiteUnwind5(TestCallStack);
POINTERS_EQUAL(NULL, TestCallStack.GetName(300000));
};
开发者ID:edkit,项目名称:edkit-agent,代码行数:8,代码来源:CallStack.cpp
示例15: validateNullTokenPointers
void validateNullTokenPointers()
{
size_t i;
for (i = 0 ; i < ARRAY_SIZE(m_token.tokenPointers) ; i++)
{
POINTERS_EQUAL( NULL, m_token.tokenPointers[i] );
}
}
开发者ID:CNCBASHER,项目名称:mri,代码行数:9,代码来源:tokenTests.cpp
示例16: TEST
TEST(Utf8, Validity)
{
char *error;
/* check 8 bits */
LONGS_EQUAL(0, utf8_has_8bits (NULL));
LONGS_EQUAL(0, utf8_has_8bits (""));
LONGS_EQUAL(0, utf8_has_8bits ("abc"));
LONGS_EQUAL(1, utf8_has_8bits ("no\xc3\xabl"));
/* check validity */
LONGS_EQUAL(1, utf8_is_valid (NULL, NULL));
LONGS_EQUAL(1, utf8_is_valid (NULL, &error));
LONGS_EQUAL(1, utf8_is_valid ("", NULL));
LONGS_EQUAL(1, utf8_is_valid ("", &error));
LONGS_EQUAL(1, utf8_is_valid ("abc", &error));
POINTERS_EQUAL(NULL, error);
LONGS_EQUAL(1, utf8_is_valid (noel_valid, &error));
POINTERS_EQUAL(NULL, error);
LONGS_EQUAL(0, utf8_is_valid (noel_invalid, &error));
POINTERS_EQUAL(noel_invalid + 2, error);
/* 2 bytes: code point must be in range U+0080-07FF */
LONGS_EQUAL(0, utf8_is_valid ("\xc0\x80", NULL)); /* U+0 */
LONGS_EQUAL(0, utf8_is_valid ("\xc1\xbf", NULL)); /* U+7F */
LONGS_EQUAL(1, utf8_is_valid ("\xc2\x80", NULL)); /* U+80 */
LONGS_EQUAL(1, utf8_is_valid ("\xdf\xbf", NULL)); /* U+7FF */
/* 3 bytes: code point must be in range: U+0800-FFFF */
LONGS_EQUAL(0, utf8_is_valid ("\xe0\x80\x80", NULL)); /* U+0 */
LONGS_EQUAL(0, utf8_is_valid ("\xe0\x9f\xbf", NULL)); /* U+7FF */
LONGS_EQUAL(0, utf8_is_valid ("\xed\xa0\x80", NULL)); /* U+D800 */
LONGS_EQUAL(0, utf8_is_valid ("\xed\xbf\xbf", NULL)); /* U+DFFF */
LONGS_EQUAL(1, utf8_is_valid ("\xe0\xa0\x80", NULL)); /* U+800 */
LONGS_EQUAL(1, utf8_is_valid ("\xed\x9f\xbf", NULL)); /* U+D7FF */
LONGS_EQUAL(1, utf8_is_valid ("\xe7\x80\x80", NULL)); /* U+E000 */
LONGS_EQUAL(1, utf8_is_valid ("\xef\xbf\xbf", NULL)); /* U+FFFF */
/* 4 bytes: code point must be in range: U+10000-1FFFFF */
LONGS_EQUAL(0, utf8_is_valid ("\xf0\x80\x80\x80", NULL)); /* U+0 */
LONGS_EQUAL(0, utf8_is_valid ("\xf0\x8f\xbf\xbf", NULL)); /* U+FFFF */
LONGS_EQUAL(1, utf8_is_valid ("\xf0\x90\x80\x80", NULL)); /* U+10000 */
LONGS_EQUAL(1, utf8_is_valid ("\xf7\xbf\xbf\xbf", NULL)); /* U+1FFFFF */
}
开发者ID:aadiarbakerli,项目名称:weechat,代码行数:44,代码来源:test-utf8.cpp
示例17: TEST
TEST(TrajectoryInitTestGroup, CanInitChunk)
{
trajectory_chunk_t chunk;
trajectory_chunk_init(&chunk, (float *)buffer, 3, 2, 100, 10);
POINTERS_EQUAL((float *)buffer, chunk.buffer);
CHECK_EQUAL(3, chunk.length);
CHECK_EQUAL(2, chunk.dimension);
CHECK_EQUAL(100, (int)chunk.start_time_us);
CHECK_EQUAL(10, (int)chunk.sampling_time_us);
}
开发者ID:SyrianSpock,项目名称:master-firmware,代码行数:10,代码来源:trajectories_test.cpp
示例18: TEST
TEST(TLVDecoder, ParseTlv1DataSuccessfully)
{
Tlv_t tlv;
// parse
CHECK(TlvParse(tlv1Data, sizeof(tlv1Data), &tlv));
// encoding tlv object in the buffer
POINTERS_EQUAL(tlv1Data, TlvPtr(&tlv));
// tag class
LONGS_EQUAL(TAG_CLASS_APP, TagTagClass(&tlv.tag));
// Primitive or constructed
CHECK(TagIsPorC(&tlv.tag));
// tag number
LONGS_EQUAL(0x10, TagTagNum(&tlv.tag));
// length
LONGS_EQUAL(0x43, TlvDataLen(&tlv));
// value
POINTERS_EQUAL(&tlv1Data[2], TlvValue(&tlv));
LONGS_EQUAL(TlvDataLen(&tlv), TlvDataCapacity(&tlv));
}
开发者ID:xiaooquanwu,项目名称:tlv-2,代码行数:19,代码来源:TlvDecoderTest.cpp
示例19: TEST
TEST(filter, create_fail_invalid_closing_brackets){
char * filter_str;
filter_pt get_filter;
//test missing closing brackets in substring
mock().expectNCalls(6, "framework_log");
filter_str = my_strdup("(&(test_attr1=attr1)(|(test_attr2=attr2)(test_attr3=at(tr3)))");
get_filter = filter_create(filter_str);
POINTERS_EQUAL(NULL, get_filter);
free(filter_str);
mock().checkExpectations();
//test missing closing brackets in value
mock().expectNCalls(5, "framework_log");
filter_str = my_strdup("(&(test_attr1=attr1)(|(test_attr2=attr2)(test_attr3>=att(r3)))");
get_filter = filter_create(filter_str);
POINTERS_EQUAL(NULL, get_filter);
free(filter_str);
mock().checkExpectations();
}
开发者ID:ErjanAltena,项目名称:celix,代码行数:19,代码来源:filter_test.cpp
注:本文中的POINTERS_EQUAL函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论