test_suite.cc
Go to the documentation of this file.
1 #define BOOST_TEST_MODULE (document test)
2 
3 #include "boost/test/unit_test.hpp"
4 
8 
9 #include <fstream>
10 #include <string>
11 
12 using namespace fhicl;
13 using namespace std;
14 
15 void
16 readFile(string fileName, string& content)
17 {
18  ifstream in(fileName.c_str());
19  for (string line; getline(in, line);)
20  content.append(line).append("\n");
21 }
22 
23 BOOST_AUTO_TEST_SUITE(document_test)
24 
26 {
27  cet::filepath_lookup_nonabsolute policy("FHICL_FILE_PATH");
28  auto const ps1 = ParameterSet::make(
29  boost::unit_test::framework::master_test_suite().argv[1], policy);
30  auto const ps2 = ParameterSet::make(ps1.to_string());
31  BOOST_TEST(ps1 == ps2);
32 
33  // Alternative representation.
34  auto const ps3 = ParameterSet::make(ps1.to_compact_string());
35  BOOST_TEST(ps1 == ps3);
36 }
37 
38 BOOST_AUTO_TEST_SUITE_END()
static ParameterSet make(intermediate_table const &tbl)
Definition: ParameterSet.cc:68
STL namespace.
void readFile(string fileName, string &content)
Definition: test_suite.cc:16
fileName
Definition: dumpTree.py:9
void line(double t, double *p, double &x, double &y, double &z)
QCString doc
BOOST_AUTO_TEST_CASE(doc)
Definition: test_suite.cc:25