Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Mar 2, 2013, 7:15:37 PM (12 years ago)
Author:
landauf
Message:

added more tests

Location:
code/branches/testing/src/libraries/util/output
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • code/branches/testing/src/libraries/util/output/OutputManager.cc

    r9530 r9533  
    3939#include "util/Output.h"
    4040#include "util/StringUtils.h"
     41#include "util/SharedPtr.h"
    4142
    4243namespace orxonox
     
    6162    }
    6263
     64    /*static*/ SharedPtr<OutputManager>& OutputManager::Testing::getInstancePointer()
     65    {
     66        static SharedPtr<OutputManager> instance(new OutputManager());
     67        return instance;
     68    }
     69
    6370    /**
    6471        @brief Returns the only existing instance of the OutputManager singleton.
     
    6673    /*static*/ OutputManager& OutputManager::getInstance()
    6774    {
    68         static OutputManager instance;
    69         return instance;
     75        return *OutputManager::Testing::getInstancePointer();
    7076    }
    7177
  • code/branches/testing/src/libraries/util/output/OutputManager.h

    r9530 r9533  
    6565    {
    6666        public:
     67            OutputManager();
     68            OutputManager(const OutputManager&);
     69            virtual ~OutputManager();
     70
    6771            static OutputManager& getInstance();
    6872            static OutputManager& getInstanceAndCreateListeners();
     
    7074            void pushMessage(OutputLevel level, const OutputContextContainer& context, const std::string& message);
    7175
    72             void registerListener(OutputListener* listener);
    73             void unregisterListener(OutputListener* listener);
     76            virtual void registerListener(OutputListener* listener);
     77            virtual void unregisterListener(OutputListener* listener);
    7478
    7579            virtual void updatedLevelMask(const OutputListener* listener)
     
    103107
    104108        private:
    105             OutputManager();
    106             OutputManager(const OutputManager&);
    107             ~OutputManager();
    108 
    109109            void updateMasks();
    110110            void updateCombinedLevelMask();
     
    121121            std::map<std::string, OutputContextContainer> contextContainers_;   ///< Contains all contexts including sub-contexts and their containers
    122122            OutputContextSubID subcontextCounter_;                              ///< Counts the number of sub-contexts (and generates their IDs)
     123
     124        public:
     125            struct _UtilExport Testing
     126            {
     127                static SharedPtr<OutputManager>& getInstancePointer();
     128            };
    123129    };
    124130}
Note: See TracChangeset for help on using the changeset viewer.