Changeset 5906 for branches/newapi

Show
Ignore:
Timestamp:
12/02/07 19:59:40 (12 months ago)
Author:
erijo
Message:

Put test help class in LicqTest? namespace.

Location:
branches/newapi/licq/src/test
Files:
1 added
5 modified

Legend:

Unmodified
Added
Removed
  • branches/newapi/licq/src/test/CMakeLists.inc

    r5783 r5906  
    99set_target_properties(${testname} PROPERTIES LINK_FLAGS ${CMAKE_THREAD_LIBS_INIT}) 
    1010 
     11target_link_libraries(${testname} ${module}) 
    1112target_link_libraries(${testname} testlib) 
    12 target_link_libraries(${testname} ${module}) 
    1313target_link_libraries(${testname} boost_unit_test_framework-mt) 
    1414 
  • branches/newapi/licq/src/test/CMakeLists.txt

    r5782 r5906  
    11set(testlib_SRCS 
     2  log.cpp 
    23  main.cpp 
    34  recorder.cpp 
  • branches/newapi/licq/src/test/log.h

    r5744 r5906  
    1818 */ 
    1919 
    20 #ifndef LOG_H 
    21 #define LOG_H 
     20#ifndef LICQTEST_LOG_H 
     21#define LICQTEST_LOG_H 
    2222 
    2323#include "licq/interface/log.h" 
     
    2525#include <iostream> 
    2626 
     27namespace 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 */ 
    2734class Log : public Licq::Log 
    2835{ 
     
    3744    std::clog << msg << std::endl; 
    3845  } 
     46 
     47private: 
     48  Log() { /* Empty */ } 
     49  ~Log() { /* Empty */ } 
     50 
     51  friend class Licq::Log; 
    3952}; 
    4053 
     54} // namespace LicqTest 
     55 
    4156#endif 
  • branches/newapi/licq/src/test/recorder.cpp

    r5667 r5906  
    2222#include <cassert> 
    2323 
    24 Recorder::~Recorder() 
     24LicqTest::Recorder::~Recorder() 
    2525{ 
    2626  assert(myQueue.empty()); 
    2727} 
    2828 
    29 void Recorder::push(const std::string& msg) 
     29void LicqTest::Recorder::push(const std::string& msg) 
    3030{ 
    3131  myQueue.push(msg); 
    3232} 
    3333 
    34 std::string Recorder::pop() 
     34std::string LicqTest::Recorder::pop() 
    3535{ 
    3636  assert(!isEmpty()); 
     
    4242 
    4343boost::test_tools::predicate_result 
    44 Recorder::pop(const std::string& msg) 
     44LicqTest::Recorder::pop(const std::string& msg) 
    4545{ 
    4646  boost::test_tools::predicate_result res(false); 
  • branches/newapi/licq/src/test/recorder.h

    r5667 r5906  
    1818 */ 
    1919 
    20 #ifndef RECORDER_H 
    21 #define RECORDER_H 
     20#ifndef LICQTEST_RECORDER_H 
     21#define LICQTEST_RECORDER_H 
    2222 
    2323#include <boost/format.hpp> 
    2424#include <boost/test/predicate_result.hpp> 
    2525#include <queue> 
     26 
     27namespace LicqTest 
     28{ 
    2629 
    2730class Recorder 
     
    4447}; 
    4548 
    46 inline void Recorder::push(const boost::format& msg) 
     49} // namespace LicqTest 
     50 
     51inline void LicqTest::Recorder::push(const boost::format& msg) 
    4752{ 
    4853  push(msg.str()); 
     
    5055 
    5156inline boost::test_tools::predicate_result 
    52 Recorder::pop(const boost::format& msg) 
     57LicqTest::Recorder::pop(const boost::format& msg) 
    5358{ 
    5459  return pop(msg.str()); 
    5560} 
    5661 
    57 inline bool Recorder::isEmpty() const 
     62inline bool LicqTest::Recorder::isEmpty() const 
    5863{ 
    5964  return myQueue.empty(); 
    6065} 
    6166 
    62 inline size_t Recorder::size() const 
     67inline size_t LicqTest::Recorder::size() const 
    6368{ 
    6469  return myQueue.size();