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


C++ POINTERS_EQUAL函数代码示例

本文整理汇总了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);
}
开发者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


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