mirror of
https://github.com/OPM/opm-simulators.git
synced 2024-12-24 00:10:02 -06:00
Merge pull request #5007 from akva2/fix_loghelper_test_logger
fixed: we need to initialize logger before parsing
This commit is contained in:
commit
518df3fa7e
@ -108,6 +108,11 @@ BOOST_AUTO_TEST_CASE(Cumulative)
|
||||
:--------:-----------:--------:----:------------:----------:-----------:-----------:------------:----------:-----------:-----------:
|
||||
)";
|
||||
|
||||
std::stringstream str;
|
||||
Opm::OpmLog::addBackend("stream",
|
||||
std::make_shared<Opm::StreamLog>(str, Opm::Log::MessageType::Note));
|
||||
|
||||
|
||||
Opm::Parser parser;
|
||||
auto python = std::make_shared<Opm::Python>();
|
||||
auto deck = parser.parseString(input);
|
||||
@ -157,10 +162,6 @@ BOOST_AUTO_TEST_CASE(Cumulative)
|
||||
st.set(p.first, p.second * 1e3);
|
||||
}
|
||||
|
||||
std::stringstream str;
|
||||
Opm::OpmLog::addBackend("stream",
|
||||
std::make_shared<Opm::StreamLog>(str, Opm::Log::MessageType::Note));
|
||||
|
||||
Opm::LogOutputHelper<double> helper(eclState, schedule, st);
|
||||
helper.cumulative(0, [](const std::string&) { return false; });
|
||||
std::string data = trimStream(str);
|
||||
@ -173,6 +174,10 @@ BOOST_AUTO_TEST_CASE(Error)
|
||||
Finding the dew point pressure failed for 3 cells [(5,1,1), (6,1,1), (7,1,1)]
|
||||
)";
|
||||
|
||||
std::stringstream str;
|
||||
Opm::OpmLog::addBackend("stream",
|
||||
std::make_shared<Opm::StreamLog>(str, Opm::Log::MessageType::Warning));
|
||||
|
||||
Opm::Parser parser;
|
||||
auto python = std::make_shared<Opm::Python>();
|
||||
auto deck = parser.parseString(input);
|
||||
@ -183,13 +188,10 @@ Finding the dew point pressure failed for 3 cells [(5,1,1), (6,1,1), (7,1,1)]
|
||||
Opm::Schedule schedule(deck, grid, fp, runspec, python);
|
||||
Opm::EclipseState eclState(deck);
|
||||
|
||||
std::stringstream str;
|
||||
Opm::OpmLog::addBackend("stream",
|
||||
std::make_shared<Opm::StreamLog>(str, Opm::Log::MessageType::Warning));
|
||||
|
||||
Opm::SummaryState st;
|
||||
Opm::LogOutputHelper<double> helper(eclState, schedule, st);
|
||||
|
||||
str.str(""); // clear out parser errors
|
||||
helper.error({1,20,30}, {4,5,6});
|
||||
std::string data = trimStream(str);
|
||||
BOOST_CHECK_EQUAL(data, reference);
|
||||
@ -225,6 +227,10 @@ FIPNUM report region 1 pressure dependent pore volume = 50 RB
|
||||
:========================:==========================================:================:==========================================:
|
||||
)";
|
||||
|
||||
std::stringstream str;
|
||||
Opm::OpmLog::addBackend("stream",
|
||||
std::make_shared<Opm::StreamLog>(str, Opm::Log::MessageType::Note));
|
||||
|
||||
Opm::Parser parser;
|
||||
auto python = std::make_shared<Opm::Python>();
|
||||
auto deck = parser.parseString(input);
|
||||
@ -237,10 +243,6 @@ FIPNUM report region 1 pressure dependent pore volume = 50 RB
|
||||
Opm::EclipseState eclState(deck);
|
||||
Opm::SummaryState st;
|
||||
|
||||
std::stringstream str;
|
||||
Opm::OpmLog::addBackend("stream",
|
||||
std::make_shared<Opm::StreamLog>(str, Opm::Log::MessageType::Note));
|
||||
|
||||
Opm::LogOutputHelper<double> helper(eclState, schedule, st);
|
||||
Opm::Inplace initial, current;
|
||||
const auto& phases = current.phases();
|
||||
@ -288,6 +290,10 @@ BOOST_AUTO_TEST_CASE(FipResv)
|
||||
:---------:---------------:---------------:---------------:---------------:---------------:
|
||||
)";
|
||||
|
||||
std::stringstream str;
|
||||
Opm::OpmLog::addBackend("stream",
|
||||
std::make_shared<Opm::StreamLog>(str, Opm::Log::MessageType::Note));
|
||||
|
||||
Opm::Parser parser;
|
||||
auto python = std::make_shared<Opm::Python>();
|
||||
auto deck = parser.parseString(input);
|
||||
@ -300,10 +306,6 @@ BOOST_AUTO_TEST_CASE(FipResv)
|
||||
Opm::EclipseState eclState(deck);
|
||||
Opm::SummaryState st;
|
||||
|
||||
std::stringstream str;
|
||||
Opm::OpmLog::addBackend("stream",
|
||||
std::make_shared<Opm::StreamLog>(str, Opm::Log::MessageType::Note));
|
||||
|
||||
Opm::LogOutputHelper<double> helper(eclState, schedule, st);
|
||||
Opm::Inplace current;
|
||||
const auto& phases = current.phases();
|
||||
@ -340,6 +342,10 @@ BOOST_AUTO_TEST_CASE(Injection)
|
||||
:--------:-----------:------:------:------:------------:----------:-----------:-----------:--------:--------:
|
||||
)";
|
||||
|
||||
std::stringstream str;
|
||||
Opm::OpmLog::addBackend("stream",
|
||||
std::make_shared<Opm::StreamLog>(str, Opm::Log::MessageType::Note));
|
||||
|
||||
Opm::Parser parser;
|
||||
auto python = std::make_shared<Opm::Python>();
|
||||
auto deck = parser.parseString(input);
|
||||
@ -371,10 +377,6 @@ BOOST_AUTO_TEST_CASE(Injection)
|
||||
st.set(p.first, p.second);
|
||||
}
|
||||
|
||||
std::stringstream str;
|
||||
Opm::OpmLog::addBackend("stream",
|
||||
std::make_shared<Opm::StreamLog>(str, Opm::Log::MessageType::Note));
|
||||
|
||||
Opm::LogOutputHelper<double> helper(eclState, schedule, st);
|
||||
helper.injection(0, [](const std::string&) { return false; });
|
||||
std::string data = trimStream(str);
|
||||
@ -396,6 +398,10 @@ BOOST_AUTO_TEST_CASE(Production)
|
||||
:--------:-----------:----:-----------:-----------:-----------:-----------:-----------:----------:------------:--------:--------:
|
||||
)";
|
||||
|
||||
std::stringstream str;
|
||||
Opm::OpmLog::addBackend("stream",
|
||||
std::make_shared<Opm::StreamLog>(str, Opm::Log::MessageType::Note));
|
||||
|
||||
Opm::Parser parser;
|
||||
auto python = std::make_shared<Opm::Python>();
|
||||
auto deck = parser.parseString(input);
|
||||
@ -433,10 +439,6 @@ BOOST_AUTO_TEST_CASE(Production)
|
||||
st.set(p.first, p.second);
|
||||
}
|
||||
|
||||
std::stringstream str;
|
||||
Opm::OpmLog::addBackend("stream",
|
||||
std::make_shared<Opm::StreamLog>(str, Opm::Log::MessageType::Note));
|
||||
|
||||
Opm::LogOutputHelper<double> helper(eclState, schedule, st);
|
||||
helper.production(0, [](const std::string&) { return false; });
|
||||
std::string data = trimStream(str);
|
||||
|
Loading…
Reference in New Issue
Block a user