Example #1
0
int main( int argc , char ** argv) {
  util_install_signals();
  {
    const char * file = argv[1];

    test_fortio_is_instance( file );
    test_fortio_safe_cast( file );
    test_assert_util_abort("fortio_safe_cast", test_fortio_unsafe_cast, NULL);
    test_existing_read( file );
    test_not_existing_read( );
    test_open_close_read( file );
    test_wrapper( file );
    test_fread_truncated_head();
    test_fread_truncated_data();
    test_fread_truncated_tail();
    test_fread_invalid_tail();
    test_fseek();
    test_at_eof();

    test_write( "/tmp/path/does/not/exist" , false );
    {
      test_work_area_type * work_area = test_work_area_alloc("ecl_fortio.write" );
      util_make_path("path");
      test_write( "path/file.x" , true );
      test_work_area_free( work_area );
    }

    exit(0);
  }
}
Example #2
0
static void 
test_utm(double projY, double projX, double height, int zone,
         double lon, double lat, datum_type_t datum)
{
    project_parameters_t pps;
    pps.utm.zone = zone;
    pps.utm.lat0 = lat*D2R;

    test_wrapper("UTM", &pps,
                 project_utm, project_utm_inv,
                 project_utm_arr, project_utm_arr_inv,
                 projY, projX, height, lon, lat, datum);
}
Example #3
0
int main( int argc , char ** argv) {
  const char * file = argv[1];
  
  test_existing_read( file );
  test_not_existing_read( );
  test_open_close_read( file );
  test_wrapper( file );
  test_write( "/tmp/path/does/not/exist" , false );  
  {
    test_work_area_type * work_area = test_work_area_alloc("ecl_fortio.write" );
    util_make_path("path");
    test_write( "path/file.x" , true );
    test_work_area_free( work_area );
  }
  
  exit(0);
}
Example #4
0
int main(int argc , char ** argv) {
  local_obsdata_type * obsdata;

  obsdata = local_obsdata_alloc( "KEY");
  test_assert_true( local_obsdata_is_instance( obsdata ));
  test_assert_int_equal( 0 , local_obsdata_get_size( obsdata ));
  test_assert_string_equal( "KEY" , local_obsdata_get_name( obsdata ));

  {
    local_obsdata_node_type * obsnode = local_obsdata_node_alloc( "KEY" );
    test_assert_true( local_obsdata_add_node( obsdata , obsnode ) );
    test_assert_false( local_obsdata_add_node( obsdata , obsnode ) );
    test_assert_int_equal( 1 , local_obsdata_get_size( obsdata ));
    test_assert_ptr_equal( obsnode , local_obsdata_iget( obsdata , 0));
  }

  local_obsdata_free( obsdata );

  test_wrapper();
  exit(0);
}