Files
opm-common/opm/parser/eclipse/Parser/tests/ParserTests.cpp

60 lines
1.7 KiB
C++
Raw Normal View History

/*
Copyright 2013 Statoil ASA.
This file is part of the Open Porous Media project (OPM).
OPM is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OPM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with OPM. If not, see <http://www.gnu.org/licenses/>.
*/
#include <stdexcept>
#include <iostream>
2013-03-14 14:54:53 +01:00
#include <boost/filesystem.hpp>
#define BOOST_TEST_MODULE ParserTests
#include <boost/test/unit_test.hpp>
2013-04-03 11:38:06 +02:00
2013-05-30 10:11:12 +02:00
#include <opm/parser/eclipse/Parser/Parser.hpp>
#include <opm/parser/eclipse/Parser/ParserKW.hpp>
#include <opm/parser/eclipse/Parser/ParserRecordSize.hpp>
#include <opm/parser/eclipse/RawDeck/RawDeck.hpp>
2013-05-30 10:11:12 +02:00
using namespace Opm;
BOOST_AUTO_TEST_CASE(Initializing) {
BOOST_CHECK_NO_THROW(Parser parser);
2013-05-30 10:11:12 +02:00
BOOST_CHECK_NO_THROW(ParserPtr parserPtr(new Parser()));
BOOST_CHECK_NO_THROW(ParserConstPtr parserConstPtr(new Parser()));
}
BOOST_AUTO_TEST_CASE(ParserAddKW) {
Parser parser;
{
ParserRecordSizePtr recordSize(new ParserRecordSize(9));
ParserKWPtr equilKW(new ParserKW("EQUIL", recordSize));
parser.addKW(equilKW);
}
}
2013-04-03 11:38:06 +02:00
BOOST_AUTO_TEST_CASE(hasKeyword_hasKeyword_returnstrue) {
ParserPtr parser(new Parser());
parser->addKW(ParserKWConstPtr(new ParserKW("FJAS")));
BOOST_CHECK(parser->hasKeyword("FJAS"));
}
2013-04-03 11:38:06 +02:00