Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 12, 2013, 10:05:25 PM (12 years ago)
Author:
landauf
Message:

return pointers instead of references because they could be null

Location:
code/branches/testing/test/util/output
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • code/branches/testing/test/util/output/ConsoleWriterTest.cc

    r9545 r9547  
    6666    {
    6767        OutputManager::getInstanceAndCreateListeners();
    68         EXPECT_EQ(std::cout, OutputManager::getInstance().getConsoleWriter().getOutputStream());
     68        EXPECT_EQ(std::cout, OutputManager::getInstance().getConsoleWriter()->getOutputStream());
    6969    }
    7070}
  • code/branches/testing/test/util/output/OutputManagerTest.cc

    r9545 r9547  
    5454    TEST(OutputManagerTest, GetInstanceDoesNotCreateDefaultListeners)
    5555    {
    56         EXPECT_TRUE(NULL == &OutputManager::getInstance().getMemoryWriter());
    57         EXPECT_TRUE(NULL == &OutputManager::getInstance().getConsoleWriter());
    58         EXPECT_TRUE(NULL == &OutputManager::getInstance().getLogWriter());
     56        EXPECT_TRUE(NULL == OutputManager::getInstance().getMemoryWriter());
     57        EXPECT_TRUE(NULL == OutputManager::getInstance().getConsoleWriter());
     58        EXPECT_TRUE(NULL == OutputManager::getInstance().getLogWriter());
    5959    }
    6060
     
    6262    TEST(OutputManagerTest, GetInstanceAndCreateListenersCreatesDefaultListeners)
    6363    {
    64         EXPECT_TRUE(NULL != &OutputManager::getInstanceAndCreateListeners().getMemoryWriter());
    65         EXPECT_TRUE(NULL != &OutputManager::getInstanceAndCreateListeners().getConsoleWriter());
    66         EXPECT_TRUE(NULL != &OutputManager::getInstanceAndCreateListeners().getLogWriter());
     64        EXPECT_TRUE(NULL != OutputManager::getInstanceAndCreateListeners().getMemoryWriter());
     65        EXPECT_TRUE(NULL != OutputManager::getInstanceAndCreateListeners().getConsoleWriter());
     66        EXPECT_TRUE(NULL != OutputManager::getInstanceAndCreateListeners().getLogWriter());
    6767    }
    6868
     
    7070    TEST(OutputManagerTest, GetInstanceAndCreateListenersDoesNotCreateDefaultListenersTwice)
    7171    {
    72         MemoryWriter* memoryWriter = &OutputManager::getInstanceAndCreateListeners().getMemoryWriter();
    73         ConsoleWriter* consoleWriter = &OutputManager::getInstanceAndCreateListeners().getConsoleWriter();
    74         LogWriter* logWriter = &OutputManager::getInstanceAndCreateListeners().getLogWriter();
    75 
    76         EXPECT_TRUE(memoryWriter == &OutputManager::getInstanceAndCreateListeners().getMemoryWriter());
    77         EXPECT_TRUE(consoleWriter == &OutputManager::getInstanceAndCreateListeners().getConsoleWriter());
    78         EXPECT_TRUE(logWriter == &OutputManager::getInstanceAndCreateListeners().getLogWriter());
     72        MemoryWriter* memoryWriter = OutputManager::getInstanceAndCreateListeners().getMemoryWriter();
     73        ConsoleWriter* consoleWriter = OutputManager::getInstanceAndCreateListeners().getConsoleWriter();
     74        LogWriter* logWriter = OutputManager::getInstanceAndCreateListeners().getLogWriter();
     75
     76        EXPECT_TRUE(memoryWriter == OutputManager::getInstanceAndCreateListeners().getMemoryWriter());
     77        EXPECT_TRUE(consoleWriter == OutputManager::getInstanceAndCreateListeners().getConsoleWriter());
     78        EXPECT_TRUE(logWriter == OutputManager::getInstanceAndCreateListeners().getLogWriter());
    7979    }
    8080
  • code/branches/testing/test/util/output/OutputStreamTest.cc

    r9545 r9547  
    6464    {
    6565        // disable MemoryWriter because otherwise we would always accept all output
    66         OutputManager::getInstance().getMemoryWriter().disable();
     66        OutputManager::getInstance().getMemoryWriter()->disable();
    6767
    6868        {
     
    140140    {
    141141        // disable MemoryWriter because otherwise we would always accept all output
    142         OutputManager::getInstanceAndCreateListeners().getMemoryWriter().disable();
     142        OutputManager::getInstanceAndCreateListeners().getMemoryWriter()->disable();
    143143
    144144        OutputStream stream;
Note: See TracChangeset for help on using the changeset viewer.