#7493 Add RigSlice2D utility class.

This commit is contained in:
Kristian Bendiksen
2021-03-24 11:24:22 +01:00
parent 836c679e89
commit 6f9f77e009
5 changed files with 142 additions and 0 deletions

View File

@@ -75,6 +75,7 @@ ${CMAKE_CURRENT_LIST_DIR}/RifStimPlanXmlReader-Test.cpp
${CMAKE_CURRENT_LIST_DIR}/RigWellPathGeometryExporter-Test.cpp
${CMAKE_CURRENT_LIST_DIR}/RifStimPlanModelDeviationFrkExporter-Test.cpp
${CMAKE_CURRENT_LIST_DIR}/RifSummaryDataReader-Test.cpp
${CMAKE_CURRENT_LIST_DIR}/RigSlice2D-Test.cpp
)
if (RESINSIGHT_ENABLE_GRPC)

View File

@@ -0,0 +1,24 @@
#include "gtest/gtest.h"
#include "RigSlice2D.h"
//--------------------------------------------------------------------------------------------------
///
//--------------------------------------------------------------------------------------------------
TEST( RigSlice2DTest, GetAndSet )
{
size_t nx = 12;
size_t ny = 23;
RigSlice2D slice( nx, ny );
EXPECT_EQ( nx, slice.nx() );
EXPECT_EQ( ny, slice.ny() );
for ( size_t y = 0; y < ny; y++ )
for ( size_t x = 0; x < nx; x++ )
slice.setValue( x, y, x * y );
for ( size_t y = 0; y < ny; y++ )
for ( size_t x = 0; x < nx; x++ )
EXPECT_EQ( x * y, slice.getValue( x, y ) );
}