Changeset 10:f619b5887cf6 in rrlib_util


Ignore:
Timestamp:
31.12.2010 05:59:50 (9 years ago)
Author:
Tobias Föhst <foehst@…>
Branch:
default
Phase:
public
Convert:
svn:dcce5f72-5200-4218-9373-75d9081937af/trunk@11
Message:

Removed dependency to rrlib_logging in testprograms

Location:
test
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • test/test_command_pattern.cpp

    r6 r10  
    3434#include <cstdlib> 
    3535#include <string> 
    36  
    37 extern "C" 
    38 { 
    39 #include <libgen.h> 
    40 } 
     36#include <iostream> 
     37#include <vector> 
    4138 
    4239//---------------------------------------------------------------------- 
    4340// Internal includes with "" 
    4441//---------------------------------------------------------------------- 
    45 #include "rrlib/logging/definitions.h" 
    46  
    4742#include "rrlib/util/patterns/command.h" 
    4843 
     
    5449// Namespace usage 
    5550//---------------------------------------------------------------------- 
    56 using namespace rrlib::logging; 
    5751 
    5852//---------------------------------------------------------------------- 
     
    7367  void operator()(int i, double d) 
    7468  { 
    75     RRLIB_LOG_STREAM(eLL_USER) << "TestFunctor1 called with i = " << i << ", d = " << d << "."; 
     69    std::cout << "TestFunctor1 called with i = " << i << ", d = " << d << "." << std::endl; 
    7670  } 
    7771}; 
     
    8175  bool operator()(int i) 
    8276  { 
    83     RRLIB_LOG_STREAM(eLL_USER) << "TestFunctor2 called with i = " << i << "."; 
     77    std::cout << "TestFunctor2 called with i = " << i << "." << std::endl; 
    8478    return true; 
    8579  } 
     
    9084  void operator()() 
    9185  { 
    92     RRLIB_LOG_STREAM(eLL_USER) << "TestFunctor3 called."; 
     86    std::cout << "TestFunctor3 called." << std::endl; 
    9387  } 
    9488}; 
     
    9791void TestFunction(int i, double d) 
    9892{ 
    99   RRLIB_LOG_STREAM(eLL_USER) << "TestFunction called with i = " << i << ", d = " << d << "."; 
     93  std::cout << "TestFunction called with i = " << i << ", d = " << d << "." << std::endl; 
    10094} 
    10195 
     
    117111  void Eat() 
    118112  { 
    119     RRLIB_LOG_STREAM(eLL_USER) << "Tsk, knick, tsk..."; 
     113    std::cout << "Tsk, knick, tsk..." << std::endl; 
    120114  } 
    121115  void Speak() 
    122116  { 
    123     RRLIB_LOG_STREAM(eLL_USER) << "Oh Captain, my Captain!"; 
     117    std::cout << "Oh Captain, my Captain!" << std::endl; 
    124118  } 
    125119}; 
     
    129123int main(int argc, char **argv) 
    130124{ 
    131   default_log_description = basename(argv[0]); 
    132  
    133   tLogDomainRegistry::GetInstance()->SetDomainMaxMessageLevel(tLogDomainRegistry::GetDefaultDomain()->GetName(), eLL_DEBUG_VERBOSE_3); 
    134  
    135125  // Test basic functor objects 
    136126  TestFunctor1 f1; 
  • test/test_final_class_pattern.cpp

    r6 r10  
    3333//---------------------------------------------------------------------- 
    3434#include <cstdlib> 
    35  
    36 extern "C" 
    37 { 
    38 #include <libgen.h> 
    39 } 
     35#include <iostream> 
    4036 
    4137//---------------------------------------------------------------------- 
    4238// Internal includes with "" 
    4339//---------------------------------------------------------------------- 
    44 #include "rrlib/logging/definitions.h" 
    45  
    4640#include "rrlib/util/patterns/final_class.h" 
    4741 
     
    5347// Namespace usage 
    5448//---------------------------------------------------------------------- 
    55 using namespace rrlib::logging; 
    5649 
    5750//---------------------------------------------------------------------- 
     
    7568  void f() 
    7669  { 
    77     RRLIB_LOG_STREAM(eLL_USER) << "A"; 
     70    std::cout << "A" << std::endl; 
    7871  } 
    7972}; 
     
    8376  void f() 
    8477  { 
    85     RRLIB_LOG_STREAM(eLL_USER) << "B"; 
     78    std::cout << "B" << std::endl; 
    8679  } 
    8780}; 
     
    9790  void f() 
    9891  { 
    99     RRLIB_LOG_STREAM(eLL_USER) << "Final"; 
     92    std::cout << "Final" << std::endl; 
    10093  } 
    10194}; 
     
    114107int main(int argc, char **argv) 
    115108{ 
    116   default_log_description = basename(argv[0]); 
    117  
    118109  A a; 
    119110  a.f(); 
  • test/test_singleton_pattern.cpp

    r7 r10  
    3636#include <iostream> 
    3737 
    38 extern "C" 
    39 { 
    40 #include <libgen.h> 
    41 } 
    42  
    4338//---------------------------------------------------------------------- 
    4439// Internal includes with "" 
    4540//---------------------------------------------------------------------- 
    46 #include "rrlib/logging/definitions.h" 
    47  
    4841#include "rrlib/util/patterns/singleton.h" 
    4942 
     
    5548// Namespace usage 
    5649//---------------------------------------------------------------------- 
    57 using namespace rrlib::logging; 
    5850 
    5951//---------------------------------------------------------------------- 
     
    128120int main(int argc, char **argv) 
    129121{ 
    130   default_log_description = basename(argv[0]); 
    131  
    132   tLogDomainRegistry::GetInstance()->SetDomainMaxMessageLevel(tLogDomainRegistry::GetDefaultDomain()->GetName(), eLL_DEBUG_VERBOSE_3); 
    133  
    134122  tKeyboard::GetInstance().Type("foo"); 
    135123  tDisplay::GetInstance().Show("bar"); 
Note: See TracChangeset for help on using the changeset viewer.