From 526bcc242d03a6fc4fd28d3a0f68cc31f4f2a850 Mon Sep 17 00:00:00 2001 From: "Frank.Willmore" Date: Tue, 25 Oct 2016 09:53:44 -0500 Subject: Changes to be committed: modified: bittests.c modified: cmpd_dset.c modified: dsets.c modified: dt_arith.c modified: dtypes.c modified: extend.c modified: fillval.c modified: filter_fail.c modified: flush1.c modified: gen_cross.c modified: hyperslab.c modified: istore.c modified: links.c modified: links_env.c modified: objcopy.c modified: plugin.c modified: tcheck_version.c modified: unlink.c modified: unregister.c Minor fixes to replace numeric exit codes with MACRO declarations. Not all codes found were boolean, and those cases were not changed. --- test/bittests.c | 2 +- test/cmpd_dset.c | 4 ++-- test/dsets.c | 4 ++-- test/dt_arith.c | 10 +++++----- test/dtypes.c | 2 +- test/extend.c | 2 +- test/fillval.c | 2 +- test/filter_fail.c | 6 +++--- test/flush1.c | 10 +++++----- test/gen_cross.c | 4 ++-- test/hyperslab.c | 8 ++++---- test/istore.c | 10 +++++----- test/links.c | 6 +++--- test/links_env.c | 6 +++--- test/objcopy.c | 2 +- test/plugin.c | 4 ++-- test/tcheck_version.c | 8 ++++---- test/unlink.c | 2 +- test/unregister.c | 4 ++-- 19 files changed, 48 insertions(+), 48 deletions(-) diff --git a/test/bittests.c b/test/bittests.c index 38e419d..cf83ead 100644 --- a/test/bittests.c +++ b/test/bittests.c @@ -932,7 +932,7 @@ main(void) if(nerrors) { printf("***** %u FAILURE%s! *****\n", nerrors, 1 == nerrors ? "" : "S"); - exit(1); + exit(EXIT_FAILURE); } printf("All bit tests passed.\n"); diff --git a/test/cmpd_dset.c b/test/cmpd_dset.c index a7f3902..b44a847 100644 --- a/test/cmpd_dset.c +++ b/test/cmpd_dset.c @@ -2219,7 +2219,7 @@ main (int argc, char *argv[]) if (argc>1) { if (argc>2 || strcmp("--noopt", argv[1])) { fprintf(stderr, "usage: %s [--noopt]\n", argv[0]); - exit(1); + exit(EXIT_FAILURE); } H5Tunregister(H5T_PERS_DONTCARE, NULL, (hid_t)-1, (hid_t)-1, H5T__conv_struct_opt); } @@ -2252,7 +2252,7 @@ main (int argc, char *argv[]) if (nerrors) { printf("***** %u FAILURE%s! *****\n", nerrors, 1==nerrors?"":"S"); - HDexit(1); + HDexit(EXIT_FAILURE); } h5_cleanup(FILENAME, fapl_id); diff --git a/test/dsets.c b/test/dsets.c index 16c233f..7d9f331 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -12008,9 +12008,9 @@ error: * * Purpose: Tests the dataset interface (H5D) * - * Return: Success: exit(0) + * Return: Success: exit(EXIT_SUCCESS) * - * Failure: exit(1) + * Failure: exit(EXIT_FAILURE) * * Programmer: Robb Matzke * Tuesday, December 9, 1997 diff --git a/test/dt_arith.c b/test/dt_arith.c index 1ebcf74..c5c14c87 100644 --- a/test/dt_arith.c +++ b/test/dt_arith.c @@ -567,7 +567,7 @@ generates_sigfpe(void) HDfflush(stderr); if ((pid=fork()) < 0) { HDperror("fork"); - HDexit(1); + HDexit(EXIT_FAILURE); } else if (0==pid) { for (i=0; i<2000; i++) { for(j = 0; j < sizeof(double); j++) @@ -575,7 +575,7 @@ generates_sigfpe(void) f = (float)d; some_dummy_func((float)f); } - HDexit(0); + HDexit(EXIT_SUCCESS); } while (pid!=waitpid(pid, &status, 0)) @@ -3346,7 +3346,7 @@ done: if(run_test==TEST_NOOP || run_test==TEST_NORMAL) HDexit(MIN((int)fails_all_tests, 254)); else if(run_test==TEST_DENORM || run_test==TEST_SPECIAL) - HDexit(0); + HDexit(EXIT_SUCCESS); HDassert(0 && "Should not reach this point!"); return 1; #else @@ -3372,7 +3372,7 @@ error: if(run_test==TEST_NOOP || run_test==TEST_NORMAL) HDexit(MIN(MAX((int)fails_all_tests, 1), 254)); else if(run_test==TEST_DENORM || run_test==TEST_SPECIAL) - HDexit(1); + HDexit(EXIT_FAILURE); HDassert(0 && "Should not reach this point!"); return 1; #else @@ -5251,7 +5251,7 @@ main(void) if (nerrors) { printf("***** %lu FAILURE%s! *****\n", nerrors, 1==nerrors?"":"S"); - HDexit(1); + HDexit(EXIT_FAILURE); } printf("All data type tests passed.\n"); return 0; diff --git a/test/dtypes.c b/test/dtypes.c index f247bd9..c3a8066 100644 --- a/test/dtypes.c +++ b/test/dtypes.c @@ -7479,7 +7479,7 @@ main(void) if(nerrors) { printf("***** %lu FAILURE%s! *****\n", nerrors, 1==nerrors?"":"S"); - HDexit(1); + HDexit(EXIT_FAILURE); } printf("All datatype tests passed.\n"); diff --git a/test/extend.c b/test/extend.c index 5951e69..68f0d7c 100644 --- a/test/extend.c +++ b/test/extend.c @@ -292,7 +292,7 @@ main (void) if(nerrors) { printf("***** %d FAILURE%s! *****\n", nerrors, (1 == nerrors) ? "" : "S"); - exit(1); + exit(EXIT_FAILURE); } /* end if */ printf("All extend tests passed.\n"); diff --git a/test/fillval.c b/test/fillval.c index 3f713e9..4f7adc1 100644 --- a/test/fillval.c +++ b/test/fillval.c @@ -2383,7 +2383,7 @@ main(int argc, char *argv[]) test_compact =1; else { fprintf(stderr, "usage: %s [contiguous] [chunked] [compact]\n", argv[0]); - exit(1); + exit(EXIT_FAILURE); } } /* end for */ } /* end if */ diff --git a/test/filter_fail.c b/test/filter_fail.c index c7248cc..f165d8a 100644 --- a/test/filter_fail.c +++ b/test/filter_fail.c @@ -349,8 +349,8 @@ error: * Purpose: Tests the library's behavior when a mandate filter returns * failure. * - * Return: Success: exit(0) - * Failure: exit(1) + * Return: Success: exit(EXIT_SUCCESS) + * Failure: exit(EXIT_FAILURE) * * Programmer: Raymond Lu * 25 August 2010 @@ -406,6 +406,6 @@ error: if (nerrors) { printf("***** %u FAILURE%s! *****\n", nerrors, 1==nerrors?"":"S"); - HDexit(1); + HDexit(EXIT_FAILURE); } } diff --git a/test/flush1.c b/test/flush1.c index f1169ea..64d072a 100644 --- a/test/flush1.c +++ b/test/flush1.c @@ -20,7 +20,7 @@ * Purpose: This is the first half of a two-part test that makes sure * that a file can be read after an application crashes as long * as the file was flushed first. We simulate a crash by - * calling _exit(0) since this doesn't flush HDF5 caches but + * calling _exit(EXIT_SUCCESS) since this doesn't flush HDF5 caches but * still exits with success. */ #include "h5test.h" @@ -83,7 +83,7 @@ create_file(char* name, hid_t fapl) return file; error: - HD_exit(1); + HD_exit(EXIT_FAILURE); } @@ -127,7 +127,7 @@ extend_file(hid_t file) return file; error: - HD_exit(1); + HD_exit(EXIT_FAILURE); } /*------------------------------------------------------------------------- @@ -185,10 +185,10 @@ main(void) fflush(stdout); fflush(stderr); - HD_exit(0); + HD_exit(EXIT_SUCCESS); error: - HD_exit(1); + HD_exit(EXIT_FAILURE); return 1; } diff --git a/test/gen_cross.c b/test/gen_cross.c index d7c424a..af39f69 100644 --- a/test/gen_cross.c +++ b/test/gen_cross.c @@ -1260,8 +1260,8 @@ error: * * Purpose: Create a file for cross_read.c test. * - * Return: Success: exit(0) - * Failure: exit(1) + * Return: Success: exit(EXIT_SUCCESS) + * Failure: exit(EXIT_FAILURE) * * Programmer: Raymond Lu * Some time ago diff --git a/test/hyperslab.c b/test/hyperslab.c index 9ba5731..065d001 100644 --- a/test/hyperslab.c +++ b/test/hyperslab.c @@ -1188,9 +1188,9 @@ error: * `small' and/or `medium' on the command line or only `small' * is assumed. * - * Return: Success: exit(0) + * Return: Success: exit(EXIT_SUCCESS) * - * Failure: exit(non-zero) + * Failure: exit(EXIT_FAILURE) * * Programmer: Robb Matzke * Friday, October 10, 1997 @@ -1217,7 +1217,7 @@ main(int argc, char *argv[]) size_of_test |= TEST_MEDIUM; else { printf("unrecognized argument: %s\n", argv[i]); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end else */ } /* end for */ } /* end else */ @@ -1437,7 +1437,7 @@ main(int argc, char *argv[]) == nerrors ? "" : "S"); if(HDisatty(1)) printf("(Redirect output to a pager or a file to see debug output)\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ printf("All hyperslab tests passed.\n"); diff --git a/test/istore.c b/test/istore.c index 68668d8..f6b83c9 100644 --- a/test/istore.c +++ b/test/istore.c @@ -585,9 +585,9 @@ error: * * Purpose: Tests indexed storage stuff. * - * Return: Success: exit(0) + * Return: Success: exit(EXIT_SUCCESS) * - * Failure: exit(non-zero) + * Failure: exit(EXIT_FAILURE) * * Programmer: Robb Matzke * Wednesday, October 15, 1997 @@ -623,7 +623,7 @@ main(int argc, char *argv[]) } else { printf("unrecognized argument: %s\n", argv[i]); #if 0 - exit(1); + exit(EXIT_FAILURE); #endif } } @@ -658,7 +658,7 @@ main(int argc, char *argv[]) h5_fixname(FILENAME[0], fapl, filename, sizeof filename); if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) { printf("Cannot create file %s; test aborted\n", filename); - exit(1); + exit(EXIT_FAILURE); } /* Initialize chunk dimensions */ @@ -726,7 +726,7 @@ main(int argc, char *argv[]) if (nerrors) { printf("***** %d I-STORE TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S"); - exit(1); + exit(EXIT_FAILURE); } printf("All i-store tests passed.\n"); diff --git a/test/links.c b/test/links.c index f60a88a..2c841f0 100644 --- a/test/links.c +++ b/test/links.c @@ -14771,9 +14771,9 @@ error: * * Purpose: Test links * - * Return: Success: exit(0) + * Return: Success: exit(EXIT_SUCCESS) * - * Failure: exit(non-zero) + * Failure: exit(EXIT_FAILURE) * * Programmer: Robb Matzke * Friday, August 14, 1998 @@ -14973,7 +14973,7 @@ main(void) if(nerrors) { printf("***** %d LINK TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S"); - HDexit(1); + HDexit(EXIT_FAILURE); } printf("All link tests passed.\n"); diff --git a/test/links_env.c b/test/links_env.c index b9ecafa..efc7c1e 100644 --- a/test/links_env.c +++ b/test/links_env.c @@ -138,8 +138,8 @@ external_link_env(hid_t fapl, hbool_t new_format) * * Purpose: Test external link with environment variable HDF5_EXT_PREFIX * - * Return: Success: exit(0) - * Failure: exit(non-zero) + * Return: Success: exit(EXIT_SUCCESS) + * Failure: exit(EXIT_FAILURE) * * Programmer: Vailin Choi; Nov 2010 * @@ -175,7 +175,7 @@ main(void) if(nerrors) { HDprintf("***** %d External Link (HDF5_EXT_PREFIX) test%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "s"); - HDexit(1); + HDexit(EXIT_FAILURE); } HDprintf("All external Link (HDF5_EXT_PREFIX) tests passed.\n"); diff --git a/test/objcopy.c b/test/objcopy.c index f4b1561..7f5a9ba 100644 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -13827,7 +13827,7 @@ main(void) if(nerrors) { printf("***** %d OBJECT COPY TEST%s FAILED! *****\n", nerrors, (1 == nerrors ? "" : "S")); - exit(1); + exit(EXIT_FAILURE); } /* end if */ puts ("All object copying tests passed."); diff --git a/test/plugin.c b/test/plugin.c index 3086e90..a70e885 100644 --- a/test/plugin.c +++ b/test/plugin.c @@ -733,9 +733,9 @@ error: * * Purpose: Tests the plugin module (H5PL) * - * Return: Success: exit(0) + * Return: Success: exit(EXIT_SUCCESS) * - * Failure: exit(1) + * Failure: exit(EXIT_FAILURE) * * Programmer: Raymond Lu * 14 March 2013 diff --git a/test/tcheck_version.c b/test/tcheck_version.c index 1abab69..5808680 100644 --- a/test/tcheck_version.c +++ b/test/tcheck_version.c @@ -65,7 +65,7 @@ parse(int ac, char **av) pt = *(++av); if (*pt != '-') { fprintf(stderr, "Unknown option(%s). Aborted.\n", *av); - exit(1); + exit(EXIT_FAILURE); }else{ switch(*(++pt)) { case 't': /* option -t */ @@ -81,15 +81,15 @@ parse(int ac, char **av) break; default: fprintf(stderr, "Unknown -v parameter (%s). Aborted.\n", *av); - exit(1); + exit(EXIT_FAILURE); } break; case 'h': /* help page */ showhelp(); - exit(0); + exit(EXIT_SUCCESS); default: fprintf(stderr, "Unknown option(%s). Aborted.\n", *av); - exit(1); + exit(EXIT_FAILURE); } } } diff --git a/test/unlink.c b/test/unlink.c index 9222596..660a155 100644 --- a/test/unlink.c +++ b/test/unlink.c @@ -2553,7 +2553,7 @@ main(void) if (nerrors) { printf("***** %d FAILURE%s! *****\n", nerrors, 1==nerrors?"":"S"); - exit(1); + exit(EXIT_FAILURE); } puts("All unlink tests passed."); diff --git a/test/unregister.c b/test/unregister.c index be40383..878270f 100644 --- a/test/unregister.c +++ b/test/unregister.c @@ -218,9 +218,9 @@ error: * * Purpose: Tests unregistering filter with H5Zunregister * - * Return: Success: exit(0) + * Return: Success: exit(EXIT_SUCCESS) * - * Failure: exit(1) + * Failure: exit(EXIT_FAILURE) * * Programmer: Raymond Lu * 11 April 2013 -- cgit v0.12