Changed more heap and smart pointers

This commit is contained in:
Kristian Flikka
2013-03-26 10:27:48 +01:00
parent 2f7cc609d0
commit 4f65285828
6 changed files with 25 additions and 16 deletions

View File

@@ -62,17 +62,24 @@ BOOST_AUTO_TEST_CASE(ParseFileWithFewKeywords) {
RawDeckPtr rawDeck = parser -> parse(singleKeywordFile.string());
BOOST_REQUIRE_EQUAL((unsigned) 4, rawDeck -> getNumberOfKeywords());
RawKeywordPtr matchingKeyword = rawDeck -> getKeyword("A");
BOOST_REQUIRE_EQUAL("A", matchingKeyword->getKeyword());
RawKeywordPtr matchingKeyword = rawDeck -> getKeyword("INCLUDE");
BOOST_REQUIRE_EQUAL("INCLUDE", matchingKeyword->getKeyword());
std::list<RawRecord> records;
std::list<RawRecordPtr> records;
matchingKeyword->getRecords(records);
BOOST_REQUIRE_EQUAL((unsigned) 1, records.size());
RawRecord theRecord = records.front();
RawRecordPtr theRecord = records.front();
std::string recordString;
theRecord.getRecord(recordString);
theRecord -> getRecord(recordString);
BOOST_REQUIRE_EQUAL("\'sti til fil/den er her\'", recordString);
RawKeywordPtr matchingKeyword2 = rawDeck -> getKeyword("ABCDAD");
BOOST_REQUIRE_EQUAL("ABCDAD", matchingKeyword2->getKeyword());
std::list<RawRecordPtr> records2;
matchingKeyword2->getRecords(records2);
BOOST_REQUIRE_EQUAL((unsigned) 2, records2.size());
}
//NOTE: needs statoil dataset