void test_create() { struct test_struct d; struct_vector_type * struct_vector = struct_vector_alloc( sizeof d ); test_assert_true( struct_vector_is_instance( struct_vector )); test_assert_int_equal( struct_vector_get_size( struct_vector ) , 0 ); struct_vector_free( struct_vector ); }
void test_append_iget() { struct test_struct d1,d2; struct_vector_type * struct_vector = struct_vector_alloc( sizeof d1 ); d1.x = 100; d1.y = 99; d1.z = 234; struct_vector_append( struct_vector , &d1 ); test_assert_int_equal( struct_vector_get_size( struct_vector ) , 1 ); test_assert_false( d1.x == d2.x ); test_assert_false( d1.y == d2.y ); test_assert_false( d1.z == d2.z ); struct_vector_iget( struct_vector , 0 , &d2); test_assert_true( d1.x == d2.x ); test_assert_true( d1.y == d2.y ); test_assert_true( d1.z == d2.z ); struct_vector_reset( struct_vector ); test_assert_int_equal( struct_vector_get_size( struct_vector ) , 0 ); struct_vector_free( struct_vector ); }
int ecl_nnc_geometry_size( const ecl_nnc_geometry_type * nnc_geo ) { return struct_vector_get_size( nnc_geo->data ); }