search_path_test_3.cc
Go to the documentation of this file.
1 #define BOOST_TEST_MODULE (search_path_test_3 test)
2 #include "boost/test/unit_test.hpp"
3 
4 #include <fstream>
5 #include <sstream>
6 #include <string>
7 
8 #include "cetlib/include.h"
9 #include "cetlib_except/exception.h"
10 
11 BOOST_AUTO_TEST_SUITE(search_path_test_3)
12 
13 BOOST_AUTO_TEST_CASE(missing_file_throws)
14 {
15  std::istringstream is("#include \"/tmp/aaa\"");
17 
18  BOOST_CHECK_THROW(cet::include(is, result), cet::exception);
19 }
20 
21 BOOST_AUTO_TEST_CASE(bad_stream_throws)
22 {
23  std::ifstream is("no file with this name exists");
25 
26  BOOST_CHECK_THROW(cet::include(is, result), cet::exception);
27 }
28 
29 BOOST_AUTO_TEST_SUITE_END()
static QCString result
std::string string
Definition: nybbler.cc:12
void include(std::istream &in, std::string &result)
Definition: include.cc:63
cet::coded_exception< error, detail::translate > exception
Definition: exception.h:33
BOOST_AUTO_TEST_CASE(missing_file_throws)