Beispiel #1
0
void test_time_range( const ecl_sum_type * ecl_sum ) {
  // Hardcoded Gurbat case values
  time_t start = util_make_date( 1,1,2000);
  time_t end   = util_make_date( 31,12,2004 );

  test_assert_time_t_equal( ecl_sum_get_start_time( ecl_sum ) , start );
  test_assert_time_t_equal( ecl_sum_get_end_time( ecl_sum )   , end );
  test_assert_time_t_equal( ecl_sum_get_data_start(ecl_sum) , start);
}
Beispiel #2
0
sum_case_type * sum_case_fread_alloc( const char * data_file , const time_t_vector_type * interp_time ) {
  sum_case_type * sum_case = util_malloc( sizeof * sum_case );

  sum_case->ecl_sum     = ecl_sum_fread_alloc_case( data_file , SUMMARY_JOIN );
  sum_case->interp_data = double_vector_alloc(0 , 0);
  sum_case->interp_time = interp_time;
  sum_case->start_time  = ecl_sum_get_start_time( sum_case->ecl_sum );
  sum_case->end_time    = ecl_sum_get_end_time( sum_case->ecl_sum );
  return sum_case;
}
Beispiel #3
0
void ecl_test( const char * ecl_case ) {
  ecl_sum_type * ecl_sum  = ecl_sum_fread_alloc_case( ecl_case , ":");
  time_t start_time = ecl_sum_get_start_time( ecl_sum );
  time_t end_time   = ecl_sum_get_end_time( ecl_sum );
  time_map_type * ecl_map = time_map_alloc( );
  
  test_assert_true( time_map_summary_update( ecl_map , ecl_sum ) );
  test_assert_true( time_map_summary_update( ecl_map , ecl_sum ) );
  
  test_assert_time_t_equal( time_map_get_start_time( ecl_map ) , start_time );
  test_assert_time_t_equal( time_map_get_end_time( ecl_map ) , end_time );
  test_assert_double_equal( time_map_get_end_days( ecl_map ) , ecl_sum_get_sim_length( ecl_sum ));

  time_map_clear( ecl_map );
  time_map_update( ecl_map , 1 , 256 );
  test_assert_false( time_map_summary_update( ecl_map , ecl_sum ));
  
  time_map_free( ecl_map );
  ecl_sum_free( ecl_sum );
}