Schedule::getGroup returns reference, not pointer

This commit is contained in:
Jørgen Kvalsvik
2016-10-05 15:24:14 +02:00
parent 6a1ad6f3fe
commit 3c2ebf9cfd
7 changed files with 53 additions and 53 deletions

View File

@@ -47,32 +47,32 @@ BOOST_AUTO_TEST_CASE(AddWellsAndGroupToCollection) {
EclipseStateConstPtr eclipseState(new EclipseState(*deck, parseContext));
PhaseUsage pu = phaseUsageFromDeck(eclipseState);
GroupTreeNodePtr field=eclipseState->getSchedule()->getGroupTree(2)->getNode("FIELD");
GroupTreeNodePtr g1=eclipseState->getSchedule()->getGroupTree(2)->getNode("G1");
GroupTreeNodePtr g2=eclipseState->getSchedule()->getGroupTree(2)->getNode("G2");
GroupTreeNodePtr field=eclipseState->getSchedule()->getGroupTree(2).getNode("FIELD");
GroupTreeNodePtr g1=eclipseState->getSchedule()->getGroupTree(2).getNode("G1");
GroupTreeNodePtr g2=eclipseState->getSchedule()->getGroupTree(2).getNode("G2");
WellCollection collection;
// Add groups to WellCollection
const auto* fieldGroup = eclipseState->getSchedule()->getGroup(field->name());
const auto& fieldGroup = eclipseState->getSchedule()->getGroup(field->name());
collection.addField(fieldGroup, 2, pu);
for (auto iter = field->begin(); iter != field->end(); ++iter) {
const auto* childGroupNode = eclipseState->getSchedule()->getGroup((*iter).second->name());
collection.addGroup(childGroupNode, fieldGroup->name(), 2, pu);
const auto& childGroupNode = eclipseState->getSchedule()->getGroup((*iter).second->name());
collection.addGroup(childGroupNode, fieldGroup.name(), 2, pu);
}
const auto* g1Group = eclipseState->getSchedule()->getGroup(g1->name());
const auto& g1Group = eclipseState->getSchedule()->getGroup(g1->name());
for (auto iter = g1->begin(); iter != g1->end(); ++iter) {
const auto* childGroupNode = eclipseState->getSchedule()->getGroup((*iter).second->name());
collection.addGroup(childGroupNode, g1Group->name(), 2, pu);
const auto& childGroupNode = eclipseState->getSchedule()->getGroup((*iter).second->name());
collection.addGroup(childGroupNode, g1Group.name(), 2, pu);
}
const auto* g2Group = eclipseState->getSchedule()->getGroup(g2->name());
const auto& g2Group = eclipseState->getSchedule()->getGroup(g2->name());
for (auto iter = g2->begin(); iter != g2->end(); ++iter) {
const auto* childGroupNode = eclipseState->getSchedule()->getGroup((*iter).second->name());
collection.addGroup(childGroupNode, g2Group->name(), 2, pu);
auto childGroupNode = eclipseState->getSchedule()->getGroup((*iter).second->name());
collection.addGroup(childGroupNode, g2Group.name(), 2, pu);
}
BOOST_CHECK_EQUAL("FIELD", collection.findNode("FIELD")->name());