diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2010-01-15 03:05:59 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2010-01-15 03:05:59 (GMT) |
commit | 066294e32131d1d81d326d35d67b0d753e8b8b56 (patch) | |
tree | ff8ac3f4d94edceeacf167486a8a9f7adcd01d63 /test | |
parent | 22da4232a4693e3f0a4ee2f37053f85a28e885fd (diff) | |
download | hdf5-066294e32131d1d81d326d35d67b0d753e8b8b56.zip hdf5-066294e32131d1d81d326d35d67b0d753e8b8b56.tar.gz hdf5-066294e32131d1d81d326d35d67b0d753e8b8b56.tar.bz2 |
[svn-r18109] Description:
Bring r18076-18096 from hdf5_1_8_coverity branch to trunk:
r18076:
Correct Coverity issue #1 by removing dead code
r18077:
Fix coverity item 142. When an error occurred while copying a linked list in
H5S_point_copy, the library would not free the partially allocated list. Added
code to free the list in this case.
r18078:
Correct Coverity issue #2 by removing impossible to reach code.
r18079:
Correct #3 by removing impossible to reach code.
r18080:
Correct Coverity issue #4 by removing impossible to reach code.
r18081:
fix coverity 26 , check (dblik->parent) before calls H5HF_man_iblock_detach().
r18082:
Fixed coverity issues 321 and 316.
321: freed sm_buf in error handling to remove resource leak.
Also set sm_buf to NULL after other instances in which
it is freed to prevent double free.
316: initialized nmembs to 0.
r18083:
Correct Coverity issue #6 by removing debugging knob from error reporting code.
r18084:
Fix coverity item 269 + others. When a error occurred in a function using the
h5tools error framework, the "past_catch" variable would not be set to true
because that statement was before the label that goto jumped to. This could
cause a failure in the cleanup section to go back to the start of the section,
freeing variables twice, etc.
Moved the label infront of past_catch=TRUE.
r18085:
fixed coverity #27, check if (heap) before use heap->obj....
r18086:
fixed coverity #28, check curr_span not null before use it at if(curr_span &&
(io_bytes_left==0 || curr_seq>=maxseq))
r18087:
Correct Coverity issue #7 by cleaning up correctly on error
r18088:
Correct Coverity #8 by removing unchanged variable checking code.
r18089:
Correct Coverity issue #9 - remove impossible to reach code.
r18090:
Correct Coverity issue #11 by removing impossible to reach code. Also clean
up some minor style issues.
r18091:
Fix coverity items 314 and 318. Changed the improper assertion of the return
value of a library function to a check, and a return(void) on failure.
r18092:
Fix coverity item 70. Changed the improper assertion of the return value of a
library function to a check, and a return(void) on failure.
r18093:
Correct Coverity issue #12 by removing dead code.
r18094:
Correct Coverity issue #16 by removing debugging code.
r18095:
Fixed coverity issue # 271.
Removed redundant checking and freeing of sm_buf1 and sm_buf2.
r18096:
Correct Coverity issue #17 by refactoring test to remove dead code.
Also, removed previous "coverity" statements in comments, we'll review
those issues again and see if we can figure them out, now that we have more
experience with Coverity.
Tested on:
Mac OS X/32 10.6.2 (amazon)
Diffstat (limited to 'test')
-rw-r--r-- | test/cache.c | 48 | ||||
-rw-r--r-- | test/cache_api.c | 115 | ||||
-rw-r--r-- | test/cache_common.c | 43 | ||||
-rw-r--r-- | test/dt_arith.c | 229 |
4 files changed, 122 insertions, 313 deletions
diff --git a/test/cache.c b/test/cache.c index b9525ea..eeb9038 100644 --- a/test/cache.c +++ b/test/cache.c @@ -9231,7 +9231,6 @@ check_flush_cache__flush_op_test(H5C_t * cache_ptr, hbool_t show_progress = FALSE; hbool_t verbose = FALSE; herr_t result; - int target_test = -1; int i; int j; test_entry_t * base_addr; @@ -9242,11 +9241,6 @@ check_flush_cache__flush_op_test(H5C_t * cache_ptr, test_num); #endif - if ( ( target_test > 0 ) && ( test_num != target_test ) ) { - - show_progress = FALSE; - } - if ( show_progress ) { HDfprintf(stdout, "%s:%d:%d: running sanity checks on entry(1).\n", @@ -28700,9 +28694,6 @@ check_auto_cache_resize_aux_fcns(void) if ( pass ) { max_size = 0; - min_clean_size = 0; - cur_size = 0; - cur_num_entries = 0; result = H5C_get_cache_size(cache_ptr, &max_size, NULL, NULL, NULL); @@ -28717,22 +28708,12 @@ check_auto_cache_resize_aux_fcns(void) failure_mssg = "H5C_get_cache_size reports unexpected max_size 3.\n"; - } else if ( ( min_clean_size != 0 ) || - ( cur_size != 0 ) || - ( cur_num_entries != 0 ) ) { - - pass = FALSE; - failure_mssg = "Phantom returns from H5C_get_cache_size?\n"; - } } if ( pass ) { - max_size = 0; min_clean_size = 0; - cur_size = 0; - cur_num_entries = 0; result = H5C_get_cache_size(cache_ptr, NULL, &min_clean_size, NULL, NULL); @@ -28748,22 +28729,12 @@ check_auto_cache_resize_aux_fcns(void) failure_mssg = "H5C_get_cache_size reports unexpected min_clean_size 4.\n"; - } else if ( ( max_size != 0 ) || - ( cur_size != 0 ) || - ( cur_num_entries != 0 ) ) { - - pass = FALSE; - failure_mssg = "Phantom returns from H5C_get_cache_size?\n"; - } } if ( pass ) { - max_size = 0; - min_clean_size = 0; cur_size = 0; - cur_num_entries = 0; result = H5C_get_cache_size(cache_ptr, NULL, NULL, &cur_size, NULL); @@ -28779,21 +28750,11 @@ check_auto_cache_resize_aux_fcns(void) failure_mssg = "H5C_get_cache_size reports unexpected cur_size 5.\n"; - } else if ( ( max_size != 0 ) || - ( min_clean_size != 0 ) || - ( cur_num_entries != 0 ) ) { - - pass = FALSE; - failure_mssg = "Phantom returns from H5C_get_cache_size?\n"; - - } + } } if ( pass ) { - max_size = 0; - min_clean_size = 0; - cur_size = 0; cur_num_entries = 0; result = H5C_get_cache_size(cache_ptr, NULL, NULL, NULL, @@ -28810,13 +28771,6 @@ check_auto_cache_resize_aux_fcns(void) failure_mssg = "H5C_get_cache_size reports unexpected cur_num_entries 2.\n"; - } else if ( ( max_size != 0 ) || - ( min_clean_size != 0 ) || - ( cur_size != 0 ) ) { - - pass = FALSE; - failure_mssg = "Phantom returns from H5C_get_cache_size?\n"; - } } diff --git a/test/cache_api.c b/test/cache_api.c index ad5c823..ee17037 100644 --- a/test/cache_api.c +++ b/test/cache_api.c @@ -1381,7 +1381,6 @@ mdc_api_call_smoke_check(int express_test) const char * fcn_name = "mdc_api_call_smoke_check()"; char filename[512]; hbool_t valid_chunk; - hbool_t report_progress = FALSE; hbool_t dump_hit_rate = FALSE; int64_t min_accesses = 1000; double min_hit_rate = 0.90; @@ -1524,13 +1523,6 @@ mdc_api_call_smoke_check(int express_test) */ /* setup the file name */ - - if ( ( pass ) && ( report_progress ) ) { - - HDfprintf(stdout,"\nSetting up file ... "); - HDfflush(stdout); - } - if ( pass ) { if ( h5_fixname(FILENAME[0], H5P_DEFAULT, filename, sizeof(filename)) @@ -1569,21 +1561,7 @@ mdc_api_call_smoke_check(int express_test) /* verify that the cache is now set to the alternate config */ validate_mdc_config(file_id, &mod_config_1, TRUE, 2); - if ( ( pass ) && ( report_progress ) ) { - - HDfprintf(stdout,"Done.\n"); /* setting up file */ - HDfflush(stdout); - } - - /* create the datasets */ - - if ( ( pass ) && ( report_progress ) ) { - - HDfprintf(stdout,"Creating datasets ... "); - HDfflush(stdout); - } - if ( pass ) { i = 0; @@ -1688,22 +1666,10 @@ mdc_api_call_smoke_check(int express_test) } } - if ( ( pass ) && ( report_progress ) ) { - - HDfprintf(stdout,"Done.\n"); - HDfflush(stdout); - } - /* initialize all datasets on a round robin basis */ i = 0; progress_counter = 0; - if ( ( pass ) && ( report_progress ) ) { - - HDfprintf(stdout, "Initializing datasets "); - HDfflush(stdout); - } - while ( ( pass ) && ( i < DSET_SIZE ) ) { j = 0; @@ -1770,23 +1736,6 @@ mdc_api_call_smoke_check(int express_test) i += CHUNK_SIZE; - if ( ( pass ) && ( report_progress ) ) { - - progress_counter += CHUNK_SIZE; - - if ( progress_counter >= DSET_SIZE / 20 ) { - - progress_counter = 0; - HDfprintf(stdout, "."); - HDfflush(stdout); - } - } - } - - if ( ( pass ) && ( report_progress ) ) { - - HDfprintf(stdout," Done.\n"); /* initializing data sets */ - HDfflush(stdout); } /* set alternate config 2 */ @@ -1803,13 +1752,6 @@ mdc_api_call_smoke_check(int express_test) validate_mdc_config(file_id, &mod_config_2, TRUE, 3); /* do random reads on all datasets */ - - if ( ( pass ) && ( report_progress ) ) { - - HDfprintf(stdout, "Doing random reads on all datasets "); - HDfflush(stdout); - } - n = 0; progress_counter = 0; while ( ( pass ) && ( n < NUM_RANDOM_ACCESSES ) ) @@ -1895,26 +1837,8 @@ mdc_api_call_smoke_check(int express_test) n++; - if ( ( pass ) && ( report_progress ) ) { - - progress_counter++; - - if ( progress_counter >= NUM_RANDOM_ACCESSES / 20 ) { - - progress_counter = 0; - HDfprintf(stdout, "."); - HDfflush(stdout); - } - } - } - - if ( ( pass ) && ( report_progress ) ) { - - HDfprintf(stdout, " Done.\n"); /* random reads on all data sets */ - HDfflush(stdout); } - /* close the file spaces we are done with */ i = 1; while ( ( pass ) && ( i < NUM_DSETS ) ) @@ -1954,13 +1878,6 @@ mdc_api_call_smoke_check(int express_test) validate_mdc_config(file_id, &mod_config_3, TRUE, 4); /* do random reads on data set 0 only */ - - if ( ( pass ) && ( report_progress ) ) { - - HDfprintf(stdout, "Doing random reads on dataset 0 "); - HDfflush(stdout); - } - m = 0; n = 0; progress_counter = 0; @@ -2042,33 +1959,8 @@ mdc_api_call_smoke_check(int express_test) n++; - if ( ( pass ) && ( report_progress ) ) { - - progress_counter++; - - if ( progress_counter >= NUM_RANDOM_ACCESSES / 20 ) { - - progress_counter = 0; - HDfprintf(stdout, "."); - HDfflush(stdout); - } - } - } - - if ( ( pass ) && ( report_progress ) ) { - - HDfprintf(stdout, " Done.\n"); /* random reads data set 0 */ - HDfflush(stdout); - } - - - if ( ( pass ) && ( report_progress ) ) { - - HDfprintf(stdout,"Shutting down ... "); - HDfflush(stdout); } - /* close file space 0 */ if ( pass ) { @@ -2125,13 +2017,6 @@ mdc_api_call_smoke_check(int express_test) } } - if ( ( pass ) && ( report_progress ) ) { - - HDfprintf(stdout,"Done.\n"); /* shutting down */ - HDfflush(stdout); - } - - if ( pass ) { PASSED(); } else { H5_FAILED(); } if ( ! pass ) diff --git a/test/cache_common.c b/test/cache_common.c index 4768f53..c4e4fe9 100644 --- a/test/cache_common.c +++ b/test/cache_common.c @@ -3634,7 +3634,6 @@ unprotect_entry_with_size_change(H5C_t * cache_ptr, hbool_t pin_flag_set; hbool_t unpin_flag_set; hbool_t size_changed_flag_set; - hbool_t verbose = FALSE; test_entry_t * base_addr; test_entry_t * entry_ptr; @@ -3685,39 +3684,25 @@ unprotect_entry_with_size_change(H5C_t * cache_ptr, ( entry_ptr->size != entry_ptr->header.size ) || ( entry_ptr->addr != entry_ptr->header.addr ) ) { - if ( verbose ) { + if ( result < 0 ) + HDfprintf(stdout, "%s: H5C_unprotect() failed.\n", fcn_name); - if ( result < 0 ) { - HDfprintf(stdout, "%s: H5C_unprotect() failed.\n", fcn_name); - } + if ( entry_ptr->header.is_protected ) + HDfprintf(stdout, "%s: entry still protected?!?.\n", fcn_name); - if ( entry_ptr->header.is_protected ) { - HDfprintf(stdout, "%s: entry still protected?!?.\n", - fcn_name); - } + if ( entry_ptr->header.type != &(types[type]) ) + HDfprintf(stdout, "%s: entry has bad type after unprotect.\n", fcn_name); - if ( entry_ptr->header.type != &(types[type]) ) { - HDfprintf(stdout, - "%s: entry has bad type after unprotect.\n", - fcn_name); - } + if ( entry_ptr->size != entry_ptr->header.size ) + HDfprintf(stdout, "%s: bad entry size after unprotect. e/a = %d/%d\n", fcn_name, + (int)(entry_ptr->size), + (int)(entry_ptr->header.size)); - if ( entry_ptr->size != entry_ptr->header.size ) { - HDfprintf(stdout, - "%s: bad entry size after unprotect. e/a = %d/%d\n", - fcn_name, - (int)(entry_ptr->size), - (int)(entry_ptr->header.size)); - } + if ( entry_ptr->addr != entry_ptr->header.addr ) + HDfprintf(stdout, "%s: bad entry addr after unprotect. e/a = 0x%llx/0x%llx\n", fcn_name, + (long long)(entry_ptr->addr), + (long long)(entry_ptr->header.addr)); - if ( entry_ptr->addr != entry_ptr->header.addr ) { - HDfprintf(stdout, - "%s: bad entry addr after unprotect. e/a = 0x%llx/0x%llx\n", - fcn_name, - (long long)(entry_ptr->addr), - (long long)(entry_ptr->header.addr)); - } - } pass = FALSE; failure_mssg = "error in H5C_unprotect()."; diff --git a/test/dt_arith.c b/test/dt_arith.c index 420570a..13cf5ba 100644 --- a/test/dt_arith.c +++ b/test/dt_arith.c @@ -5001,192 +5001,177 @@ run_int_fp_conv(const char *name) static int run_fp_int_conv(const char *name) { +#ifdef H5_FP_TO_INTEGER_OVERFLOW_WORKS int nerrors = 0; int test_values; - int i; - int run_test = TRUE; -#ifndef H5_FP_TO_INTEGER_OVERFLOW_WORKS - /* For Cray X1, the compiler generates floating exception when the - * conversion overflows. So disable all of the conversions from - * floating-point numbers to integers. - */ - run_test = FALSE; -#endif - -#ifdef H5_VMS - run_test = TRUE; -#endif - - if(run_test) { #ifdef H5_VMS - test_values = TEST_NORMAL; - { + test_values = TEST_NORMAL; #else - for(i=0; i<3; i++) { - if(i==0) - test_values = TEST_NORMAL; - else if(i==1) - test_values = TEST_DENORM; - else - test_values = TEST_SPECIAL; + for(test_values = TEST_NORMAL; test_values <= TEST_SPECIAL; test_values++) { #endif /*H5_VMS*/ - nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_FLOAT, H5T_NATIVE_SCHAR); - nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_DOUBLE, H5T_NATIVE_SCHAR); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_FLOAT, H5T_NATIVE_SCHAR); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_DOUBLE, H5T_NATIVE_SCHAR); - nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_FLOAT, H5T_NATIVE_UCHAR); - nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_DOUBLE, H5T_NATIVE_UCHAR); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_FLOAT, H5T_NATIVE_UCHAR); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_DOUBLE, H5T_NATIVE_UCHAR); - nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_FLOAT, H5T_NATIVE_SHORT); - nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_DOUBLE, H5T_NATIVE_SHORT); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_FLOAT, H5T_NATIVE_SHORT); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_DOUBLE, H5T_NATIVE_SHORT); - nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_FLOAT, H5T_NATIVE_USHORT); - nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_DOUBLE, H5T_NATIVE_USHORT); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_FLOAT, H5T_NATIVE_USHORT); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_DOUBLE, H5T_NATIVE_USHORT); - nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_FLOAT, H5T_NATIVE_INT); - nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_DOUBLE, H5T_NATIVE_INT); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_FLOAT, H5T_NATIVE_INT); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_DOUBLE, H5T_NATIVE_INT); - nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_FLOAT, H5T_NATIVE_UINT); - nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_DOUBLE, H5T_NATIVE_UINT); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_FLOAT, H5T_NATIVE_UINT); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_DOUBLE, H5T_NATIVE_UINT); #if H5_SIZEOF_LONG!=H5_SIZEOF_INT - nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_FLOAT, H5T_NATIVE_LONG); - nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_DOUBLE, H5T_NATIVE_LONG); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_FLOAT, H5T_NATIVE_LONG); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_DOUBLE, H5T_NATIVE_LONG); - nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_FLOAT, H5T_NATIVE_ULONG); - nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_DOUBLE, H5T_NATIVE_ULONG); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_FLOAT, H5T_NATIVE_ULONG); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_DOUBLE, H5T_NATIVE_ULONG); #endif #if H5_SIZEOF_LONG_LONG!=H5_SIZEOF_LONG - if(!strcmp(name, "hw")) { /* Hardware conversion */ - /* Windows .NET 2003 doesn't work for hardware conversion of this case. - * .NET should define this macro H5_HW_FP_TO_LLONG_NOT_WORKS. */ + if(!strcmp(name, "hw")) { /* Hardware conversion */ + /* Windows .NET 2003 doesn't work for hardware conversion of this case. + * .NET should define this macro H5_HW_FP_TO_LLONG_NOT_WORKS. */ #ifndef H5_HW_FP_TO_LLONG_NOT_WORKS - nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_FLOAT, H5T_NATIVE_LLONG); - nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_DOUBLE, H5T_NATIVE_LLONG); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_FLOAT, H5T_NATIVE_LLONG); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_DOUBLE, H5T_NATIVE_LLONG); #endif /*H5_HW_FP_TO_LLONG_NOT_WORKS*/ - } else { /* Software conversion */ - nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_FLOAT, H5T_NATIVE_LLONG); - nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_DOUBLE, H5T_NATIVE_LLONG); - } + } else { /* Software conversion */ + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_FLOAT, H5T_NATIVE_LLONG); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_DOUBLE, H5T_NATIVE_LLONG); + } #ifdef H5_FP_TO_ULLONG_RIGHT_MAXIMUM - nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_FLOAT, H5T_NATIVE_ULLONG); - nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_DOUBLE, H5T_NATIVE_ULLONG); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_FLOAT, H5T_NATIVE_ULLONG); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_DOUBLE, H5T_NATIVE_ULLONG); #else /*H5_FP_TO_ULLONG_RIGHT_MAXIMUM*/ - { - char str[256]; /*hello string */ - - sprintf(str, "Testing %s %s -> %s conversions", - name, "float", "unsigned long long"); - printf("%-70s", str); - SKIPPED(); - HDputs(" Test skipped due to hardware conversion error."); - - sprintf(str, "Testing %s %s -> %s conversions", - name, "double", "unsigned long long"); - printf("%-70s", str); - SKIPPED(); - HDputs(" Test skipped due to hardware conversion error."); - } + { + char str[256]; /*hello string */ + + sprintf(str, "Testing %s %s -> %s conversions", + name, "float", "unsigned long long"); + printf("%-70s", str); + SKIPPED(); + HDputs(" Test skipped due to hardware conversion error."); + + sprintf(str, "Testing %s %s -> %s conversions", + name, "double", "unsigned long long"); + printf("%-70s", str); + SKIPPED(); + HDputs(" Test skipped due to hardware conversion error."); + } #endif /*H5_FP_TO_ULLONG_RIGHT_MAXIMUM*/ #endif #if H5_LDOUBLE_TO_INTEGER_WORKS && H5_LDOUBLE_TO_INTEGER_ACCURATE #if H5_SIZEOF_LONG_DOUBLE!=H5_SIZEOF_DOUBLE - nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_SCHAR); - nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_UCHAR); - nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_SHORT); - nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_USHORT); - nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_INT); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_SCHAR); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_UCHAR); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_SHORT); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_USHORT); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_INT); #if H5_LDOUBLE_TO_UINT_ACCURATE - nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_UINT); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_UINT); #else /*H5_LDOUBLE_TO_UINT_ACCURATE*/ - { - char str[256]; /*string */ + { + char str[256]; /*string */ - sprintf(str, "Testing %s %s -> %s conversions", - name, "long double", "unsigned int"); - printf("%-70s", str); - SKIPPED(); + sprintf(str, "Testing %s %s -> %s conversions", + name, "long double", "unsigned int"); + printf("%-70s", str); + SKIPPED(); #if H5_SIZEOF_LONG_DOUBLE!=0 - HDputs(" Test skipped due to hardware conversion error."); + HDputs(" Test skipped due to hardware conversion error."); #else - HDputs(" Test skipped due to disabled long double."); + HDputs(" Test skipped due to disabled long double."); #endif - } + } #endif /*H5_LDOUBLE_TO_UINT_ACCURATE*/ #if H5_SIZEOF_LONG!=H5_SIZEOF_INT && H5_SIZEOF_LONG_DOUBLE!=0 - nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_LONG); - nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_ULONG); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_LONG); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_ULONG); #endif #if H5_SIZEOF_LONG_LONG!=H5_SIZEOF_LONG && H5_SIZEOF_LONG_DOUBLE!=0 #ifdef H5_LDOUBLE_TO_LLONG_ACCURATE - nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_LLONG); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_LLONG); #else /*H5_LDOUBLE_TO_LLONG_ACCURATE*/ - { - char str[256]; /*string */ + { + char str[256]; /*string */ - sprintf(str, "Testing %s %s -> %s conversions", - name, "long double", "long long"); - printf("%-70s", str); - SKIPPED(); + sprintf(str, "Testing %s %s -> %s conversions", + name, "long double", "long long"); + printf("%-70s", str); + SKIPPED(); #if H5_SIZEOF_LONG_DOUBLE!=0 - HDputs(" Test skipped due to hardware conversion error."); + HDputs(" Test skipped due to hardware conversion error."); #else - HDputs(" Test skipped due to disabled long double."); + HDputs(" Test skipped due to disabled long double."); #endif - } + } #endif /*H5_LDOUBLE_TO_LLONG_ACCURATE*/ #if defined(H5_FP_TO_ULLONG_RIGHT_MAXIMUM) && defined(H5_LDOUBLE_TO_LLONG_ACCURATE) - nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_ULLONG); + nerrors += test_conv_int_fp(name, test_values, H5T_NATIVE_LDOUBLE, H5T_NATIVE_ULLONG); #else /*H5_FP_TO_ULLONG_RIGHT_MAXIMUM && H5_LDOUBLE_TO_LLONG_ACCURATE*/ - { - char str[256]; /*string */ + { + char str[256]; /*string */ - sprintf(str, "Testing %s %s -> %s conversions", - name, "long double", "unsigned long long"); - printf("%-70s", str); - SKIPPED(); + sprintf(str, "Testing %s %s -> %s conversions", + name, "long double", "unsigned long long"); + printf("%-70s", str); + SKIPPED(); #if H5_SIZEOF_LONG_DOUBLE!=0 - HDputs(" Test skipped due to hardware conversion error."); + HDputs(" Test skipped due to hardware conversion error."); #else - HDputs(" Test skipped due to disabled long double."); + HDputs(" Test skipped due to disabled long double."); #endif - } + } #endif /*H5_FP_TO_ULLONG_RIGHT_MAXIMUM && H5_LDOUBLE_TO_LLONG_ACCURATE*/ #endif #endif #else /*H5_LDOUBLE_TO_INTEGER_WORKS && H5_LDOUBLE_TO_INTEGER_ACCURATE*/ - { - char str[256]; /*hello string */ + { + char str[256]; /*hello string */ - sprintf(str, "Testing %s %s -> %s conversions", - name, "long double", "all integers"); - printf("%-70s", str); - SKIPPED(); + sprintf(str, "Testing %s %s -> %s conversions", + name, "long double", "all integers"); + printf("%-70s", str); + SKIPPED(); #if H5_SIZEOF_LONG_DOUBLE!=0 - HDputs(" Test skipped due to hardware conversion error."); + HDputs(" Test skipped due to hardware conversion error."); #else - HDputs(" Test skipped due to disabled long double."); + HDputs(" Test skipped due to disabled long double."); #endif - } -#endif /*H5_LDOUBLE_TO_INTEGER_WORKS && H5_LDOUBLE_TO_INTEGER_ACCURATE*/ } - } else { - char str[256]; /*string */ +#endif /*H5_LDOUBLE_TO_INTEGER_WORKS && H5_LDOUBLE_TO_INTEGER_ACCURATE*/ +#ifndef H5_VMS + } /* end for */ +#endif /* H5_VMS */ +#else /* H5_FP_TO_INTEGER_OVERFLOW_WORKS */ +/* For Cray X1, the compiler generates floating exception when the + * conversion overflows. So disable all of the conversions from + * floating-point numbers to integers. + */ + char str[256]; /*string */ - sprintf(str, "Testing %s %s -> %s conversions", - name, "all floating-point numbers", "all integers"); - printf("%-70s", str); - SKIPPED(); + sprintf(str, "Testing %s %s -> %s conversions", + name, "all floating-point numbers", "all integers"); + printf("%-70s", str); + SKIPPED(); #if H5_SIZEOF_LONG_DOUBLE!=0 - HDputs(" Test skipped due to hardware conversion error."); + HDputs(" Test skipped due to hardware conversion error."); #else - HDputs(" Test skipped due to disbaled long double."); + HDputs(" Test skipped due to disbaled long double."); #endif - } +#endif /* H5_FP_TO_INTEGER_OVERFLOW_WORKS */ return nerrors; } |