fixed bug in Parser, use openRootFile
This commit is contained in:
@@ -57,6 +57,8 @@ namespace Opm {
|
||||
boost::filesystem::path path( input_path );
|
||||
m_base_name = path.stem().string();
|
||||
m_output_dir = path.parent_path().string();
|
||||
if (m_output_dir == "")
|
||||
m_output_dir = ".";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -414,6 +414,13 @@ BOOST_AUTO_TEST_CASE(TestIOConfigBaseName) {
|
||||
DeckConstPtr deck = parser->parseFile("testdata/integration_tests/IOConfig/SPE1CASE2.DATA", parseContext);
|
||||
EclipseState state(*deck, parseContext);
|
||||
BOOST_CHECK_EQUAL(state.getIOConfig()->getBaseName(), "SPE1CASE2");
|
||||
BOOST_CHECK_EQUAL(state.getIOConfig()->getOutputDir(), "testdata/integration_tests/IOConfig");
|
||||
|
||||
ParserPtr parser2(new Parser());
|
||||
DeckConstPtr deck2 = createDeckWithGridOpts();
|
||||
EclipseState state2(*deck2, parseContext);
|
||||
BOOST_CHECK_EQUAL(state2.getIOConfig()->getBaseName(), "");
|
||||
BOOST_CHECK_EQUAL(state2.getIOConfig()->getOutputDir(), ".");
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(TestIOConfigCreation) {
|
||||
|
||||
@@ -271,7 +271,7 @@ ParserState::ParserState( const ParseContext& context,
|
||||
deck( new Deck() ),
|
||||
parseContext( context )
|
||||
{
|
||||
loadFile( p );
|
||||
openRootFile( p );
|
||||
}
|
||||
|
||||
void ParserState::loadString(const std::string& input) {
|
||||
|
||||
Reference in New Issue
Block a user