Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Apr 26, 2015, 3:51:49 PM (9 years ago)
Author:
landauf
Message:

fixed tests in util_test which failed when a different order of execution was used

File:
1 edited

Legend:

Unmodified
Added
Removed
  • code/branches/core7/test/util/output/LogWriterTest.cc

    r9549 r10402  
    33#include "util/output/LogWriter.h"
    44#include "util/Convert.h"
     5#include "util/output/OutputManager.h"
     6#include "util/SharedPtr.h"
    57
    68namespace orxonox
     
    1416                    { this->LogWriter::printLine(line, level); }
    1517        };
     18
     19        // Fixture
     20        class LogWriterTest : public ::testing::Test
     21        {
     22            public:
     23                virtual void SetUp()
     24                {
     25                    // reset output manager
     26                    OutputManager::Testing::getInstancePointer() = new OutputManager();
     27                }
     28
     29                virtual void TearDown()
     30                {
     31                }
     32        };
    1633    }
    1734
    1835    // test constructor opens file
    19     TEST(LogWriterTest, ConstructorOpensFile)
     36    TEST_F(LogWriterTest, ConstructorOpensFile)
    2037    {
    2138        LogWriter logWriter;
     
    6481    }
    6582
    66     TEST(LogWriterTest, SetLogDirectoryOpensNewFile)
     83    TEST_F(LogWriterTest, SetLogDirectoryOpensNewFile)
    6784    {
    6885        std::string path = "./orxonox.log";
     
    83100
    84101    // prints output to logfile
    85     TEST(LogWriterTest, PrintsOutputToLogfile)
     102    TEST_F(LogWriterTest, PrintsOutputToLogfile)
    86103    {
    87104        std::string path;
     
    103120
    104121    // prints time to logfile
    105     TEST(LogWriterTest, PrintsTimestampToLogfile)
     122    TEST_F(LogWriterTest, PrintsTimestampToLogfile)
    106123    {
    107124        std::string path;
     
    152169    }
    153170
    154     TEST(LogWriterTest, ArchivesOldLogFile)
     171    TEST_F(LogWriterTest, ArchivesOldLogFile)
    155172    {
    156173        deleteAllLogFiles();
     
    196213    }
    197214
    198     TEST(LogWriterTest, ArchivesNineLogFiles)
     215    TEST_F(LogWriterTest, ArchivesNineLogFiles)
    199216    {
    200217        deleteAllLogFiles();
Note: See TracChangeset for help on using the changeset viewer.