-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #13 from rscherrer/develop
Develop
- Loading branch information
Showing
6 changed files
with
63 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,54 @@ | ||
#define BOOST_TEST_DYN_LINK | ||
#define BOOST_TEST_MAIN | ||
|
||
#include "src/Simul.h" | ||
#include "tests/TestUtilities.h" | ||
#include <boost/test/unit_test.hpp> | ||
#include <iostream> | ||
|
||
// Black box testing of the proper run of the main function | ||
|
||
// Check that the program can run without arguments | ||
BOOST_AUTO_TEST_CASE(testUseNoArgs) | ||
{ | ||
// std::clog << "Testing run without arguments...\n"; | ||
BOOST_CHECK_EQUAL(simulate({ "EGS_test" }), 0); | ||
} | ||
|
||
// Check that the program cannot run with more than one argument | ||
BOOST_AUTO_TEST_CASE(testAbuseTooManyArgs) | ||
{ | ||
// std::clog << "Testing run with too many arguments...\n"; | ||
BOOST_CHECK_EQUAL(simulate({ "EGS_test", "arg1", "arg2" }), 1); | ||
} | ||
|
||
BOOST_AUTO_TEST_CASE(testAbuseInvalidFilename) | ||
{ | ||
// std::clog << "Testing run with invalid parameter file...\n"; | ||
BOOST_CHECK_EQUAL(simulate({ "EGS_test", "nonsense.txt" }), 1); | ||
} | ||
|
||
|
||
BOOST_AUTO_TEST_CASE(testUseValidFilename) | ||
{ | ||
// std::clog << "Testing run with valid parameter file...\n"; | ||
tst::makeValidParamFile(); | ||
BOOST_CHECK_EQUAL(simulate({ "EGS_test", "validparamfile.txt" }), 0); | ||
} | ||
|
||
|
||
BOOST_AUTO_TEST_CASE(testAbuseInvalidParamName) | ||
{ | ||
// std::clog << "Testing run with invalid parameter names...\n"; | ||
tst::makeInvalidParamName(); | ||
BOOST_CHECK_EQUAL(simulate({ "EGS_test", "invalidparamname.txt" }), 1); | ||
} | ||
|
||
BOOST_AUTO_TEST_CASE(testAbuseInvalidParamValue) | ||
{ | ||
// std::clog << "Testing run with invalid parameter values...\n"; | ||
tst::makeInvalidParamValue(); | ||
BOOST_CHECK_EQUAL(simulate({"EGS_test", "invalidparamvalue.txt"}), 1); | ||
tst::makeInvalidParamValue2(); | ||
BOOST_CHECK_EQUAL(simulate({"EGS_test", "invalidparamvalue2.txt"}), 1); | ||
} | ||
|
||
BOOST_AUTO_TEST_CASE(testUseEmptyFreezer) | ||
{ | ||
|
||
tst::makeParamFileEmptyFreezer(); | ||
simulate({"EGS_test", "paramfileemptyfreezer.txt"}); | ||
BOOST_CHECK(tst::isFileEmpty("empty_freezer.dat")); | ||
|
||
} | ||
#define BOOST_TEST_DYN_LINK | ||
#define BOOST_TEST_MAIN | ||
|
||
#include "src/Simul.h" | ||
#include "tests/TestUtilities.h" | ||
#include <boost/test/unit_test.hpp> | ||
#include <iostream> | ||
|
||
// Black box testing of the proper run of the main function | ||
|
||
// Check that the program can run without arguments | ||
BOOST_AUTO_TEST_CASE(testUseNoArgs) | ||
{ | ||
// std::clog << "Testing run without arguments...\n"; | ||
BOOST_CHECK_EQUAL(simulate({ "speciome_test" }), 0); | ||
} | ||
|
||
// Check that the program cannot run with more than one argument | ||
BOOST_AUTO_TEST_CASE(testAbuseTooManyArgs) | ||
{ | ||
// std::clog << "Testing run with too many arguments...\n"; | ||
BOOST_CHECK_EQUAL(simulate({ "speciome_test", "arg1", "arg2" }), 1); | ||
} | ||
|
||
BOOST_AUTO_TEST_CASE(testAbuseInvalidFilename) | ||
{ | ||
// std::clog << "Testing run with invalid parameter file...\n"; | ||
BOOST_CHECK_EQUAL(simulate({ "speciome_test", "nonsense.txt" }), 1); | ||
} | ||
|
||
|
||
BOOST_AUTO_TEST_CASE(testUseValidFilename) | ||
{ | ||
// std::clog << "Testing run with valid parameter file...\n"; | ||
tst::makeValidParamFile(); | ||
BOOST_CHECK_EQUAL(simulate({ "speciome_test", "validparamfile.txt" }), 0); | ||
} | ||
|
||
|
||
BOOST_AUTO_TEST_CASE(testAbuseInvalidParamName) | ||
{ | ||
// std::clog << "Testing run with invalid parameter names...\n"; | ||
tst::makeInvalidParamName(); | ||
BOOST_CHECK_EQUAL(simulate({ "speciome_test", "invalidparamname.txt" }), 1); | ||
} | ||
|
||
BOOST_AUTO_TEST_CASE(testAbuseInvalidParamValue) | ||
{ | ||
// std::clog << "Testing run with invalid parameter values...\n"; | ||
tst::makeInvalidParamValue(); | ||
BOOST_CHECK_EQUAL(simulate({"speciome_test", "invalidparamvalue.txt"}), 1); | ||
tst::makeInvalidParamValue2(); | ||
BOOST_CHECK_EQUAL(simulate({"speciome_test", "invalidparamvalue2.txt"}), 1); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters