ResInsight/ApplicationLibCode/UnitTests/RigSlice2D-Test.cpp
Magne Sjaastad 2d2bf0bbc7
CMake : Improve handling of compiler flags (#8486)
#8478 Code cleanup to fix some warnings

Several adjustments to improve the specification and usage of compile flags.
2022-01-26 10:08:28 +01:00

25 lines
741 B
C++

#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, static_cast<double>( x * y ) );
for ( size_t y = 0; y < ny; y++ )
for ( size_t x = 0; x < nx; x++ )
EXPECT_EQ( static_cast<double>( x * y ), slice.getValue( x, y ) );
}