PRISMS-PF  v2.1
test_get_subsection_entry_list.h
Go to the documentation of this file.
1 // Unit test(s) for the method "parse_line"
2 
3 template <int dim,typename T>
5  bool pass = false;
6 
7  char buffer[100];
8 
9  std::cout << "\nTesting 'get_subsection_entry_list'... " << std::endl;
10 
11  //create test problem class object
12  variableAttributeLoader variable_attributes;
13  inputFileReader input_file_reader("parameters_test.in",variable_attributes);
14  std::vector<std::string> list_of_entries;
15  list_of_entries = input_file_reader.get_subsection_entry_list("input_file_parser_test_file.txt","Equation","Variable type","SCALAR");
16 
17  if (list_of_entries.size() != 3){
18  pass = false;
19  }
20  else {
21  pass = (boost::iequals(list_of_entries[0],"SCALAR")
22  && boost::iequals(list_of_entries[1],"VECTOR")
23  && boost::iequals(list_of_entries[2],"SCALAR") );
24  }
25 
26  sprintf (buffer, "Test result for 'get_subsection_entry_list': %u\n", pass);
27  std::cout << buffer;
28 
29  return pass;
30 }
std::vector< std::string > get_subsection_entry_list(const std::string parameters_file_name, const std::string subsec_name, const std::string entry_name, const std::string default_entry) const