Functions
include_test.cc File Reference
#include "cetlib/include.h"
#include <cstdlib>
#include <fstream>
#include <regex>

Go to the source code of this file.

Functions

int main ()
 

Function Documentation

int main ( void  )

Definition at line 80 of file include_test.cc.

81 {
82  write_files();
83 
84  {
86 
87  std::ifstream a(file_a);
88  ensure(1, a);
89  result.clear();
90  include(a, result);
91  ensure(2, result == expected_string(contents_a));
92 
93  std::ifstream b(file_b);
94  ensure(3, b);
95  result.clear();
96  include(b, result);
97  ensure(4, result == expected_string(contents_b));
98 
99  std::ifstream c(file_c);
100  ensure(5, c);
101  result.clear();
102  include(c, result);
103  ensure(6, result == expected_string(contents_c));
104  }
105 
106  {
108  std::ifstream i(file_i);
109  ensure(11, i);
110  result.clear();
111  include(i, result);
112  ensure(12,
113  result == expected_string("begin\n") + expected_string(contents_a) +
114  expected_string("end\n"));
115  }
116 
117  {
119  std::ifstream j(file_j);
120  ensure(21, j);
121  result.clear();
122  include(j, result);
123  ensure(22,
124  result == expected_string("begin\n") + expected_string(contents_a) +
125  expected_string(contents_b) + expected_string("end\n"));
126  }
127 
128  {
130  std::ifstream k(file_k);
131  ensure(31, k);
132  result.clear();
133  include(k, result);
134  ensure(32,
135  result == expected_string("begin\n") + expected_string(contents_a) +
136  expected_string(contents_b) +
137  expected_string(contents_c) + expected_string("end\n"));
138  }
139 
140 } // main()
static QCString result
std::string string
Definition: nybbler.cc:12
void ensure(int which, bool claim)
const double a
void include(std::istream &in, std::string &result)
Definition: include.cc:63
static bool * b
Definition: config.cpp:1043