2013-02-12 04:43:36 -06:00
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
//
|
2014-09-23 08:04:57 -05:00
|
|
|
// Copyright (C) 2011- Statoil ASA
|
|
|
|
// Copyright (C) 2013- Ceetron Solutions AS
|
|
|
|
// Copyright (C) 2011-2012 Ceetron AS
|
2013-02-12 04:43:36 -06:00
|
|
|
//
|
|
|
|
// 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>
|
|
|
|
// for more details.
|
|
|
|
//
|
|
|
|
/////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
#include "gtest/gtest.h"
|
|
|
|
|
|
|
|
#include "RigActiveCellInfo.h"
|
|
|
|
|
|
|
|
|
2013-03-22 03:44:41 -05:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
2013-02-12 04:43:36 -06:00
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
TEST(RigActiveCellInfo, BasicTest)
|
|
|
|
{
|
|
|
|
RigActiveCellInfo rigActiveCellInfo;
|
|
|
|
|
|
|
|
size_t globalActiveCellCount = 10;
|
2014-08-08 03:27:29 -05:00
|
|
|
rigActiveCellInfo.setReservoirCellCount(globalActiveCellCount);
|
2013-02-12 04:43:36 -06:00
|
|
|
|
|
|
|
for (size_t i = 0; i < globalActiveCellCount; i++)
|
|
|
|
{
|
2013-03-22 03:44:41 -05:00
|
|
|
EXPECT_TRUE(rigActiveCellInfo.cellResultIndex(i) == cvf::UNDEFINED_SIZE_T);
|
|
|
|
EXPECT_FALSE(rigActiveCellInfo.isActive(i));
|
2013-02-12 04:43:36 -06:00
|
|
|
}
|
|
|
|
|
2013-03-22 03:44:41 -05:00
|
|
|
rigActiveCellInfo.setCellResultIndex(3, 1);
|
|
|
|
EXPECT_TRUE(rigActiveCellInfo.cellResultIndex(3) == 1);
|
2013-02-12 04:43:36 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
///
|
|
|
|
//--------------------------------------------------------------------------------------------------
|
|
|
|
TEST(RigActiveCellInfo, GridCellCounts)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
RigActiveCellInfo rigActiveCellInfo;
|
|
|
|
rigActiveCellInfo.setGridCount(3);
|
2013-03-13 05:50:31 -05:00
|
|
|
rigActiveCellInfo.setGridActiveCellCounts(0, 0);
|
|
|
|
rigActiveCellInfo.setGridActiveCellCounts(1, 1);
|
|
|
|
rigActiveCellInfo.setGridActiveCellCounts(2, 2);
|
2013-02-12 04:43:36 -06:00
|
|
|
rigActiveCellInfo.computeDerivedData();
|
|
|
|
|
2014-08-08 03:27:29 -05:00
|
|
|
EXPECT_TRUE(rigActiveCellInfo.reservoirActiveCellCount() == 3);
|
2013-02-12 04:43:36 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
{
|
|
|
|
RigActiveCellInfo rigActiveCellInfo;
|
|
|
|
rigActiveCellInfo.setGridCount(3);
|
2013-03-13 05:50:31 -05:00
|
|
|
rigActiveCellInfo.setGridActiveCellCounts(0, 3 );
|
|
|
|
rigActiveCellInfo.setGridActiveCellCounts(1, 4 );
|
|
|
|
rigActiveCellInfo.setGridActiveCellCounts(2, 5 );
|
2013-02-12 04:43:36 -06:00
|
|
|
rigActiveCellInfo.computeDerivedData();
|
|
|
|
|
2014-08-08 03:27:29 -05:00
|
|
|
EXPECT_TRUE(rigActiveCellInfo.reservoirActiveCellCount() == 12);
|
2013-02-12 04:43:36 -06:00
|
|
|
}
|
|
|
|
}
|