mirror of
https://github.com/nasa/trick.git
synced 2024-12-30 09:58:53 +00:00
Merge pull request #500 from nasa/MonteCarloUnitTest
Modified unit tests to account for new logic.
This commit is contained in:
commit
7af2b790a2
@ -65,22 +65,6 @@ TEST_F(MonteCarloTest, MonteVarFile_BadFileException) {
|
|||||||
EXPECT_EQ(got_exception, true);
|
EXPECT_EQ(got_exception, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(MonteCarloTest, MonteVarFile_FileException) {
|
|
||||||
bool got_exception = false;
|
|
||||||
|
|
||||||
try {
|
|
||||||
Trick::MonteVarFile var("time_to_fire_1", "M_jet_firings_inline", 1) ;
|
|
||||||
var.get_next_value();
|
|
||||||
var.input_file_stream->close();
|
|
||||||
var.get_next_value();
|
|
||||||
var.get_next_value();
|
|
||||||
} catch (Trick::ExecutiveException &e) {
|
|
||||||
std::cout << e.message << std::endl;
|
|
||||||
got_exception = true;
|
|
||||||
}
|
|
||||||
EXPECT_EQ(got_exception, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST_F(MonteCarloTest, TestMonteVarRandom_Exception) {
|
TEST_F(MonteCarloTest, TestMonteVarRandom_Exception) {
|
||||||
bool got_exception = false;
|
bool got_exception = false;
|
||||||
|
|
||||||
|
@ -327,7 +327,7 @@ TEST_F(MonteCarloTest, MonteVarFile) {
|
|||||||
Trick::MonteVarFile var0("time_to_fire_1", "M_jet_firings_inline", 2) ;
|
Trick::MonteVarFile var0("time_to_fire_1", "M_jet_firings_inline", 2) ;
|
||||||
EXPECT_EQ(exec.variables.size(), 0) ;
|
EXPECT_EQ(exec.variables.size(), 0) ;
|
||||||
exec.add_variable(&var0) ;
|
exec.add_variable(&var0) ;
|
||||||
EXPECT_EQ(var0.get_next_value(), "time_to_fire_1 = 1") ;
|
EXPECT_EQ(var0.get_next_value(), "time_to_fire_1 = 1.0000") ;
|
||||||
EXPECT_EQ(exec.variables.size(), 1) ;
|
EXPECT_EQ(exec.variables.size(), 1) ;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user