2021-03-24 05:24:22 -05:00
|
|
|
#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++ )
|
2022-01-26 03:08:28 -06:00
|
|
|
slice.setValue( x, y, static_cast<double>( x * y ) );
|
2021-03-24 05:24:22 -05:00
|
|
|
|
|
|
|
for ( size_t y = 0; y < ny; y++ )
|
|
|
|
for ( size_t x = 0; x < nx; x++ )
|
2022-01-26 03:08:28 -06:00
|
|
|
EXPECT_EQ( static_cast<double>( x * y ), slice.getValue( x, y ) );
|
2021-03-24 05:24:22 -05:00
|
|
|
}
|