mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#7493 Add RigSlice2D utility class.
This commit is contained in:
@@ -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)
|
||||
|
||||
24
ApplicationLibCode/UnitTests/RigSlice2D-Test.cpp
Normal file
24
ApplicationLibCode/UnitTests/RigSlice2D-Test.cpp
Normal 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 ) );
|
||||
}
|
||||
Reference in New Issue
Block a user