add mpi serialization for Action::Condition

This commit is contained in:
Arne Morten Kvarving
2019-12-17 16:01:46 +01:00
parent a0c2d5b0f6
commit 92811754a8
3 changed files with 57 additions and 0 deletions

View File

@@ -430,6 +430,20 @@ Opm::Tuning getTuning()
Opm::DynamicState<int>(std::vector<int>{10}, 1), //XXDPR_has_value
std::map<std::string,bool>{{"test", false}}); // resetValue
}
Opm::Action::Condition getCondition()
{
Opm::Action::Quantity q;
q.quantity = "test1";
q.args = {"test2", "test3"};
Opm::Action::Condition val1;
val1.lhs = val1.rhs = q;
val1.logic = Opm::Action::Condition::Logical::OR;
val1.cmp = Opm::Action::Condition::Comparator::LESS;
val1.cmp_string = "test";
return val1;
}
#endif
@@ -2165,6 +2179,16 @@ BOOST_AUTO_TEST_CASE(Quantity)
}
BOOST_AUTO_TEST_CASE(Condition)
{
#ifdef HAVE_MPI
Opm::Action::Condition val1 = getCondition();
auto val2 = PackUnpack(val1);
BOOST_CHECK(std::get<1>(val2) == std::get<2>(val2));
BOOST_CHECK(val1 == std::get<0>(val2));
#endif
}
bool init_unit_test_func()
{