Merge pull request #100 in HDFFV/hdf5 from ~FRANK.WILLMORE/hdf5:HDFFV-8882-replace-numeric-exit-code-with to develop

* commit '526bcc242d03a6fc4fd28d3a0f68cc31f4f2a850':
  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
This commit is contained in:
Frank Willmore 2016-11-03 16:28:29 -05:00
commit b2948d9f97
19 changed files with 48 additions and 48 deletions

View File

@ -932,7 +932,7 @@ main(void)
if(nerrors) { if(nerrors) {
printf("***** %u FAILURE%s! *****\n", printf("***** %u FAILURE%s! *****\n",
nerrors, 1 == nerrors ? "" : "S"); nerrors, 1 == nerrors ? "" : "S");
exit(1); exit(EXIT_FAILURE);
} }
printf("All bit tests passed.\n"); printf("All bit tests passed.\n");

View File

@ -2219,7 +2219,7 @@ main (int argc, char *argv[])
if (argc>1) { if (argc>1) {
if (argc>2 || strcmp("--noopt", argv[1])) { if (argc>2 || strcmp("--noopt", argv[1])) {
fprintf(stderr, "usage: %s [--noopt]\n", argv[0]); 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); 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) { if (nerrors) {
printf("***** %u FAILURE%s! *****\n", printf("***** %u FAILURE%s! *****\n",
nerrors, 1==nerrors?"":"S"); nerrors, 1==nerrors?"":"S");
HDexit(1); HDexit(EXIT_FAILURE);
} }
h5_cleanup(FILENAME, fapl_id); h5_cleanup(FILENAME, fapl_id);

View File

@ -12008,9 +12008,9 @@ error:
* *
* Purpose: Tests the dataset interface (H5D) * 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 * Programmer: Robb Matzke
* Tuesday, December 9, 1997 * Tuesday, December 9, 1997

View File

@ -567,7 +567,7 @@ generates_sigfpe(void)
HDfflush(stderr); HDfflush(stderr);
if ((pid=fork()) < 0) { if ((pid=fork()) < 0) {
HDperror("fork"); HDperror("fork");
HDexit(1); HDexit(EXIT_FAILURE);
} else if (0==pid) { } else if (0==pid) {
for (i=0; i<2000; i++) { for (i=0; i<2000; i++) {
for(j = 0; j < sizeof(double); j++) for(j = 0; j < sizeof(double); j++)
@ -575,7 +575,7 @@ generates_sigfpe(void)
f = (float)d; f = (float)d;
some_dummy_func((float)f); some_dummy_func((float)f);
} }
HDexit(0); HDexit(EXIT_SUCCESS);
} }
while (pid!=waitpid(pid, &status, 0)) while (pid!=waitpid(pid, &status, 0))
@ -3346,7 +3346,7 @@ done:
if(run_test==TEST_NOOP || run_test==TEST_NORMAL) if(run_test==TEST_NOOP || run_test==TEST_NORMAL)
HDexit(MIN((int)fails_all_tests, 254)); HDexit(MIN((int)fails_all_tests, 254));
else if(run_test==TEST_DENORM || run_test==TEST_SPECIAL) else if(run_test==TEST_DENORM || run_test==TEST_SPECIAL)
HDexit(0); HDexit(EXIT_SUCCESS);
HDassert(0 && "Should not reach this point!"); HDassert(0 && "Should not reach this point!");
return 1; return 1;
#else #else
@ -3372,7 +3372,7 @@ error:
if(run_test==TEST_NOOP || run_test==TEST_NORMAL) if(run_test==TEST_NOOP || run_test==TEST_NORMAL)
HDexit(MIN(MAX((int)fails_all_tests, 1), 254)); HDexit(MIN(MAX((int)fails_all_tests, 1), 254));
else if(run_test==TEST_DENORM || run_test==TEST_SPECIAL) else if(run_test==TEST_DENORM || run_test==TEST_SPECIAL)
HDexit(1); HDexit(EXIT_FAILURE);
HDassert(0 && "Should not reach this point!"); HDassert(0 && "Should not reach this point!");
return 1; return 1;
#else #else
@ -5251,7 +5251,7 @@ main(void)
if (nerrors) { if (nerrors) {
printf("***** %lu FAILURE%s! *****\n", printf("***** %lu FAILURE%s! *****\n",
nerrors, 1==nerrors?"":"S"); nerrors, 1==nerrors?"":"S");
HDexit(1); HDexit(EXIT_FAILURE);
} }
printf("All data type tests passed.\n"); printf("All data type tests passed.\n");
return 0; return 0;

View File

@ -7479,7 +7479,7 @@ main(void)
if(nerrors) { if(nerrors) {
printf("***** %lu FAILURE%s! *****\n", printf("***** %lu FAILURE%s! *****\n",
nerrors, 1==nerrors?"":"S"); nerrors, 1==nerrors?"":"S");
HDexit(1); HDexit(EXIT_FAILURE);
} }
printf("All datatype tests passed.\n"); printf("All datatype tests passed.\n");

View File

@ -292,7 +292,7 @@ main (void)
if(nerrors) { if(nerrors) {
printf("***** %d FAILURE%s! *****\n", nerrors, (1 == nerrors) ? "" : "S"); printf("***** %d FAILURE%s! *****\n", nerrors, (1 == nerrors) ? "" : "S");
exit(1); exit(EXIT_FAILURE);
} /* end if */ } /* end if */
printf("All extend tests passed.\n"); printf("All extend tests passed.\n");

View File

@ -2383,7 +2383,7 @@ main(int argc, char *argv[])
test_compact =1; test_compact =1;
else { else {
fprintf(stderr, "usage: %s [contiguous] [chunked] [compact]\n", argv[0]); fprintf(stderr, "usage: %s [contiguous] [chunked] [compact]\n", argv[0]);
exit(1); exit(EXIT_FAILURE);
} }
} /* end for */ } /* end for */
} /* end if */ } /* end if */

View File

@ -349,8 +349,8 @@ error:
* Purpose: Tests the library's behavior when a mandate filter returns * Purpose: Tests the library's behavior when a mandate filter returns
* failure. * failure.
* *
* Return: Success: exit(0) * Return: Success: exit(EXIT_SUCCESS)
* Failure: exit(1) * Failure: exit(EXIT_FAILURE)
* *
* Programmer: Raymond Lu * Programmer: Raymond Lu
* 25 August 2010 * 25 August 2010
@ -406,6 +406,6 @@ error:
if (nerrors) { if (nerrors) {
printf("***** %u FAILURE%s! *****\n", printf("***** %u FAILURE%s! *****\n",
nerrors, 1==nerrors?"":"S"); nerrors, 1==nerrors?"":"S");
HDexit(1); HDexit(EXIT_FAILURE);
} }
} }

View File

@ -20,7 +20,7 @@
* Purpose: This is the first half of a two-part test that makes sure * 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 * that a file can be read after an application crashes as long
* as the file was flushed first. We simulate a crash by * 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. * still exits with success.
*/ */
#include "h5test.h" #include "h5test.h"
@ -83,7 +83,7 @@ create_file(char* name, hid_t fapl)
return file; return file;
error: error:
HD_exit(1); HD_exit(EXIT_FAILURE);
} }
@ -127,7 +127,7 @@ extend_file(hid_t file)
return file; return file;
error: error:
HD_exit(1); HD_exit(EXIT_FAILURE);
} }
/*------------------------------------------------------------------------- /*-------------------------------------------------------------------------
@ -185,10 +185,10 @@ main(void)
fflush(stdout); fflush(stdout);
fflush(stderr); fflush(stderr);
HD_exit(0); HD_exit(EXIT_SUCCESS);
error: error:
HD_exit(1); HD_exit(EXIT_FAILURE);
return 1; return 1;
} }

View File

@ -1260,8 +1260,8 @@ error:
* *
* Purpose: Create a file for cross_read.c test. * Purpose: Create a file for cross_read.c test.
* *
* Return: Success: exit(0) * Return: Success: exit(EXIT_SUCCESS)
* Failure: exit(1) * Failure: exit(EXIT_FAILURE)
* *
* Programmer: Raymond Lu * Programmer: Raymond Lu
* Some time ago * Some time ago

View File

@ -1188,9 +1188,9 @@ error:
* `small' and/or `medium' on the command line or only `small' * `small' and/or `medium' on the command line or only `small'
* is assumed. * is assumed.
* *
* Return: Success: exit(0) * Return: Success: exit(EXIT_SUCCESS)
* *
* Failure: exit(non-zero) * Failure: exit(EXIT_FAILURE)
* *
* Programmer: Robb Matzke * Programmer: Robb Matzke
* Friday, October 10, 1997 * Friday, October 10, 1997
@ -1217,7 +1217,7 @@ main(int argc, char *argv[])
size_of_test |= TEST_MEDIUM; size_of_test |= TEST_MEDIUM;
else { else {
printf("unrecognized argument: %s\n", argv[i]); printf("unrecognized argument: %s\n", argv[i]);
HDexit(1); HDexit(EXIT_FAILURE);
} /* end else */ } /* end else */
} /* end for */ } /* end for */
} /* end else */ } /* end else */
@ -1437,7 +1437,7 @@ main(int argc, char *argv[])
== nerrors ? "" : "S"); == nerrors ? "" : "S");
if(HDisatty(1)) if(HDisatty(1))
printf("(Redirect output to a pager or a file to see debug output)\n"); printf("(Redirect output to a pager or a file to see debug output)\n");
HDexit(1); HDexit(EXIT_FAILURE);
} /* end if */ } /* end if */
printf("All hyperslab tests passed.\n"); printf("All hyperslab tests passed.\n");

View File

@ -585,9 +585,9 @@ error:
* *
* Purpose: Tests indexed storage stuff. * 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 * Programmer: Robb Matzke
* Wednesday, October 15, 1997 * Wednesday, October 15, 1997
@ -623,7 +623,7 @@ main(int argc, char *argv[])
} else { } else {
printf("unrecognized argument: %s\n", argv[i]); printf("unrecognized argument: %s\n", argv[i]);
#if 0 #if 0
exit(1); exit(EXIT_FAILURE);
#endif #endif
} }
} }
@ -658,7 +658,7 @@ main(int argc, char *argv[])
h5_fixname(FILENAME[0], fapl, filename, sizeof filename); h5_fixname(FILENAME[0], fapl, filename, sizeof filename);
if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) { if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) {
printf("Cannot create file %s; test aborted\n", filename); printf("Cannot create file %s; test aborted\n", filename);
exit(1); exit(EXIT_FAILURE);
} }
/* Initialize chunk dimensions */ /* Initialize chunk dimensions */
@ -726,7 +726,7 @@ main(int argc, char *argv[])
if (nerrors) { if (nerrors) {
printf("***** %d I-STORE TEST%s FAILED! *****\n", printf("***** %d I-STORE TEST%s FAILED! *****\n",
nerrors, 1 == nerrors ? "" : "S"); nerrors, 1 == nerrors ? "" : "S");
exit(1); exit(EXIT_FAILURE);
} }
printf("All i-store tests passed.\n"); printf("All i-store tests passed.\n");

View File

@ -14771,9 +14771,9 @@ error:
* *
* Purpose: Test links * Purpose: Test links
* *
* Return: Success: exit(0) * Return: Success: exit(EXIT_SUCCESS)
* *
* Failure: exit(non-zero) * Failure: exit(EXIT_FAILURE)
* *
* Programmer: Robb Matzke * Programmer: Robb Matzke
* Friday, August 14, 1998 * Friday, August 14, 1998
@ -14973,7 +14973,7 @@ main(void)
if(nerrors) { if(nerrors) {
printf("***** %d LINK TEST%s FAILED! *****\n", printf("***** %d LINK TEST%s FAILED! *****\n",
nerrors, 1 == nerrors ? "" : "S"); nerrors, 1 == nerrors ? "" : "S");
HDexit(1); HDexit(EXIT_FAILURE);
} }
printf("All link tests passed.\n"); printf("All link tests passed.\n");

View File

@ -138,8 +138,8 @@ external_link_env(hid_t fapl, hbool_t new_format)
* *
* Purpose: Test external link with environment variable HDF5_EXT_PREFIX * Purpose: Test external link with environment variable HDF5_EXT_PREFIX
* *
* Return: Success: exit(0) * Return: Success: exit(EXIT_SUCCESS)
* Failure: exit(non-zero) * Failure: exit(EXIT_FAILURE)
* *
* Programmer: Vailin Choi; Nov 2010 * Programmer: Vailin Choi; Nov 2010
* *
@ -175,7 +175,7 @@ main(void)
if(nerrors) { if(nerrors) {
HDprintf("***** %d External Link (HDF5_EXT_PREFIX) test%s FAILED! *****\n", HDprintf("***** %d External Link (HDF5_EXT_PREFIX) test%s FAILED! *****\n",
nerrors, 1 == nerrors ? "" : "s"); nerrors, 1 == nerrors ? "" : "s");
HDexit(1); HDexit(EXIT_FAILURE);
} }
HDprintf("All external Link (HDF5_EXT_PREFIX) tests passed.\n"); HDprintf("All external Link (HDF5_EXT_PREFIX) tests passed.\n");

View File

@ -13827,7 +13827,7 @@ main(void)
if(nerrors) { if(nerrors) {
printf("***** %d OBJECT COPY TEST%s FAILED! *****\n", printf("***** %d OBJECT COPY TEST%s FAILED! *****\n",
nerrors, (1 == nerrors ? "" : "S")); nerrors, (1 == nerrors ? "" : "S"));
exit(1); exit(EXIT_FAILURE);
} /* end if */ } /* end if */
puts ("All object copying tests passed."); puts ("All object copying tests passed.");

View File

@ -733,9 +733,9 @@ error:
* *
* Purpose: Tests the plugin module (H5PL) * 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 * Programmer: Raymond Lu
* 14 March 2013 * 14 March 2013

View File

@ -65,7 +65,7 @@ parse(int ac, char **av)
pt = *(++av); pt = *(++av);
if (*pt != '-') { if (*pt != '-') {
fprintf(stderr, "Unknown option(%s). Aborted.\n", *av); fprintf(stderr, "Unknown option(%s). Aborted.\n", *av);
exit(1); exit(EXIT_FAILURE);
}else{ }else{
switch(*(++pt)) { switch(*(++pt)) {
case 't': /* option -t */ case 't': /* option -t */
@ -81,15 +81,15 @@ parse(int ac, char **av)
break; break;
default: default:
fprintf(stderr, "Unknown -v parameter (%s). Aborted.\n", *av); fprintf(stderr, "Unknown -v parameter (%s). Aborted.\n", *av);
exit(1); exit(EXIT_FAILURE);
} }
break; break;
case 'h': /* help page */ case 'h': /* help page */
showhelp(); showhelp();
exit(0); exit(EXIT_SUCCESS);
default: default:
fprintf(stderr, "Unknown option(%s). Aborted.\n", *av); fprintf(stderr, "Unknown option(%s). Aborted.\n", *av);
exit(1); exit(EXIT_FAILURE);
} }
} }
} }

View File

@ -2553,7 +2553,7 @@ main(void)
if (nerrors) { if (nerrors) {
printf("***** %d FAILURE%s! *****\n", nerrors, 1==nerrors?"":"S"); printf("***** %d FAILURE%s! *****\n", nerrors, 1==nerrors?"":"S");
exit(1); exit(EXIT_FAILURE);
} }
puts("All unlink tests passed."); puts("All unlink tests passed.");

View File

@ -218,9 +218,9 @@ error:
* *
* Purpose: Tests unregistering filter with H5Zunregister * 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 * Programmer: Raymond Lu
* 11 April 2013 * 11 April 2013