Changeset 5906 for branches/newapi
- Timestamp:
- 12/02/07 19:59:40 (12 months ago)
- Location:
- branches/newapi/licq/src/test
- Files:
-
- 1 added
- 5 modified
-
CMakeLists.inc (modified) (1 diff)
-
CMakeLists.txt (modified) (1 diff)
-
log.cpp (added)
-
log.h (modified) (3 diffs)
-
recorder.cpp (modified) (2 diffs)
-
recorder.h (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/newapi/licq/src/test/CMakeLists.inc
r5783 r5906 9 9 set_target_properties(${testname} PROPERTIES LINK_FLAGS ${CMAKE_THREAD_LIBS_INIT}) 10 10 11 target_link_libraries(${testname} ${module}) 11 12 target_link_libraries(${testname} testlib) 12 target_link_libraries(${testname} ${module})13 13 target_link_libraries(${testname} boost_unit_test_framework-mt) 14 14 -
branches/newapi/licq/src/test/CMakeLists.txt
r5782 r5906 1 1 set(testlib_SRCS 2 log.cpp 2 3 main.cpp 3 4 recorder.cpp -
branches/newapi/licq/src/test/log.h
r5744 r5906 18 18 */ 19 19 20 #ifndef L OG_H21 #define L OG_H20 #ifndef LICQTEST_LOG_H 21 #define LICQTEST_LOG_H 22 22 23 23 #include "licq/interface/log.h" … … 25 25 #include <iostream> 26 26 27 namespace LicqTest 28 { 29 30 /** 31 * A log for unit-tests that prints to std::clog. The single instance 32 * of this class is returned from Licq::Log::getThreadLog(). 33 */ 27 34 class Log : public Licq::Log 28 35 { … … 37 44 std::clog << msg << std::endl; 38 45 } 46 47 private: 48 Log() { /* Empty */ } 49 ~Log() { /* Empty */ } 50 51 friend class Licq::Log; 39 52 }; 40 53 54 } // namespace LicqTest 55 41 56 #endif -
branches/newapi/licq/src/test/recorder.cpp
r5667 r5906 22 22 #include <cassert> 23 23 24 Recorder::~Recorder()24 LicqTest::Recorder::~Recorder() 25 25 { 26 26 assert(myQueue.empty()); 27 27 } 28 28 29 void Recorder::push(const std::string& msg)29 void LicqTest::Recorder::push(const std::string& msg) 30 30 { 31 31 myQueue.push(msg); 32 32 } 33 33 34 std::string Recorder::pop()34 std::string LicqTest::Recorder::pop() 35 35 { 36 36 assert(!isEmpty()); … … 42 42 43 43 boost::test_tools::predicate_result 44 Recorder::pop(const std::string& msg)44 LicqTest::Recorder::pop(const std::string& msg) 45 45 { 46 46 boost::test_tools::predicate_result res(false); -
branches/newapi/licq/src/test/recorder.h
r5667 r5906 18 18 */ 19 19 20 #ifndef RECORDER_H21 #define RECORDER_H20 #ifndef LICQTEST_RECORDER_H 21 #define LICQTEST_RECORDER_H 22 22 23 23 #include <boost/format.hpp> 24 24 #include <boost/test/predicate_result.hpp> 25 25 #include <queue> 26 27 namespace LicqTest 28 { 26 29 27 30 class Recorder … … 44 47 }; 45 48 46 inline void Recorder::push(const boost::format& msg) 49 } // namespace LicqTest 50 51 inline void LicqTest::Recorder::push(const boost::format& msg) 47 52 { 48 53 push(msg.str()); … … 50 55 51 56 inline boost::test_tools::predicate_result 52 Recorder::pop(const boost::format& msg)57 LicqTest::Recorder::pop(const boost::format& msg) 53 58 { 54 59 return pop(msg.str()); 55 60 } 56 61 57 inline bool Recorder::isEmpty() const62 inline bool LicqTest::Recorder::isEmpty() const 58 63 { 59 64 return myQueue.empty(); 60 65 } 61 66 62 inline size_t Recorder::size() const67 inline size_t LicqTest::Recorder::size() const 63 68 { 64 69 return myQueue.size();
