Changeset 11071 for code/trunk/test/util/output
- Timestamp:
- Jan 17, 2016, 10:29:21 PM (9 years ago)
- Location:
- code/trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
code/trunk
- Property svn:mergeinfo changed
-
code/trunk/test/util/output/BaseWriterTest.cc
r9545 r11071 30 30 MOCK_METHOD2(printLine, void(const std::string&, OutputLevel)); 31 31 32 virtual void output(OutputLevel level, const OutputContextContainer& context, const std::vector<std::string>& lines) 32 virtual void output(OutputLevel level, const OutputContextContainer& context, const std::vector<std::string>& lines) override 33 33 { this->BaseWriter::output(level, context, lines); } 34 34 }; -
code/trunk/test/util/output/ConsoleWriterTest.cc
r10712 r11071 3 3 #include "util/output/ConsoleWriter.h" 4 4 #include "util/output/OutputManager.h" 5 #include "util/SharedPtr.h"6 5 7 6 namespace orxonox … … 13 12 { 14 13 public: 15 virtual void SetUp() 14 virtual void SetUp() override 16 15 { 17 16 // reset output manager 18 OutputManager::Testing::getInstancePointer() = new OutputManager();17 OutputManager::Testing::getInstancePointer().reset(new OutputManager()); 19 18 } 20 19 21 virtual void TearDown() 20 virtual void TearDown() override 22 21 { 23 22 } … … 27 26 TEST_F(ConsoleWriterTest, Disable) 28 27 { 29 std::ostream stream( NULL);28 std::ostream stream(nullptr); 30 29 EXPECT_EQ(0U, OutputManager::getInstance().getListeners().size()); 31 30 ConsoleWriter writer(stream); … … 37 36 TEST_F(ConsoleWriterTest, Enable) 38 37 { 39 std::ostream stream( NULL);38 std::ostream stream(nullptr); 40 39 ConsoleWriter writer(stream); 41 40 writer.disable(); -
code/trunk/test/util/output/LogWriterTest.cc
r10624 r11071 4 4 #include "util/Convert.h" 5 5 #include "util/output/OutputManager.h" 6 #include "util/SharedPtr.h"7 6 8 7 namespace orxonox … … 13 12 { 14 13 public: 15 virtual void printLine(const std::string& line, OutputLevel level) 14 virtual void printLine(const std::string& line, OutputLevel level) override 16 15 { this->LogWriter::printLine(line, level); } 17 16 }; … … 21 20 { 22 21 public: 23 virtual void SetUp() 22 virtual void SetUp() override 24 23 { 25 24 // reset output manager 26 OutputManager::Testing::getInstancePointer() = new OutputManager();25 OutputManager::Testing::getInstancePointer().reset(new OutputManager()); 27 26 } 28 27 29 virtual void TearDown() 28 virtual void TearDown() override 30 29 { 31 30 } … … 138 137 std::string line = getLineWhichContains(path, "myothertestoutput"); 139 138 EXPECT_FALSE(line.empty()); 139 ASSERT_TRUE(line.length() > 12); 140 140 141 EXPECT_TRUE(isdigit(line[0])); 141 142 EXPECT_TRUE(isdigit(line[1])); … … 146 147 EXPECT_TRUE(isdigit(line[6])); 147 148 EXPECT_TRUE(isdigit(line[7])); 148 EXPECT_EQ(' ', line[8]); 149 EXPECT_EQ(':', line[8]); 150 EXPECT_TRUE(isdigit(line[9])); 151 EXPECT_TRUE(isdigit(line[10])); 152 EXPECT_TRUE(isdigit(line[11])); 153 EXPECT_EQ(' ', line[12]); 149 154 } 150 155 -
code/trunk/test/util/output/MemoryWriterTest.cc
r10624 r11071 4 4 #include "util/output/MemoryWriter.h" 5 5 #include "util/output/OutputManager.h" 6 #include "util/SharedPtr.h"7 6 8 7 namespace orxonox … … 20 19 { 21 20 public: 22 virtual void SetUp() 21 virtual void SetUp() override 23 22 { 24 23 // reset output manager 25 OutputManager::Testing::getInstancePointer() = new OutputManager();24 OutputManager::Testing::getInstancePointer().reset(new OutputManager()); 26 25 } 27 26 28 virtual void TearDown() 27 virtual void TearDown() override 29 28 { 30 29 } -
code/trunk/test/util/output/OutputListenerTest.cc
r9545 r11071 3 3 #include "util/output/OutputListener.h" 4 4 #include "util/output/OutputManager.h" 5 #include "util/SharedPtr.h"6 5 7 6 namespace orxonox … … 342 341 { 343 342 this->manager_ = new MockOutputManager(); 344 OutputManager::Testing::getInstancePointer() = this->manager_;343 OutputManager::Testing::getInstancePointer().reset(this->manager_); 345 344 } 346 345 347 346 virtual void TearDown() 348 347 { 349 OutputManager::Testing::getInstancePointer() = new OutputManager();348 OutputManager::Testing::getInstancePointer().reset(new OutputManager()); 350 349 } 351 350 -
code/trunk/test/util/output/OutputManagerTest.cc
r10624 r11071 54 54 TEST(OutputManagerTest, GetInstanceDoesNotCreateDefaultListeners) 55 55 { 56 EXPECT_TRUE( NULL== OutputManager::getInstance().getMemoryWriter());57 EXPECT_TRUE( NULL== OutputManager::getInstance().getConsoleWriter());58 EXPECT_TRUE( NULL== OutputManager::getInstance().getLogWriter());56 EXPECT_TRUE(nullptr == OutputManager::getInstance().getMemoryWriter()); 57 EXPECT_TRUE(nullptr == OutputManager::getInstance().getConsoleWriter()); 58 EXPECT_TRUE(nullptr == OutputManager::getInstance().getLogWriter()); 59 59 } 60 60 … … 62 62 TEST(OutputManagerTest, GetInstanceAndCreateListenersCreatesDefaultListeners) 63 63 { 64 EXPECT_TRUE( NULL!= OutputManager::getInstanceAndCreateListeners().getMemoryWriter());65 EXPECT_TRUE( NULL!= OutputManager::getInstanceAndCreateListeners().getConsoleWriter());66 EXPECT_TRUE( NULL!= OutputManager::getInstanceAndCreateListeners().getLogWriter());64 EXPECT_TRUE(nullptr != OutputManager::getInstanceAndCreateListeners().getMemoryWriter()); 65 EXPECT_TRUE(nullptr != OutputManager::getInstanceAndCreateListeners().getConsoleWriter()); 66 EXPECT_TRUE(nullptr != OutputManager::getInstanceAndCreateListeners().getLogWriter()); 67 67 } 68 68 -
code/trunk/test/util/output/OutputStreamTest.cc
r9547 r11071 8 8 #include "util/output/OutputManager.h" 9 9 #include "util/output/MemoryWriter.h" 10 #include "util/SharedPtr.h"11 10 12 11 namespace orxonox … … 88 87 { 89 88 this->manager_ = new MockOutputManager(); 90 OutputManager::Testing::getInstancePointer() = this->manager_;89 OutputManager::Testing::getInstancePointer().reset(this->manager_); 91 90 } 92 91 93 92 virtual void TearDown() 94 93 { 95 OutputManager::Testing::getInstancePointer() = new OutputManager();94 OutputManager::Testing::getInstancePointer().reset(new OutputManager()); 96 95 } 97 96
Note: See TracChangeset
for help on using the changeset viewer.