void test_read_erroneous_gen_kw_file() { const char * parameter_filename = "MULTFLT_with_errors.txt"; const char * tmpl_filename = "MULTFLT.tmpl"; { FILE * stream = util_fopen(parameter_filename, "w"); const char * data = util_alloc_sprintf("MULTFLT1 NORMAL 0\nMULTFLT2 RAW\nMULTFLT3 NORMAL 0"); util_fprintf_string(data, 30, true, stream); util_fclose(stream); FILE * tmpl_stream = util_fopen(tmpl_filename, "w"); const char * tmpl_data = util_alloc_sprintf("<MULTFLT1> <MULTFLT2> <MULTFLT3>\n"); util_fprintf_string(tmpl_data, 30, true, tmpl_stream); util_fclose(tmpl_stream); } gen_kw_config_type * gen_kw_config = gen_kw_config_alloc_empty("MULTFLT", "<%s>"); vector_type * arg = vector_alloc_new(); vector_append_ref( arg , gen_kw_config ); vector_append_ref(arg, parameter_filename); test_assert_util_abort("arg_pack_fscanf", read_erroneous_gen_kw_file, arg); vector_free(arg); gen_kw_config_free(gen_kw_config); }
/** This will create a new gen_kw_config instance which is NOT yet valid. */ enkf_config_node_type * enkf_config_node_new_gen_kw( const char * key , const char * tag_fmt ) { enkf_config_node_type * config_node = enkf_config_node_alloc__( PARAMETER , GEN_KW , key ); config_node->data = gen_kw_config_alloc_empty( key , tag_fmt ); return config_node; }