예제 #1
0
void test_create_valid( const char * config_file ) {
  char * cwd0 = util_alloc_cwd();
  ert_test_context_type * test_context = ert_test_context_alloc("CREATE_CONTEXT" , config_file , NULL );
  test_assert_true( ert_test_context_is_instance( test_context ));
  test_assert_true( enkf_main_is_instance( ert_test_context_get_main( test_context )));
  {
    char * cwd1 = util_alloc_cwd();
    test_assert_string_not_equal(cwd1 , cwd0);
    free( cwd1 );
  }
  free( cwd0 );
  ert_test_context_free( test_context );
}
예제 #2
0
void test_create() {
  char * cwd0 = util_alloc_cwd();
  char * cwd1;
  {
    ERT::TestArea ta("test/area");
    cwd1 = util_alloc_cwd();
    test_assert_string_not_equal( cwd0 , cwd1 );
    test_assert_string_equal( cwd1 , ta.getCwd().c_str());
    test_assert_string_equal( cwd0 , ta.getOriginalCwd( ).c_str() );
  }
  test_assert_false( util_is_directory(cwd1) );
  free( cwd1 );
  free( cwd0 );
}
예제 #3
0
파일: eclxx_kw.cpp 프로젝트: Ensembles/ert
void test_kw_vector_string() {
    std::vector< const char* > vec = {
        "short",
        "sweet",
        "padded  ",
        "verylongkeyword"
    };

    ERT::EclKW< const char* > kw( "XYZ", vec );

    test_assert_size_t_equal( kw.size(), vec.size() );

    test_assert_string_equal( kw.at( 0 ), "short   " );
    test_assert_string_equal( kw.at( 1 ), "sweet   " );
    test_assert_string_equal( kw.at( 2 ), vec.at( 2 ) );
    test_assert_string_equal( kw.at( 3 ), "verylong" );
    test_assert_string_not_equal( kw.at( 2 ), "verylongkeyword" );
}