RCFProto
 All Classes Functions Typedefs
TestRCF.hpp
1 
2 #ifndef INCLUDE_TESTRCF_HPP
3 #define INCLUDE_TESTRCF_HPP
4 
5 #include <string>
6 
7 #include <boost/algorithm/string/case_conv.hpp>
8 
9 #include <RCF/test/PrintTestHeader.hpp>
10 #include <RCF/test/Test.hpp>
11 #include <RCF/test/TransportFactories.hpp>
12 
13 #include <RCF/util/CommandLine.hpp>
14 
15 
16 
17 
18 #include <RCF/InitDeinit.hpp>
19 
20 #include <RCF/TcpServerTransport.hpp>
21 #include <RCF/Asio.hpp>
22 #include <RCF/Config.hpp>
23 
24 #ifdef RCF_HAS_LOCAL_SOCKETS
25 #include <RCF/UnixLocalClientTransport.hpp>
26 #include <RCF/UnixLocalServerTransport.hpp>
27 #endif
28 
29 #if RCF_FEATURE_NAMEDPIPE==1
30 #include <RCF/Win32NamedPipeClientTransport.hpp>
31 #include <RCF/Win32NamedPipeEndpoint.hpp>
32 #include <RCF/Win32NamedPipeServerTransport.hpp>
33 #endif
34 
35 #include <RCF/TcpClientTransport.hpp>
36 #include <RCF/UdpClientTransport.hpp>
37 #include <RCF/UdpServerTransport.hpp>
38 
39 class CompareNoCase
40 {
41 public:
42  bool operator()(const std::string & lhs, const std::string & rhs) const
43  {
44  //int ret = stricmp(lhs.c_str(), rhs.c_str());
45  return boost::to_upper_copy(lhs) < boost::to_upper_copy(rhs);
46  }
47 };
48 
49 class TestCase;
50 typedef std::map<std::string, TestCase *, CompareNoCase> TestCases;
51 
52 TestCases& getAllTestCases();
53 
54 class TestCase
55 {
56 public:
57  TestCase(const std::string & testName, const std::string & testDescription);
58  virtual ~TestCase();
59 
60  std::string getName() const;
61  std::string getDescription() const;
62  virtual void run(int argc, char ** argv) = 0;
63 
64  std::string mName;
65  std::string mDescription;
66 
67  int mArgc;
68  char ** mArgv;
69 };
70 
71 namespace RCF {
72  std::string getFilterName(int filterId);
73  bool isFilterRemovable(int filterId);
74 }
75 
76 extern bool gInstrumented;
77 extern bool gExpectAllocations;
78 extern std::size_t gnAllocations;
79 
80 #endif // ! INCLUDE_TESTRCF_HPP