Skip to content

Commit 76de8d1

Browse files
committed
Give a name to our test driver "magic" returnval
1 parent 0d0d8d1 commit 76de8d1

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

tests/driver.C

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,9 @@ private:
5656
CppUnit::Test & _shimmed_test;
5757
};
5858

59+
// "Magic number" for when we're not doing allow or deny regex
60+
static constexpr int added_whole_suite = -12345;
61+
5962
// Add Tests to runner that match user-provided regex.
6063
int add_matching_tests_to_runner(CppUnit::Test * test,
6164
const std::string & allow_r_str,
@@ -72,7 +75,7 @@ int add_matching_tests_to_runner(CppUnit::Test * test,
7275
{
7376
libMesh::out << test->getName() << std::endl;
7477
runner.addTest(test);
75-
return -12345;
78+
return added_whole_suite;
7679
}
7780

7881
if (test->getChildTestCount() == 0)
@@ -182,7 +185,7 @@ int main(int argc, char ** argv)
182185

183186
// If we didn't add the whole suite to the runner, we need to clean
184187
// it up ourselves
185-
if (n_tests_added != -12345)
188+
if (n_tests_added != added_whole_suite)
186189
owned_suite.reset(suite);
187190
#else
188191
// If no C++11 <regex> just run all the tests.

0 commit comments

Comments
 (0)