这篇教程C++ test_assert_false函数代码示例写得很实用,希望能帮到您。
本文整理汇总了C++中test_assert_false函数的典型用法代码示例。如果您正苦于以下问题:C++ test_assert_false函数的具体用法?C++ test_assert_false怎么用?C++ test_assert_false使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。 在下文中一共展示了test_assert_false函数的24个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。 示例1: test_deselect_matchingvoid test_deselect_matching( ) { state_map_type * map = state_map_alloc( ); bool_vector_type * mask1 = bool_vector_alloc(0 , false); bool_vector_type * mask2 = bool_vector_alloc(1000 , true); state_map_iset( map , 10 , STATE_INITIALIZED ); state_map_iset( map , 10 , STATE_HAS_DATA ); state_map_iset( map , 20 , STATE_INITIALIZED ); state_map_deselect_matching( map , mask1 , STATE_HAS_DATA | STATE_INITIALIZED ); state_map_deselect_matching( map , mask2 , STATE_HAS_DATA | STATE_INITIALIZED ); test_assert_int_equal( state_map_get_size( map ) , bool_vector_size( mask1 )); for (int i=0; i < bool_vector_size( mask1 ); i++) { if (i==10) test_assert_false( bool_vector_iget( mask1 , i )); else if (i== 20) test_assert_false( bool_vector_iget( mask2 , i )); else { test_assert_false( bool_vector_iget( mask1 , i )); test_assert_true( bool_vector_iget( mask2 , i )); } } bool_vector_free( mask1 ); bool_vector_free( mask2 ); state_map_free( map );}
开发者ID:andlaus,项目名称:ResInsight,代码行数:28,
示例2: test_approx_equalvoid test_approx_equal() { double_vector_type * d1 = double_vector_alloc(0,0); double_vector_type * d2 = double_vector_alloc(0,0); double_vector_type * d3 = double_vector_alloc(0,0); double_vector_append( d1 , 1.0 ); double_vector_append( d1 , 2.0 ); double_vector_append( d1 , 3.0 ); double_vector_append( d2 , 1.0 ); double_vector_append( d2 , 2.0 ); test_assert_false( double_vector_approx_equal( d1 , d2 ,1e-6)); double_vector_append( d2 , 3.0 ); test_assert_true( double_vector_approx_equal( d1 , d2 ,1e-6)); double_vector_append( d3 , 1.0 ); double_vector_append( d3 , 2.0 ); double_vector_append( d3 , 3.0 ); double_vector_scale( d3 , 1 + 1e-6 ); test_assert_true( double_vector_approx_equal( d1 , d3 ,1e-4)); test_assert_false( double_vector_approx_equal( d1 , d3 ,1e-8)); double_vector_free(d1); double_vector_free(d2); double_vector_free(d3);}
开发者ID:Ensembles,项目名称:ert,代码行数:31,
示例3: test_equalvoid test_equal( ) { int lgr_nr = 1; nnc_info_type * nnc_info1 = nnc_info_alloc(lgr_nr); nnc_info_type * nnc_info2 = nnc_info_alloc(lgr_nr); test_assert_false( nnc_info_equal( NULL , nnc_info1 )); test_assert_false( nnc_info_equal( nnc_info1, NULL )); test_assert_true( nnc_info_equal( nnc_info1 , nnc_info2 )); nnc_info_add_nnc(nnc_info1, lgr_nr, 3 , 0); test_assert_false( nnc_info_equal( nnc_info1 , nnc_info2 )); nnc_info_add_nnc(nnc_info2, lgr_nr, 3 , 0); test_assert_true( nnc_info_equal( nnc_info1 , nnc_info2 )); nnc_info_add_nnc( nnc_info1 , lgr_nr + 1 , 10 , 10 ); nnc_info_add_nnc( nnc_info2 , lgr_nr + 2 , 11 , 11 ); test_assert_false( nnc_info_equal( nnc_info1 , nnc_info2 )); nnc_info_add_nnc( nnc_info1 , lgr_nr + 2 , 11 , 11 ); nnc_info_add_nnc( nnc_info2 , lgr_nr + 1 , 10 , 10 ); test_assert_true( nnc_info_equal( nnc_info1 , nnc_info2 ));}
开发者ID:Ensembles,项目名称:ert,代码行数:26,
示例4: test_run_workflowvoid test_run_workflow(const char * config_file , const char * job_file) { ert_test_context_type * test_context = ert_test_context_alloc("INSTALL_WORKFLOW" , config_file , NULL ); test_assert_false( ert_test_context_run_worklow( test_context , "No-does.not.exist")); ert_test_context_install_workflow_job( test_context , "JOB" , job_file ); { FILE * stream1 = util_fopen( "WFLOW1", "w"); FILE * stream2 = util_fopen( "WFLOW2", "w"); stringlist_type * args = stringlist_alloc_new( ); ert_test_context_fwrite_workflow_job( stream1 , "JOB" , args); stringlist_append_ref( args , "NewCase"); ert_test_context_fwrite_workflow_job( stream2 , "JOB" , args); stringlist_free( args ); fclose( stream1 ); fclose( stream2 ); } test_assert_true( ert_test_context_install_workflow( test_context , "WFLOW1" , "WFLOW1")); test_assert_true( ert_test_context_install_workflow( test_context , "WFLOW2" , "WFLOW2")); test_assert_true( ert_test_context_run_worklow( test_context , "WFLOW2")); test_assert_false( ert_test_context_run_worklow( test_context , "WFLOW1")); ert_test_context_free( test_context );}
开发者ID:blattms,项目名称:ert,代码行数:25,
示例5: test_exportvoid test_export( const ecl_grid_type * grid) { fault_block_layer_type * layer = fault_block_layer_alloc( grid , 0 ); ecl_kw_type * ecl_kw1 = ecl_kw_alloc("FAULTBLK" , ecl_grid_get_global_size( grid ) , ECL_INT_TYPE ); ecl_kw_type * ecl_kw2 = ecl_kw_alloc("FAULTBLK" , ecl_grid_get_global_size( grid ) + 1 , ECL_INT_TYPE ); ecl_kw_type * ecl_kw3 = ecl_kw_alloc("FAULTBLK" , ecl_grid_get_global_size( grid ) , ECL_FLOAT_TYPE ); fault_block_type * block = fault_block_layer_add_block( layer , 10 ); fault_block_add_cell( block , 0 , 0 ); fault_block_add_cell( block , 1 , 0 ); fault_block_add_cell( block , 1 , 1 ); fault_block_add_cell( block , 0 , 1 ); test_assert_true( fault_block_layer_export( layer , ecl_kw1 )); test_assert_false( fault_block_layer_export( layer , ecl_kw2 )); test_assert_false( fault_block_layer_export( layer , ecl_kw3 )); { int nx = ecl_grid_get_nx( grid ); test_assert_int_equal( ecl_kw_iget_int( ecl_kw1 , 0 ) , 10 ); test_assert_int_equal( ecl_kw_iget_int( ecl_kw1 , 1 ) , 10 ); test_assert_int_equal( ecl_kw_iget_int( ecl_kw1 , nx ) , 10 ); test_assert_int_equal( ecl_kw_iget_int( ecl_kw1 , nx + 1 ) , 10 ); } test_assert_int_equal( 40 , ecl_kw_element_sum_int( ecl_kw1 )); fault_block_layer_free( layer ); ecl_kw_free( ecl_kw1 ); ecl_kw_free( ecl_kw2 ); ecl_kw_free( ecl_kw3 );}
开发者ID:agchitu,项目名称:ert,代码行数:32,
示例6: test_update_storevoid test_update_store() { { test_work_area_type * work_area = test_work_area_alloc( "update-store1" ); char * work_cwd = util_alloc_string_copy( test_work_area_get_cwd( work_area )); test_work_area_set_store( work_area , true ); test_work_area_free( work_area ); test_assert_true( util_entry_exists( work_cwd )); } { test_work_area_type * work_area = test_work_area_alloc( "update-store2" ); char * work_cwd = util_alloc_string_copy( test_work_area_get_cwd( work_area )); test_work_area_free( work_area ); test_assert_false( util_entry_exists( work_cwd )); } { test_work_area_type * work_area = test_work_area_alloc( "update-store3" ); char * work_cwd = util_alloc_string_copy( test_work_area_get_cwd( work_area )); test_work_area_set_store( work_area , false ); test_work_area_free( work_area ); test_assert_false( util_entry_exists( work_cwd )); } { test_work_area_type * work_area = test_work_area_alloc( "update-store4" ); char * work_cwd = util_alloc_string_copy( test_work_area_get_cwd( work_area )); test_work_area_set_store( work_area , true); test_work_area_free( work_area ); test_assert_true( util_entry_exists( work_cwd )); }}
开发者ID:OPM,项目名称:ResInsight,代码行数:32,
示例7: test_fseekvoid test_fseek() { test_work_area_type * work_area = test_work_area_alloc("fortio_fseek" ); { fortio_type * fortio = fortio_open_writer("PRESSURE" , false , true); void * buffer = util_malloc( 100 ); fortio_fwrite_record( fortio , buffer , 100); free( buffer ); fortio_fclose( fortio ); } { fortio_type * fortio = fortio_open_reader("PRESSURE" , false , true); printf("Starting fssek test /n"); test_assert_true( fortio_fseek( fortio , 0 , SEEK_SET )); test_assert_true( fortio_fseek( fortio , 0 , SEEK_END )); test_assert_false( fortio_fseek( fortio , 100000 , SEEK_END)); test_assert_false( fortio_fseek( fortio , 100000 , SEEK_SET)); fortio_fclose( fortio ); } test_work_area_free( work_area );}
开发者ID:YingfangZhou,项目名称:ert,代码行数:26,
示例8: simple_testvoid simple_test() { time_map_type * time_map = time_map_alloc( ); test_work_area_type * work_area = test_work_area_alloc("enkf_time_map" , true); const char * mapfile = "map"; test_assert_true( time_map_update( time_map , 0 , 100 ) ); test_assert_true( time_map_update( time_map , 1 , 200 ) ); test_assert_true( time_map_update( time_map , 1 , 200 ) ); test_assert_false( time_map_update( time_map , 1 , 250 ) ); test_assert_true( time_map_equal( time_map , time_map ) ); time_map_fwrite( time_map , mapfile); { time_map_type * time_map2 = time_map_alloc( ); test_assert_false( time_map_equal( time_map , time_map2 ) ); time_map_fread( time_map2 , mapfile ); test_assert_true( time_map_equal( time_map , time_map2 ) ); time_map_free( time_map2 ); } { time_t mtime1 = util_file_mtime( mapfile ); sleep(2); time_map_fwrite( time_map , mapfile); test_assert_time_t_equal( mtime1 , util_file_mtime( mapfile ) ); time_map_update( time_map , 2 , 300 ); time_map_fwrite( time_map , mapfile); test_assert_time_t_not_equal( mtime1 , util_file_mtime( mapfile ) ); } test_work_area_free( work_area );}
开发者ID:JacobStoren,项目名称:ert,代码行数:32,
示例9: mainint main(int argc , char ** argv) { const char * config_file = argv[1]; config_parser_type * config = config_alloc(); config_add_schema_item( config , "SET" , true ); config_add_schema_item( config , "NOTSET" , false ); { config_content_type * content = config_parse( config , config_file , "--" , "INCLUDE" , NULL , CONFIG_UNRECOGNIZED_IGNORE , true ); test_assert_true( config_content_is_instance( content )); test_assert_true(config_content_is_valid( content )); test_assert_true( config_content_has_item( content , "SET" )); test_assert_false( config_content_has_item( content , "NOTSET" ) ); test_assert_false( config_content_has_item( content , "UNKNOWN" ) ); test_assert_true( config_has_schema_item( config , "SET" )); test_assert_true( config_has_schema_item( config , "NOTSET" )); test_assert_false( config_has_schema_item( config , "UNKNOWN" )); config_content_free( content ); } exit(0);}
开发者ID:YingfangZhou,项目名称:ert,代码行数:25,
示例10: mainint main(int argc , char ** argv) { enkf_main_install_SIGNALS(); const char * config_file = argv[1]; ert_test_context_type * test_context = ert_test_context_alloc("VerifyJobsFileTest" , config_file); enkf_main_type * enkf_main = ert_test_context_get_main(test_context); { const int ens_size = enkf_main_get_ensemble_size( enkf_main ); bool_vector_type * iactive = bool_vector_alloc(0, false); bool_vector_iset( iactive , ens_size - 1 , true ); enkf_main_create_run_path(enkf_main , iactive , 0); bool_vector_free(iactive); } const char * filename = util_alloc_filename(ert_test_context_get_cwd(test_context), "simulations/run0/jobs.py", NULL); const char * jobs_file_content = util_fread_alloc_file_content(filename, NULL); test_assert_true (strstr(jobs_file_content, "umask = 0022") != NULL); test_assert_false (strstr(jobs_file_content, "umask = 0023") != NULL); test_assert_false (strstr(jobs_file_content, "umask = 0032") != NULL); test_assert_false (strstr(jobs_file_content, "umask = 0122") != NULL); test_assert_false (strstr(jobs_file_content, "umask = 1022") != NULL); ert_test_context_free(test_context); exit(0);}
开发者ID:jokva,项目名称:ert,代码行数:29,
示例11: test_at_eofvoid test_at_eof() { test_work_area_type * work_area = test_work_area_alloc("fortio_truncated2" ); { fortio_type * fortio = fortio_open_writer("PRESSURE" , false , true); void * buffer = util_malloc( 100 ); fortio_fwrite_record( fortio , buffer , 100); free( buffer ); fortio_fclose( fortio ); } { fortio_type * fortio = fortio_open_reader("PRESSURE" , false , true); test_assert_false( fortio_read_at_eof( fortio )); fortio_fseek( fortio , 50 , SEEK_SET ); test_assert_false( fortio_read_at_eof( fortio )); fortio_fseek( fortio , 0 , SEEK_END ); test_assert_true( fortio_read_at_eof( fortio )); fortio_fclose( fortio ); } test_work_area_free( work_area );}
开发者ID:YingfangZhou,项目名称:ert,代码行数:25,
示例12: mainint main(int argc , char ** argv) { test_install_SIGNALS(); double * rseg_data = util_calloc( 100 , sizeof * rseg_data ); well_segment_collection_type * sc = well_segment_collection_alloc(); test_assert_not_NULL( sc ); test_assert_int_equal( well_segment_collection_get_size( sc ) , 0 ); { int outlet_segment_id = ECLIPSE_WELL_SEGMENT_OUTLET_END_VALUE; int branch_nr = ECLIPSE_WELL_SEGMENT_BRANCH_INACTIVE_VALUE; well_segment_type * ws = well_segment_alloc(89 , outlet_segment_id , branch_nr, rseg_data); well_segment_collection_add( sc , ws ); test_assert_int_equal( well_segment_collection_get_size( sc ) , 1); test_assert_ptr_equal( well_segment_collection_iget( sc , 0 ) , ws ); test_assert_false( well_segment_collection_has_segment( sc , 451 )); test_assert_true( well_segment_collection_has_segment( sc , 89 )); test_assert_ptr_equal( well_segment_collection_get( sc , 89 ) , ws ); } { int outlet_segment_id = ECLIPSE_WELL_SEGMENT_OUTLET_END_VALUE; int branch_nr = ECLIPSE_WELL_SEGMENT_BRANCH_INACTIVE_VALUE; well_segment_type * ws = well_segment_alloc(90 , outlet_segment_id , branch_nr , rseg_data); well_segment_collection_add( sc , ws ); test_assert_int_equal( well_segment_collection_get_size( sc ) , 2); test_assert_ptr_equal( well_segment_collection_iget( sc , 1 ) , ws ); test_assert_false( well_segment_collection_has_segment( sc , 451 )); test_assert_true( well_segment_collection_has_segment( sc , 89 )); test_assert_true( well_segment_collection_has_segment( sc , 90 )); test_assert_ptr_equal( well_segment_collection_get( sc , 90 ) , ws ); test_assert_NULL( well_segment_collection_get( sc , 76 )); } { int outlet_segment_id = ECLIPSE_WELL_SEGMENT_OUTLET_END_VALUE; int branch_nr = ECLIPSE_WELL_SEGMENT_BRANCH_INACTIVE_VALUE; well_segment_type * ws = well_segment_alloc(89 , outlet_segment_id , branch_nr, rseg_data); well_segment_collection_add( sc , ws ); test_assert_int_equal( well_segment_collection_get_size( sc ) , 2); test_assert_ptr_equal( well_segment_collection_iget( sc , 0 ) , ws ); test_assert_false( well_segment_collection_has_segment( sc , 451 )); test_assert_true( well_segment_collection_has_segment( sc , 89 )); test_assert_ptr_equal( well_segment_collection_get( sc , 89 ) , ws ); } free( rseg_data ); well_segment_collection_free( sc ); exit(0);}
开发者ID:JacobStoren,项目名称:ert,代码行数:57,
示例13: test_install_jobvoid test_install_job( const char * config_file, const char * job_file_OK , const char * job_file_ERROR) { ert_test_context_type * test_context = ert_test_context_alloc("CREATE_CONTEXT_JOB" , config_file , NULL ); test_assert_false( ert_test_context_install_workflow_job( test_context , "JOB" , "File/does/not/exist")); test_assert_false( ert_test_context_install_workflow_job( test_context , "ERROR" , job_file_ERROR)); test_assert_true( ert_test_context_install_workflow_job( test_context , "OK" , job_file_OK)); ert_test_context_free( test_context );}
开发者ID:blattms,项目名称:ert,代码行数:9,
示例14: test_wrappervoid test_wrapper( const char * filename ) { FILE * stream = util_fopen( filename , "r"); fortio_type * fortio = fortio_alloc_FILE_wrapper( filename , false , false , stream ); test_assert_not_NULL( fortio ); test_assert_false( fortio_fclose_stream( fortio )); test_assert_false( fortio_fopen_stream( fortio )); test_assert_true( fortio_stream_is_open( fortio )); fortio_free_FILE_wrapper( fortio ); fclose( stream );}
开发者ID:PETECLAM,项目名称:ResInsight,代码行数:10,
示例15: test_dimsvoid test_dims() { const int rows = 10; const int columns = 13; matrix_type * m = matrix_alloc(rows , columns); test_assert_true( matrix_check_dims(m , rows , columns)); test_assert_false( matrix_check_dims(m , rows + 1 , columns)); test_assert_false( matrix_check_dims(m , rows , columns + 1)); matrix_free( m );}
开发者ID:danielfmva,项目名称:ert,代码行数:11,
示例16: test_current_module_optionsvoid test_current_module_options() { analysis_config_type * ac = create_analysis_config( ); test_assert_NULL( analysis_config_get_active_module( ac )); analysis_config_load_internal_module(ac , "STD_ENKF" , "std_enkf_symbol_table"); test_assert_false( analysis_config_get_module_option( ac , ANALYSIS_SCALE_DATA)); test_assert_true(analysis_config_select_module(ac , "STD_ENKF")); test_assert_false( analysis_config_select_module(ac , "DOES_NOT_EXIST")); test_assert_true( analysis_module_is_instance( analysis_config_get_active_module( ac ))); test_assert_true( analysis_config_get_module_option( ac , ANALYSIS_SCALE_DATA)); test_assert_false( analysis_config_get_module_option( ac , ANALYSIS_ITERABLE)); analysis_config_free( ac );}
开发者ID:danielfmva,项目名称:ert,代码行数:14,
示例17: test_open_close_readvoid test_open_close_read( const char * filename ) { fortio_type * fortio = fortio_open_reader( filename , false , ECL_ENDIAN_FLIP); test_assert_not_NULL( fortio ); test_assert_true( fortio_stream_is_open( fortio )); test_assert_true( fortio_fclose_stream( fortio )); test_assert_false( fortio_stream_is_open( fortio )); test_assert_false( fortio_fclose_stream( fortio )); test_assert_true( fortio_fopen_stream( fortio )); test_assert_true( fortio_stream_is_open( fortio )); test_assert_false( fortio_fopen_stream( fortio )); fortio_fclose( fortio );}
开发者ID:YingfangZhou,项目名称:ert,代码行数:14,
示例18: test_contains_sortedvoid test_contains_sorted() { int_vector_type * int_vector = int_vector_alloc( 0 , 100); int_vector_append( int_vector , 99 ); int_vector_append( int_vector , 89 ); int_vector_append( int_vector , 79 ); int_vector_append( int_vector , 109 ); int_vector_sort( int_vector ); test_assert_false( int_vector_contains( int_vector , 0 )); test_assert_false( int_vector_contains( int_vector , 100 )); test_assert_true( int_vector_contains( int_vector , 89 )); test_assert_true( int_vector_contains( int_vector , 109 ));}
开发者ID:YingfangZhou,项目名称:ert,代码行数:15,
示例19: test_containsvoid test_contains() { int_vector_type * int_vector = int_vector_alloc( 0 , 100); test_assert_false( int_vector_contains( int_vector , 100 )); int_vector_iset( int_vector , 0 , 77 ); test_assert_false( int_vector_contains( int_vector , 100 )); test_assert_true( int_vector_contains( int_vector , 77 )); int_vector_iset( int_vector , 10 , 33 ); test_assert_true( int_vector_contains( int_vector , 100 )); test_assert_true( int_vector_contains( int_vector , 77 )); test_assert_true( int_vector_contains( int_vector , 33 )); int_vector_free( int_vector );}
开发者ID:YingfangZhou,项目名称:ert,代码行数:15,
示例20: test_cmp_stringvoid test_cmp_string() { ecl_kw_type * ecl_kw = ecl_kw_alloc( "HEADER" , 1 , ECL_CHAR); ecl_kw_iset_string8( ecl_kw , 0 , "ABCD"); test_assert_int_equal( 0 , strcmp( ecl_kw_iget_char_ptr( ecl_kw , 0 ) , "ABCD ")); test_assert_true(ecl_kw_icmp_string( ecl_kw , 0 , "ABCD")); test_assert_true(ecl_kw_icmp_string( ecl_kw , 0 , "ABCD ")); test_assert_true(ecl_kw_icmp_string( ecl_kw , 0 , "ABCD ")); test_assert_false( ecl_kw_icmp_string( ecl_kw , 0 , "Different")); test_assert_false( ecl_kw_icmp_string( ecl_kw , 0 , "")); test_assert_false( ecl_kw_icmp_string( ecl_kw , 0 , ""));}
开发者ID:Ensembles,项目名称:ert,代码行数:15,
示例21: mainint main(int argc , char ** argv) { test_install_SIGNALS(); { const char * grid_file = argv[1]; const char * rst_file_name = argv[2]; ecl_grid_type * grid = ecl_grid_alloc( grid_file ); ecl_file_type * rst_file = ecl_file_open( rst_file_name , 0); ecl_rsthead_type * header = ecl_rsthead_alloc( ecl_file_get_global_view( rst_file ) , ecl_util_filename_report_nr(rst_file_name) ); const char * well_name = "WELL"; int report_nr = 100; time_t valid_from = -1; bool open = false; well_type_enum type = ERT_GAS_INJECTOR; int global_well_nr = 0; bool load_segment_information = true; ecl_file_view_type * rst_view = ecl_file_get_global_view( rst_file ); for (global_well_nr = 0; global_well_nr < header->nwells; global_well_nr++) { well_state_type * well_state = well_state_alloc(well_name , global_well_nr , open , type , report_nr , valid_from); test_assert_true( well_state_is_instance( well_state) ); well_state_add_connections2( well_state , grid , rst_view , 0 ); test_assert_true( well_state_has_grid_connections( well_state , ECL_GRID_GLOBAL_GRID )); test_assert_false( well_state_has_grid_connections( well_state , "???" )); test_assert_true( well_state_has_global_connections( well_state )); well_state_add_MSW2( well_state , rst_view , global_well_nr , load_segment_information ); { const well_segment_collection_type * segments = well_state_get_segments( well_state ); const well_branch_collection_type * branches = well_state_get_branches( well_state ); if (well_state_is_MSW( well_state )) { test_assert_true( ecl_file_has_kw( rst_file , ISEG_KW )); test_assert_int_not_equal( well_segment_collection_get_size( segments ) , 0); test_assert_int_not_equal( well_branch_collection_get_size( branches ) , 0); } else { test_assert_int_equal( well_segment_collection_get_size( segments ) , 0); test_assert_int_equal( well_branch_collection_get_size( branches ) , 0); test_assert_false( well_state_is_MSW( well_state )); } } well_state_free( well_state ); } } exit(0);}
开发者ID:agchitu,项目名称:ert,代码行数:48,
示例22: create_testvoid create_test() { state_map_type * state_map = state_map_alloc(); test_assert_true( state_map_is_instance( state_map )); test_assert_int_equal( 0 , state_map_get_size( state_map )); test_assert_false( state_map_is_readonly( state_map )); state_map_free( state_map );}
开发者ID:andlaus,项目名称:ResInsight,代码行数:7,
示例23: test_fread_truncated_tailvoid test_fread_truncated_tail() { test_work_area_type * work_area = test_work_area_alloc("fortio_truncated2" ); { const size_t buffer_size = 1000; void * buffer = util_malloc( buffer_size ); { fortio_type * fortio = fortio_open_writer( "PRESSURE" , false , true ); fortio_fwrite_record( fortio , buffer , buffer_size ); fortio_fseek( fortio , 0 , SEEK_SET); util_ftruncate( fortio_get_FILE(fortio) , buffer_size + 4); fortio_fclose( fortio ); } test_assert_long_equal( util_file_size( "PRESSURE") , buffer_size + 4); { fortio_type * fortio = fortio_open_reader( "PRESSURE" , false , true ); test_assert_false( fortio_fread_buffer( fortio , buffer , buffer_size )); fortio_fclose( fortio ); } free( buffer ); } test_work_area_free( work_area );}
开发者ID:YingfangZhou,项目名称:ert,代码行数:25,
示例24: test_fread_invalid_tailvoid test_fread_invalid_tail() { test_work_area_type * work_area = test_work_area_alloc("fortio_invalid" ); int record_size = 10; void * buffer = util_malloc( record_size ); { FILE * stream = util_fopen("PRESSURE" , "w"); util_fwrite(&record_size , sizeof record_size , 1 , stream , __func__); util_fwrite(buffer , 1 , record_size , stream , __func__); util_fwrite(&record_size , sizeof record_size , 1 , stream , __func__); util_fwrite(&record_size , sizeof record_size , 1 , stream , __func__); util_fwrite(buffer , 1 , record_size , stream , __func__); record_size += 1; util_fwrite(&record_size , sizeof record_size , 1 , stream , __func__); fclose(stream); } { fortio_type * fortio = fortio_open_reader( "PRESSURE" , false , false ); record_size -= 1; test_assert_true( fortio_fread_buffer( fortio , buffer , record_size )); test_assert_false( fortio_fread_buffer( fortio , buffer , record_size )); fortio_fclose( fortio ); } free( buffer ); test_work_area_free( work_area );}
开发者ID:YingfangZhou,项目名称:ert,代码行数:30,
注:本文中的test_assert_false函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 C++ test_assert_int_equal函数代码示例 C++ test_and_set_bit函数代码示例 |