PRISMS-PF  v2.1
test_get_entry_name_ending_list.h
Go to the documentation of this file.
1 // Unit test(s) for the method "get_entry_name_ending_list"
2 
3 template <int dim,typename T>
5  bool pass = false;
6 
7  char buffer[100];
8 
9  std::cout << "\nTesting 'get_entry_name_ending_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> entry_name_ending_list;
15  entry_name_ending_list = input_file_reader.get_entry_name_ending_list("get_entry_name_ending_list_tester.in","set","Model constant");
16 
17  /*
18  // Output the strings to see what, if anything, is going wrong
19  for (unsigned int i=0; i < entry_name_ending_list.size(); i++){
20  std::cout << entry_name_ending_list[i] << std::endl;
21  }
22  */
23 
24  if (entry_name_ending_list.size() != 5){
25  pass = false;
26  }
27  else {
28  pass = (boost::iequals(entry_name_ending_list[0],"abc")
29  && boost::iequals(entry_name_ending_list[1],"dfg")
30  && boost::iequals(entry_name_ending_list[2],"i j k")
31  && boost::iequals(entry_name_ending_list[3],"qrs")
32  && boost::iequals(entry_name_ending_list[4],"t uv") );
33  }
34 
35  sprintf (buffer, "Test result for 'get_entry_name_ending_list': %u\n", pass);
36  std::cout << buffer;
37 
38  return pass;
39 }
std::vector< std::string > get_entry_name_ending_list(const std::string parameters_file_name, const std::string keyword, const std::string entry_name_begining) const