Remove TimeMap( start_time ) constructor
This commit is contained in:
@@ -50,7 +50,6 @@ namespace Opm {
|
||||
};
|
||||
|
||||
TimeMap() = default;
|
||||
explicit TimeMap(std::time_t startTime);
|
||||
explicit TimeMap(const Deck& deck);
|
||||
explicit TimeMap(const std::vector<std::time_t>& time_points);
|
||||
TimeMap(const std::vector<std::time_t>& timeList,
|
||||
|
||||
@@ -49,10 +49,6 @@ namespace {
|
||||
{"DES", 12}};
|
||||
}
|
||||
|
||||
TimeMap::TimeMap(std::time_t startTime) {
|
||||
m_timeList.push_back(startTime);
|
||||
}
|
||||
|
||||
TimeMap::TimeMap(const std::vector<std::time_t>& time_points) {
|
||||
if (time_points.empty())
|
||||
throw std::invalid_argument("Can not initialize with empty list of time points");
|
||||
|
||||
@@ -43,14 +43,14 @@ Opm::TimeMap make_timemap(int num) {
|
||||
|
||||
BOOST_AUTO_TEST_CASE(CreateDynamicTest) {
|
||||
const std::time_t startDate = Opm::TimeMap::mkdate(2010, 1, 1);
|
||||
Opm::TimeMap timeMap{ startDate };
|
||||
Opm::TimeMap timeMap({ startDate });
|
||||
Opm::DynamicState<double> state(timeMap , 9.99);
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(DynamicStateGetOutOfRangeThrows) {
|
||||
const std::time_t startDate = Opm::TimeMap::mkdate(2010, 1, 1);
|
||||
Opm::TimeMap timeMap{ startDate };
|
||||
Opm::TimeMap timeMap({ startDate });
|
||||
Opm::DynamicState<double> state(timeMap , 9.99);
|
||||
BOOST_CHECK_THROW( state.get(1) , std::out_of_range );
|
||||
}
|
||||
@@ -58,7 +58,7 @@ BOOST_AUTO_TEST_CASE(DynamicStateGetOutOfRangeThrows) {
|
||||
|
||||
BOOST_AUTO_TEST_CASE(DynamicStateGetDefault) {
|
||||
const std::time_t startDate = Opm::TimeMap::mkdate(2010, 1, 1);
|
||||
Opm::TimeMap timeMap{ startDate };
|
||||
Opm::TimeMap timeMap( { startDate } );
|
||||
Opm::DynamicState<int> state(timeMap , 137);
|
||||
BOOST_CHECK_EQUAL( 137 , state.get(0));
|
||||
BOOST_CHECK_EQUAL( 137 , state.back() );
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
BOOST_AUTO_TEST_CASE(CreateDynamicTest) {
|
||||
const std::time_t startDate = Opm::TimeMap::mkdate(2010, 1, 1);
|
||||
Opm::TimeMap timeMap{ startDate };
|
||||
Opm::TimeMap timeMap({ startDate });
|
||||
Opm::DynamicVector<double> vector(timeMap , 9.99);
|
||||
|
||||
BOOST_CHECK_EQUAL( vector[0] , 9.99 );
|
||||
|
||||
@@ -40,15 +40,8 @@ const std::time_t startDateJan1st2010 = Opm::TimeMap::mkdate(2010, 1, 1);
|
||||
|
||||
Opm::DeckRecord createDeckRecord(int day, const std::string &month, int year, const std::string &time = "00:00:00.000");
|
||||
|
||||
BOOST_AUTO_TEST_CASE(CreateTimeMapFromTimeT) {
|
||||
std::time_t startDate = time(NULL);
|
||||
Opm::TimeMap timeMap(startDate);
|
||||
BOOST_CHECK_EQUAL(1U , timeMap.size());
|
||||
}
|
||||
|
||||
|
||||
BOOST_AUTO_TEST_CASE(GetStartDate) {
|
||||
Opm::TimeMap timeMap(startDateJan1st2010);
|
||||
Opm::TimeMap timeMap({ startDateJan1st2010 });
|
||||
BOOST_CHECK_EQUAL( Opm::TimeMap::mkdate(2010, 1, 1) , timeMap.getStartTime(/*timeStepIdx=*/0));
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user