45 #include "AbstractLinAlgPack_BasisSystemTesterSetOptions.hpp"
46 #include "OptionsFromStreamPack_StringToBool.hpp"
47 #include "Teuchos_Assert.hpp"
52 const int local_num_options = 6;
63 const char* local_SOptions[local_num_options] = {
74 namespace AbstractLinAlgPack {
78 ,
const char opt_grp_name[] )
79 : OptionsFromStreamPack::SetOptionsFromStreamNode(
80 opt_grp_name, local_num_options, local_SOptions )
81 , OptionsFromStreamPack::SetOptionsToTargetBase<
86 int option_num,
const std::string& option_value )
88 using OptionsFromStreamPack::StringToBool;
90 switch( (local_EOptions)option_num ) {
93 const std::string &option = option_value.c_str();
94 if( option ==
"PRINT_NONE" )
95 target().print_tests( target_t::PRINT_NONE );
96 else if( option ==
"PRINT_BASIC" )
97 target().print_tests( target_t::PRINT_BASIC );
98 else if( option ==
"PRINT_MORE" )
99 target().print_tests( target_t::PRINT_MORE );
100 else if( option ==
"PRINT_ALL" )
101 target().print_tests( target_t::PRINT_ALL );
104 true, std::invalid_argument
105 ,
"Error, incorrect value for "
106 "\"print_tests\". Only the options "
107 "PRINT_NONE, PRINT_BASIS, PRINT_MORE and PRINT_ALL are allowed" );
112 StringToBool(
"dump_all", option_value.c_str() )
117 StringToBool(
"throw_exception", option_value.c_str() )
120 case NUM_RANDOM_TESTS:
121 target().num_random_tests(std::abs(::std::atoi(option_value.c_str())));
124 target().warning_tol(std::fabs(std::atof(option_value.c_str())));
127 target().error_tol(std::fabs(std::atof(option_value.c_str())));
#define TEUCHOS_TEST_FOR_EXCEPTION(throw_exception_test, Exception, msg)
void setOption(int option_num, const std::string &option_value)
Overridden from SetOptionsFromStreamNode.
Testing class for BasisSystem interface.
BasisSystemTesterSetOptions(BasisSystemTester *target=0, const char opt_grp_name[]="BasisSystemTester")
#define TEUCHOS_TEST_FOR_EXCEPT(throw_exception_test)