Skip to content

Commit

Permalink
Merge pull request #457 from joakim-hove/struct-vector-fixup
Browse files Browse the repository at this point in the history
Use std::vector<> in test
  • Loading branch information
joakim-hove authored Aug 22, 2018
2 parents e9210b5 + 7ee6c58 commit 1f05183
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions lib/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,7 @@ add_test(NAME ecl_nnc_test4 COMMAND ecl_nnc_test ${_eclpath}/DualPoro/DUAL_DIFF.
add_test(NAME ecl_nnc_test5 COMMAND ecl_nnc_test ${_eclpath}/nestedLGRcase/TESTCASE_NESTEDLGR.EGRID)

add_executable(ecl_layer_statoil ecl/tests/ecl_layer_statoil.cpp)
target_include_directories(ecl_layer_statoil PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/private-include)
target_link_libraries(ecl_layer_statoil ecl)
add_test(NAME ecl_layer_statoil COMMAND ecl_layer_statoil
${_eclpath}/Mariner/MARINER.EGRID
Expand Down
8 changes: 5 additions & 3 deletions lib/ecl/tests/ecl_layer_statoil.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,16 @@
#include <stdlib.h>
#include <stdbool.h>

#include <vector>

#include <ert/util/test_util.hpp>
#include <ert/util/util.h>

#include <ert/ecl/layer.hpp>
#include <ert/ecl/ecl_grid.hpp>
#include <ert/ecl/ecl_kw.hpp>
#include <ert/ecl/layer.hpp>

#include "detail/ecl/layer_cxx.hpp"

ecl_kw_type * alloc_faultblock_kw( const char * filename, int grid_size) {
FILE * stream = util_fopen( filename , "r");
Expand All @@ -49,7 +52,7 @@ void test_layer( const ecl_grid_type * ecl_grid , const ecl_kw_type * faultblock
}

{
struct_vector_type * corner_list = struct_vector_alloc( sizeof(int_point2d_type) );
std::vector<int_point2d_type> corner_list;
int_vector_type * i_list = int_vector_alloc(0,0);
int_vector_type * j_list = int_vector_alloc(0,0);
int_vector_type * cell_list = int_vector_alloc(0,0);
Expand All @@ -64,7 +67,6 @@ void test_layer( const ecl_grid_type * ecl_grid , const ecl_kw_type * faultblock
}
}
test_assert_int_equal( 0 , layer_get_cell_sum( layer ));
struct_vector_free( corner_list );
int_vector_free( i_list );
int_vector_free( j_list );
int_vector_free( cell_list );
Expand Down

0 comments on commit 1f05183

Please sign in to comment.