2013-03-18 13:40:14 +01:00
|
|
|
/*
|
|
|
|
|
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/>.
|
|
|
|
|
*/
|
|
|
|
|
|
2013-03-18 15:59:57 +01:00
|
|
|
#include <stdexcept>
|
2013-03-20 16:29:51 +01:00
|
|
|
#include <iostream>
|
2013-03-14 14:54:53 +01:00
|
|
|
#include <boost/filesystem.hpp>
|
2013-03-18 15:59:57 +01:00
|
|
|
#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-04-04 09:56:00 +02:00
|
|
|
|
2013-05-30 10:11:12 +02:00
|
|
|
using namespace Opm;
|
2013-04-04 09:56:00 +02:00
|
|
|
|
2013-03-18 15:59:57 +01:00
|
|
|
BOOST_AUTO_TEST_CASE(Initializing) {
|
2013-05-06 12:13:49 +02:00
|
|
|
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()));
|
2013-03-14 12:07:33 +01:00
|
|
|
}
|
|
|
|
|
|
2013-04-04 14:17:12 +02:00
|
|
|
BOOST_AUTO_TEST_CASE(ParserAddKW) {
|
2013-05-06 12:13:49 +02:00
|
|
|
Parser parser;
|
|
|
|
|
{
|
|
|
|
|
ParserRecordSizePtr recordSize(new ParserRecordSize(9));
|
|
|
|
|
ParserKWPtr equilKW(new ParserKW("EQUIL", recordSize));
|
2013-03-20 17:35:03 +01:00
|
|
|
|
2013-05-06 12:13:49 +02:00
|
|
|
parser.addKW(equilKW);
|
|
|
|
|
}
|
2013-03-20 17:35:03 +01:00
|
|
|
}
|
2013-04-03 11:38:06 +02:00
|
|
|
|
2013-06-04 14:32:30 +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
|
|
|
|
|
|
|
|
|