本文整理汇总了C++中POINTERS_EQUAL函数的典型用法代码示例。如果您正苦于以下问题:C++ POINTERS_EQUAL函数的具体用法?C++ POINTERS_EQUAL怎么用?C++ POINTERS_EQUAL使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了POINTERS_EQUAL函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
示例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);
}
示例3: TEST
TEST(TestMemoryAllocatorTest, SetCurrentMallocAllocator)
{
allocator = new TestMemoryAllocator("malloc_allocator");
setCurrentMallocAllocator(allocator);
POINTERS_EQUAL(allocator, getCurrentMallocAllocator());
setCurrentMallocAllocatorToDefault();
POINTERS_EQUAL(defaultMallocAllocator(), getCurrentMallocAllocator());
}
示例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));
}
示例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);
};
示例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"));
}
示例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 );
}
示例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;
}
示例9: TEST
TEST(MockNamedValueHandlerRepository, installCopier)
{
TypeForTestingExpectedFunctionCallCopier copier;
MockNamedValueComparatorsAndCopiersRepository repository;
repository.installCopier("typeName", copier);
POINTERS_EQUAL(&copier, repository.getCopierForType("typeName"));
}
示例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);
}
示例11: TEST
TEST(MemoryLeakWarningLocalDetectorTest, localDetectorIsGlobalDetector)
{
MemoryLeakDetector* globalDetector = MemoryLeakWarningPlugin::getGlobalDetector();
MemoryLeakWarningPlugin memoryLeakWarningPlugin("TestMemoryLeakWarningPlugin", NULL);
MemoryLeakDetector* localDetector = memoryLeakWarningPlugin.getMemoryLeakDetector();
POINTERS_EQUAL(globalDetector, localDetector);
}
示例12: TEST
TEST(SimpleString, copyInBufferWithEmptyBuffer)
{
SimpleString str("Hello World");
char* buffer= NULL;
str.copyToBuffer(buffer, 0);
POINTERS_EQUAL(NULL, buffer);
}
示例13: TEST
/* START: nullInterfaceTest */
TEST(LightDriver, NullInterfaceDoesNotCrash)
{
LightDriver_SetInterface(NULL);
LightDriver_TurnOn(&testDriver);
LightDriver_TurnOff(&testDriver);
LightDriver_Destroy(&testDriver);
POINTERS_EQUAL(NONSENSE_POINTER, savedDriver);
}
示例14: TEST
TEST(CallStackTestGroup, GetNameBigLevel)
{
CallStack TestCallStack;
TestSuiteUnwind5(TestCallStack);
POINTERS_EQUAL(NULL, TestCallStack.GetName(300000));
};
示例15: validateNullTokenPointers
void validateNullTokenPointers()
{
size_t i;
for (i = 0 ; i < ARRAY_SIZE(m_token.tokenPointers) ; i++)
{
POINTERS_EQUAL( NULL, m_token.tokenPointers[i] );
}
}