Definition at line 11 of file getpot_test.C.
◆ CPPUNIT_TEST() [1/4]
◆ CPPUNIT_TEST() [2/4]
◆ CPPUNIT_TEST() [3/4]
◆ CPPUNIT_TEST() [4/4]
◆ CPPUNIT_TEST_SUITE_END()
GetPotTest::CPPUNIT_TEST_SUITE_END |
( |
| ) |
|
◆ LIBMESH_CPPUNIT_TEST_SUITE()
GetPotTest::LIBMESH_CPPUNIT_TEST_SUITE |
( |
GetPotTest |
| ) |
|
◆ setUp()
void GetPotTest::setUp |
( |
| ) |
|
|
inline |
◆ setup_inputfile()
void GetPotTest::setup_inputfile |
( |
| ) |
|
|
inline |
Definition at line 31 of file getpot_test.C.
57 " [../../Subsection4]\n" 65 " unused_var = 'not_used'\n";
std::stringstream inputfile
◆ testCommandLine()
void GetPotTest::testCommandLine |
( |
| ) |
|
|
inline |
◆ testSections()
void GetPotTest::testSections |
( |
| ) |
|
|
inline |
Definition at line 110 of file getpot_test.C.
114 CPPUNIT_ASSERT(
input.have_section(
"Section1/"));
115 CPPUNIT_ASSERT(
input.have_section(
"Section1/SubSection1/"));
116 CPPUNIT_ASSERT(
input.have_section(
"Section2/Subsection2/"));
117 CPPUNIT_ASSERT(
input.have_section(
"Section2/Subsection2/Subsection3/"));
118 CPPUNIT_ASSERT(
input.have_section(
"Section2/Subsection4/"));
119 CPPUNIT_ASSERT(
input.have_section(
"Section3/"));
122 CPPUNIT_ASSERT(
input.have_section(
"Section1"));
123 CPPUNIT_ASSERT(
input.have_section(
"Section1/SubSection1"));
124 CPPUNIT_ASSERT(
input.have_section(
"Section2/Subsection2/Subsection3"));
127 CPPUNIT_ASSERT(!
input.have_section(
"ImNotASection/"));
◆ testSubSections()
void GetPotTest::testSubSections |
( |
| ) |
|
|
inline |
Definition at line 130 of file getpot_test.C.
133 typedef std::vector<std::string>::size_type sz;
134 typedef std::string str;
136 const std::vector<std::string> subsections1 =
137 input.get_subsection_names(
"Section1");
139 CPPUNIT_ASSERT_EQUAL(subsections1.size(), sz(1));
140 CPPUNIT_ASSERT_EQUAL(subsections1[0], str(
"SubSection1"));
142 const std::vector<std::string> subsections1_1 =
143 input.get_subsection_names(
"Section1/Subsection1");
145 CPPUNIT_ASSERT(subsections1_1.empty());
147 const std::vector<std::string> subsections2 =
148 input.get_subsection_names(
"Section2");
150 CPPUNIT_ASSERT_EQUAL(subsections2.size(), sz(2));
151 CPPUNIT_ASSERT_EQUAL(subsections2[0], str(
"Subsection2"));
152 CPPUNIT_ASSERT_EQUAL(subsections2[1], str(
"Subsection4"));
154 const std::vector<std::string> subsections2_2 =
155 input.get_subsection_names(
"Section2/Subsection2");
157 CPPUNIT_ASSERT_EQUAL(subsections2_2.size(), sz(1));
158 CPPUNIT_ASSERT_EQUAL(subsections2_2[0], str(
"Subsection3"));
160 const std::vector<std::string> subsections2_4 =
161 input.get_subsection_names(
"Section2/Subsection4");
163 CPPUNIT_ASSERT(subsections2_4.empty());
165 const std::vector<std::string> subsections3 =
166 input.get_subsection_names(
"Section3");
168 CPPUNIT_ASSERT(subsections3.empty());
◆ testVariables()
void GetPotTest::testVariables |
( |
| ) |
|
|
inline |
Definition at line 76 of file getpot_test.C.
References libMesh::Real.
79 CPPUNIT_ASSERT(
input.have_variable(
"Section1/var1") );
81 CPPUNIT_ASSERT_EQUAL( var1,
Real(5));
83 CPPUNIT_ASSERT(
input.have_variable(
"Section1/SubSection1/var2") );
84 std::string var2 =
input(
"Section1/SubSection1/var2",
"DIE!");
85 CPPUNIT_ASSERT_EQUAL( var2, std::string(
"blah") );
88 CPPUNIT_ASSERT( !
input.have_variable(
"Section2/var3") );
89 int var3 =
input(
"Section2/var3", 314);
90 CPPUNIT_ASSERT_EQUAL( var3, 314 );
92 CPPUNIT_ASSERT(
input.have_variable(
"Section2/Subsection2/var4") );
93 bool var4 =
input(
"Section2/Subsection2/var4",
true);
94 CPPUNIT_ASSERT_EQUAL( var4,
false );
96 CPPUNIT_ASSERT(
input.have_variable(
"Section2/Subsection2/Subsection3/var5") );
97 Real var5 =
input(
"Section2/Subsection2/Subsection3/var5", 3.1415);
98 CPPUNIT_ASSERT_EQUAL( var5,
Real(6.02e23));
100 CPPUNIT_ASSERT(
input.have_variable(
"Section2/Subsection4/var6") );
101 unsigned int var6 =
input(
"Section2/Subsection4/var6", 21);
102 CPPUNIT_ASSERT_EQUAL(var6, static_cast<unsigned int>(42));
105 std::vector<std::string> ufos =
input.unidentified_variables();
106 CPPUNIT_ASSERT_EQUAL( ufos.size(), (std::vector<std::string>::size_type)1 );
107 CPPUNIT_ASSERT_EQUAL( ufos[0], std::string(
"Section3/unused_var") );
DIE A HORRIBLE DEATH HERE typedef LIBMESH_DEFAULT_SCALAR_TYPE Real
◆ input
◆ inputfile
std::stringstream GetPotTest::inputfile |
|
protected |
The documentation for this class was generated from the following file: