#4683 clang-format on all files in ApplicationCode

This commit is contained in:
Magne Sjaastad
2019-09-06 10:40:57 +02:00
parent 3a317504bb
commit fe9e567825
2092 changed files with 117952 additions and 111846 deletions

View File

@@ -3,17 +3,17 @@
/////////////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2011-2012 Statoil ASA, Ceetron AS
//
//
// ResInsight 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.
//
//
// ResInsight 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 at <http://www.gnu.org/licenses/gpl.html>
//
// See the GNU General Public License at <http://www.gnu.org/licenses/gpl.html>
// for more details.
//
/////////////////////////////////////////////////////////////////////////////////
@@ -24,74 +24,70 @@
#include "RigGridManager.h"
#include "RigMainGrid.h"
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
TEST(RigGridManager, BasicTest)
TEST( RigGridManager, BasicTest )
{
cvf::ref<RigMainGrid> mainGridA = new RigMainGrid;
cvf::ref<RigEclipseCaseData> eclipseCase = new RigEclipseCaseData(nullptr);
eclipseCase->setMainGrid(mainGridA.p());
cvf::ref<RigEclipseCaseData> eclipseCase = new RigEclipseCaseData( nullptr );
eclipseCase->setMainGrid( mainGridA.p() );
EXPECT_EQ(mainGridA->refCount(), 2);
EXPECT_EQ( mainGridA->refCount(), 2 );
RigGridManager gridCollection;
gridCollection.addCase(eclipseCase.p());
EXPECT_EQ(mainGridA->refCount(), 2);
gridCollection.addCase( eclipseCase.p() );
EXPECT_EQ( mainGridA->refCount(), 2 );
cvf::ref<RigMainGrid> mainGridB = mainGridA;
EXPECT_EQ(mainGridA->refCount(), 3);
EXPECT_EQ( mainGridA->refCount(), 3 );
cvf::ref<RigMainGrid> existingGrid = gridCollection.findEqualGrid(mainGridB.p());
EXPECT_TRUE(existingGrid.notNull());
cvf::ref<RigMainGrid> existingGrid = gridCollection.findEqualGrid( mainGridB.p() );
EXPECT_TRUE( existingGrid.notNull() );
}
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
TEST(RigGridManager, EqualTests)
TEST( RigGridManager, EqualTests )
{
cvf::ref<RigMainGrid> mainGridA = new RigMainGrid;
mainGridA->nodes().push_back(cvf::Vec3d(0, 0, 0));
mainGridA->nodes().push_back(cvf::Vec3d(0, 0, 1));
mainGridA->nodes().push_back(cvf::Vec3d(0, 0, 2));
cvf::ref<RigEclipseCaseData> eclipseCase = new RigEclipseCaseData(nullptr);
eclipseCase->setMainGrid(mainGridA.p());
mainGridA->nodes().push_back( cvf::Vec3d( 0, 0, 0 ) );
mainGridA->nodes().push_back( cvf::Vec3d( 0, 0, 1 ) );
mainGridA->nodes().push_back( cvf::Vec3d( 0, 0, 2 ) );
cvf::ref<RigEclipseCaseData> eclipseCase = new RigEclipseCaseData( nullptr );
eclipseCase->setMainGrid( mainGridA.p() );
RigGridManager gridCollection;
gridCollection.addCase(eclipseCase.p());
gridCollection.addCase( eclipseCase.p() );
cvf::ref<RigMainGrid> mainGridB = new RigMainGrid;
cvf::ref<RigMainGrid> existingGrid = gridCollection.findEqualGrid( mainGridB.p() );
EXPECT_TRUE( existingGrid.isNull() );
cvf::ref<RigMainGrid> mainGridB = new RigMainGrid;
cvf::ref<RigMainGrid> existingGrid = gridCollection.findEqualGrid(mainGridB.p());
EXPECT_TRUE(existingGrid.isNull());
mainGridB->nodes().push_back(cvf::Vec3d(0, 0, 0));
existingGrid = gridCollection.findEqualGrid(mainGridB.p());
EXPECT_TRUE(existingGrid.isNull());
mainGridB->nodes().push_back( cvf::Vec3d( 0, 0, 0 ) );
existingGrid = gridCollection.findEqualGrid( mainGridB.p() );
EXPECT_TRUE( existingGrid.isNull() );
// Insert nodes in opposite direction
mainGridB->nodes().push_back(cvf::Vec3d(0, 0, 2));
mainGridB->nodes().push_back(cvf::Vec3d(0, 0, 1));
existingGrid = gridCollection.findEqualGrid(mainGridB.p());
EXPECT_TRUE(existingGrid.isNull());
mainGridB->nodes().push_back( cvf::Vec3d( 0, 0, 2 ) );
mainGridB->nodes().push_back( cvf::Vec3d( 0, 0, 1 ) );
existingGrid = gridCollection.findEqualGrid( mainGridB.p() );
EXPECT_TRUE( existingGrid.isNull() );
// Overwrite to match the node structure of mainGridA
mainGridB->nodes()[1] = cvf::Vec3d(0, 0, 1);
mainGridB->nodes()[2] = cvf::Vec3d(0, 0, 2);
existingGrid = gridCollection.findEqualGrid(mainGridB.p());
EXPECT_TRUE(existingGrid.notNull());
mainGridB->nodes()[1] = cvf::Vec3d( 0, 0, 1 );
mainGridB->nodes()[2] = cvf::Vec3d( 0, 0, 2 );
existingGrid = gridCollection.findEqualGrid( mainGridB.p() );
EXPECT_TRUE( existingGrid.notNull() );
}
/*
//--------------------------------------------------------------------------------------------------
///
///
//--------------------------------------------------------------------------------------------------
TEST(RigReservoirTest, BasicTest)
{
@@ -121,8 +117,9 @@ TEST(RigReservoirTest, BasicTest)
{
qDebug() << "Index" << i << "is " << wellCellTimeHistory->m_resultTimeStepIndexToWellTimeStepIndex[i];
const RigWellResultFrame& wellCells = wellCellTimeHistory->wellResultFrame(wellCellTimeHistory->m_resultTimeStepIndexToWellTimeStepIndex[i]);
qDebug() << wellCells.m_timestamp;
const RigWellResultFrame& wellCells =
wellCellTimeHistory->wellResultFrame(wellCellTimeHistory->m_resultTimeStepIndexToWellTimeStepIndex[i]); qDebug() <<
wellCells.m_timestamp;
}
}