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.
This commit is contained in:
Frank.Willmore 2016-10-25 09:53:44 -05:00
parent b6bb7c123a
commit 526bcc242d
19 changed files with 48 additions and 48 deletions

View File

@ -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");

View File

@ -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);

View File

@ -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

View File

@ -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;

View File

@ -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");

View File

@ -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");

View File

@ -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 */

View File

@ -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);
}
}

View File

@ -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;
}

View File

@ -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

View File

@ -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");

View File

@ -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");

View File

@ -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");

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
*
* 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");

View File

@ -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.");

View File

@ -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

View File

@ -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);
}
}
}

View File

@ -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.");

View File

@ -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