Added test for IOConfigBaseName and fixed a self-introduced bug in E.S.

This commit is contained in:
Pål Grønås Drange
2016-05-03 13:14:18 +02:00
parent 3a3ec10649
commit d9eb3ebf86
2 changed files with 12 additions and 3 deletions

View File

@@ -166,13 +166,15 @@ namespace Opm {
}
void EclipseState::initIOConfig(const Deck& deck) {
m_ioConfig = std::make_shared<IOConfig>();
std::string dataFile = deck.getDataFile();
m_ioConfig = std::make_shared<IOConfig>(dataFile);
if (Section::hasGRID(deck)) {
std::shared_ptr<const GRIDSection> gridSection = std::make_shared<const GRIDSection>(deck);
auto gridSection = std::make_shared<const GRIDSection>(deck);
m_ioConfig->handleGridSection(gridSection);
}
if (Section::hasRUNSPEC(deck)) {
std::shared_ptr<const RUNSPECSection> runspecSection = std::make_shared<const RUNSPECSection>(deck);
auto runspecSection = std::make_shared<const RUNSPECSection>(deck);
m_ioConfig->handleRunspecSection(runspecSection);
}
}

View File

@@ -408,6 +408,13 @@ BOOST_AUTO_TEST_CASE(WithGridOptsDefaultRegion) {
BOOST_CHECK_NE( &fluxnum , &multnum );
}
BOOST_AUTO_TEST_CASE(TestIOConfigBaseName) {
ParseContext parseContext;
ParserPtr parser(new Parser());
DeckConstPtr deck = parser->parseFile("testdata/integration_tests/IOConfig/SPE1CASE2.DATA", parseContext);
EclipseState state(*deck, parseContext);
BOOST_CHECK_EQUAL(state.getIOConfig()->getBaseName(), "SPE1CASE2");
}
BOOST_AUTO_TEST_CASE(TestIOConfigCreation) {
const char * deckData =