From 78fda912952d977ec6b157d344834112c363dd26 Mon Sep 17 00:00:00 2001 From: Dana Robinson Date: Fri, 6 Sep 2019 18:06:26 -0700 Subject: Fixed some exit calls. --- test/bittests.c | 14 +++++----- test/del_many_dense_attrs.c | 2 +- test/dsets.c | 7 +++-- test/extend.c | 22 +++++----------- test/filenotclosed.c | 2 +- test/filter_fail.c | 12 ++++----- test/gen_cross.c | 59 +++++++++++++++++++++--------------------- test/hyperslab.c | 12 ++++----- test/istore.c | 17 ++++-------- test/links.c | 7 +++-- test/links_env.c | 12 ++++----- test/objcopy.c | 10 +++---- test/swmr_addrem_writer.c | 10 +++---- test/swmr_generator.c | 4 +-- test/swmr_reader.c | 12 ++++----- test/swmr_remove_reader.c | 10 +++---- test/swmr_remove_writer.c | 10 +++---- test/swmr_sparse_reader.c | 10 +++---- test/swmr_sparse_writer.c | 10 +++---- test/swmr_start_write.c | 16 ++++++------ test/swmr_writer.c | 12 ++++----- test/testframe.c | 2 +- test/twriteorder.c | 6 ++--- test/unlink.c | 16 +++++------- test/use_append_chunk.c | 4 +-- test/use_append_mchunks.c | 4 +-- test/use_common.c | 2 +- test/use_disable_mdc_flushes.c | 4 +-- 28 files changed, 140 insertions(+), 168 deletions(-) diff --git a/test/bittests.c b/test/bittests.c index e29c188..046528a 100644 --- a/test/bittests.c +++ b/test/bittests.c @@ -895,13 +895,11 @@ test_clear (void) /*------------------------------------------------------------------------- - * Function: main + * Function: main * * Purpose: * - * Return: Success: - * - * Failure: + * Return: EXIT_SUCCESS/EXIT_FAILURE * * Programmer: Robb Matzke * Tuesday, June 16, 1998 @@ -911,7 +909,7 @@ test_clear (void) int main(void) { - int nerrors = 0; + int nerrors = 0; /* * Open the library explicitly. @@ -930,12 +928,12 @@ main(void) if(nerrors) { HDprintf("***** %u FAILURE%s! *****\n", nerrors, 1 == nerrors ? "" : "S"); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } HDprintf("All bit tests passed.\n"); H5close(); - return 0; -} + HDexit(EXIT_SUCCESS); +} /* end main() */ diff --git a/test/del_many_dense_attrs.c b/test/del_many_dense_attrs.c index d88045c..ada7a6f 100644 --- a/test/del_many_dense_attrs.c +++ b/test/del_many_dense_attrs.c @@ -41,7 +41,7 @@ const char *FILENAME[] = { */ static void catch_signal(int H5_ATTR_UNUSED signo) { - HDexit(1); + HDexit(EXIT_FAILURE); } /* catch_signal() */ diff --git a/test/dsets.c b/test/dsets.c index 50a6907..649e001 100644 --- a/test/dsets.c +++ b/test/dsets.c @@ -13167,8 +13167,7 @@ error: * * Purpose: Tests the dataset interface (H5D) * - * Return: Success: exit(EXIT_SUCCESS) - * Failure: exit(EXIT_FAILURE) + * Return: EXIT_SUCCESS/EXIT_FAILURE * * Programmer: Robb Matzke * Tuesday, December 9, 1997 @@ -13388,12 +13387,12 @@ main(void) #endif /* H5_HAVE_FILTER_SZIP */ h5_cleanup(FILENAME, fapl); - return EXIT_SUCCESS; + HDexit(EXIT_SUCCESS); error: nerrors = MAX(1, nerrors); HDprintf("***** %d DATASET TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S"); - return EXIT_FAILURE; + HDexit(EXIT_FAILURE); } /* end main() */ diff --git a/test/extend.c b/test/extend.c index f8c091b..a31ac0e 100644 --- a/test/extend.c +++ b/test/extend.c @@ -219,23 +219,15 @@ error: /*------------------------------------------------------------------------- - * Function: main + * Function: main * - * Purpose: Tests extendible datasets + * Purpose: Tests extendible datasets * - * Return: Success: exit(0) - * - * Failure: exit(non-zero) + * Return: EXIT_SUCCESS/EXIT_FAILURE * * Programmer: Robb Matzke * Friday, January 30, 1998 * - * Modifications: - * Took main data code out into write_data() routine, to allow - * different dataset creation property list settings to be tested. - * Quincey Koziol - * Tuesday, June 10, 2003 - * *------------------------------------------------------------------------- */ int @@ -290,16 +282,16 @@ main (void) if(nerrors) { HDprintf("***** %d FAILURE%s! *****\n", nerrors, (1 == nerrors) ? "" : "S"); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } /* end if */ HDprintf("All extend tests passed.\n"); h5_cleanup(FILENAME, fapl); - return 0; + HDexit(EXIT_SUCCESS); error: HDprintf("*** One or more extend tests failed ***\n"); - return 1; -} + HDexit(EXIT_FAILURE); +} /* end main() */ diff --git a/test/filenotclosed.c b/test/filenotclosed.c index 2c5c8dc..2d050eb 100644 --- a/test/filenotclosed.c +++ b/test/filenotclosed.c @@ -35,7 +35,7 @@ */ static void catch_signal(int H5_ATTR_UNUSED signo) { - HDexit(1); + HDexit(EXIT_FAILURE); } /* catch_signal() */ diff --git a/test/filter_fail.c b/test/filter_fail.c index 2acce01..4be2547 100644 --- a/test/filter_fail.c +++ b/test/filter_fail.c @@ -347,17 +347,15 @@ error: * Purpose: Tests the library's behavior when a mandate filter returns * failure. * - * Return: Success: exit(EXIT_SUCCESS) - * Failure: exit(EXIT_FAILURE) + * Return: EXIT_SUCCESS/EXIT_FAILURE * * Programmer: Raymond Lu * 25 August 2010 * - * Modifications: - * *------------------------------------------------------------------------- */ -int main(void) +int +main(void) { hid_t fapl; int mdc_nelmts = 0; @@ -398,7 +396,7 @@ int main(void) if (nerrors) TEST_ERROR - return 0; + HDexit(EXIT_SUCCESS); error: if (nerrors) { @@ -406,4 +404,4 @@ error: nerrors, 1==nerrors?"":"S"); HDexit(EXIT_FAILURE); } -} +} /* end main() */ diff --git a/test/gen_cross.c b/test/gen_cross.c index f7a1938..105895d 100644 --- a/test/gen_cross.c +++ b/test/gen_cross.c @@ -1255,13 +1255,11 @@ error: /*------------------------------------------------------------------------- * Function: main * - * Purpose: Create a file for cross_read.c test. + * Purpose: Create a file for cross_read.c test * - * Return: Success: exit(EXIT_SUCCESS) - * Failure: exit(EXIT_FAILURE) + * Return: EXIT_SUCCESS/EXIT_FAILURE * * Programmer: Raymond Lu - * Some time ago * *------------------------------------------------------------------------- */ @@ -1279,9 +1277,8 @@ main (void) * default file creation properties, and default file * access properties. */ - if((file = H5Fcreate(H5FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) - < 0) - {H5_FAILED(); AT(); return 1;} + if((file = H5Fcreate(H5FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT, H5P_DEFAULT)) < 0) + TEST_ERROR; /* * Describe the size of the array and create the data space for fixed @@ -1291,82 +1288,84 @@ main (void) dimsf[0] = NX + 1; dimsf[1] = NY; if((filespace = H5Screate_simple(RANK, dimsf, NULL)) < 0) - {H5_FAILED(); AT(); return 1;} + TEST_ERROR; dimsf[0] = NX; - if(H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, NULL, dimsf, NULL) - < 0) - {H5_FAILED(); AT(); return 1;} + if(H5Sselect_hyperslab(filespace, H5S_SELECT_SET, start, NULL, dimsf, NULL) < 0) + TEST_ERROR; /* Create memory space. This does not include the extra row for fill * values. */ HDassert(dimsf[0] == NX); HDassert(dimsf[1] == NY); if((memspace = H5Screate_simple(RANK, dimsf, NULL)) < 0) - {H5_FAILED(); AT(); return 1;} + TEST_ERROR; /* Create a regular dataset */ if(create_normal_dset(file, filespace, memspace) < 0) - {H5_FAILED(); AT(); return 1;} + TEST_ERROR; /* Create a dataset of FLOAT with scale-offset filter */ if(create_scale_offset_dsets_float(file, filespace, memspace) < 0) - {H5_FAILED(); AT(); return 1;} + TEST_ERROR; /* Create a dataset of DOUBLE with scale-offset filter */ if(create_scale_offset_dsets_double(file, filespace, memspace) < 0) - {H5_FAILED(); AT(); return 1;} + TEST_ERROR; /* Create a dataset of CHAR with scale-offset filter */ if(create_scale_offset_dsets_char(file, filespace, memspace) < 0) - {H5_FAILED(); AT(); return 1;} + TEST_ERROR; /* Create a dataset of SHORT with scale-offset filter */ if(create_scale_offset_dsets_short(file, filespace, memspace) < 0) - {H5_FAILED(); AT(); return 1;} + TEST_ERROR; /* Create a dataset of INT with scale-offset filter */ if(create_scale_offset_dsets_int(file, filespace, memspace) < 0) - {H5_FAILED(); AT(); return 1;} + TEST_ERROR; /* Create a dataset of LONG LONG with scale-offset filter */ if(create_scale_offset_dsets_long_long(file, filespace, memspace) < 0) - {H5_FAILED(); AT(); return 1;} + TEST_ERROR; /* Create a dataset of FLOAT with fletcher filter */ if(create_fletcher_dsets_float(file, filespace, memspace) < 0) - {H5_FAILED(); AT(); return 1;} + TEST_ERROR; /* Create a dataset of FLOAT with deflate filter */ if(create_deflate_dsets_float(file, filespace, memspace) < 0) - {H5_FAILED(); AT(); return 1;} + TEST_ERROR; #ifdef H5_HAVE_FILTER_SZIP /* Create a dataset of FLOAT with szip filter */ if(create_szip_dsets_float(file, filespace, memspace) < 0) - {H5_FAILED(); AT(); return 1;} + TEST_ERROR; #else /* H5_HAVE_FILTER_SZIP */ - puts("Szip filter is not enabled. Can't create the dataset."); + HDputs("Szip filter is not enabled. Can't create the dataset."); #endif /* H5_HAVE_FILTER_SZIP */ /* Create a dataset of FLOAT with shuffle filter */ if(create_shuffle_dsets_float(file, filespace, memspace) < 0) - {H5_FAILED(); AT(); return 1;} + TEST_ERROR; /* Create a dataset of FLOAT with nbit filter */ if(create_nbit_dsets_float(file, filespace, memspace) < 0) - {H5_FAILED(); AT(); return 1;} + TEST_ERROR; /* * Close/release resources. */ if(H5Sclose(memspace) < 0) - {H5_FAILED(); AT(); return 1;} + TEST_ERROR; if(H5Sclose(filespace) < 0) - {H5_FAILED(); AT(); return 1;} + TEST_ERROR; if(H5Fclose(file) < 0) - {H5_FAILED(); AT(); return 1;} + TEST_ERROR; - return 0; -} + HDexit(EXIT_SUCCESS); + +error: + HDexit(EXIT_FAILURE); +} /* end main() */ diff --git a/test/hyperslab.c b/test/hyperslab.c index 3592ca0..8ed9c22 100644 --- a/test/hyperslab.c +++ b/test/hyperslab.c @@ -1176,13 +1176,11 @@ error: /*------------------------------------------------------------------------- * Function: main * - * Purpose: Test various hyperslab operations. Give the words - * `small' and/or `medium' on the command line or only `small' - * is assumed. + * Purpose: Test various hyperslab operations. Give the words + * 'small' and/or 'medium' on the command line or only 'small' + * is assumed. * - * Return: Success: exit(EXIT_SUCCESS) - * - * Failure: exit(EXIT_FAILURE) + * Return: EXIT_SUCCESS/EXIT_FAILURE * * Programmer: Robb Matzke * Friday, October 10, 1997 @@ -1438,6 +1436,6 @@ main(int argc, char *argv[]) H5close(); #endif /* H5_HAVE_THREADSAFE */ - return 0; + HDexit(EXIT_SUCCESS); } diff --git a/test/istore.c b/test/istore.c index 8759be3..c8fe866 100644 --- a/test/istore.c +++ b/test/istore.c @@ -579,17 +579,13 @@ error: /*------------------------------------------------------------------------- * Function: main * - * Purpose: Tests indexed storage stuff. + * Purpose: Tests indexed storage * - * Return: Success: exit(EXIT_SUCCESS) - * - * Failure: exit(EXIT_FAILURE) + * Return: EXIT_SUCCESS/EXIT_FAILURE * * Programmer: Robb Matzke * Wednesday, October 15, 1997 * - * Modifications: - * *------------------------------------------------------------------------- */ int @@ -618,9 +614,6 @@ main(int argc, char *argv[]) size_of_test |= TEST_LARGE; } else { HDprintf("unrecognized argument: %s\n", argv[i]); -#if 0 - exit(EXIT_FAILURE); -#endif } } } @@ -654,7 +647,7 @@ main(int argc, char *argv[]) h5_fixname(FILENAME[0], fapl, filename, sizeof filename); if ((file=H5Fcreate(filename, H5F_ACC_TRUNC, fcpl, fapl)) < 0) { HDprintf("Cannot create file %s; test aborted\n", filename); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } /* Initialize chunk dimensions */ @@ -722,13 +715,13 @@ main(int argc, char *argv[]) if (nerrors) { HDprintf("***** %d I-STORE TEST%s FAILED! *****\n", nerrors, 1 == nerrors ? "" : "S"); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } HDprintf("All i-store tests passed.\n"); h5_cleanup(FILENAME, fapl); - return 0; + HDexit(EXIT_SUCCESS); } diff --git a/test/links.c b/test/links.c index cd44433..4eb4126 100644 --- a/test/links.c +++ b/test/links.c @@ -13907,8 +13907,7 @@ error: * * Purpose: Test links * - * Return: Success: exit(EXIT_SUCCESS) - * Failure: exit(EXIT_FAILURE) + * Return: EXIT_SUCCESS/EXIT_FAILURE *------------------------------------------------------------------------- */ int @@ -14137,10 +14136,10 @@ main(void) HDrmdir(TMPDIR); HDrmdir(TMPDIR2); - return SUCCEED; + HDexit(EXIT_SUCCESS); error: HDputs("*** TESTS FAILED ***"); - return 1; + HDexit(EXIT_FAILURE); } diff --git a/test/links_env.c b/test/links_env.c index dff185c..efb8cfd 100644 --- a/test/links_env.c +++ b/test/links_env.c @@ -134,10 +134,9 @@ external_link_env(hid_t fapl, hbool_t new_format) /*------------------------------------------------------------------------- * Function: main * - * Purpose: Test external link with environment variable HDF5_EXT_PREFIX + * Purpose: Test external link with environment variable HDF5_EXT_PREFIX * - * Return: Success: exit(EXIT_SUCCESS) - * Failure: exit(EXIT_FAILURE) + * Return: EXIT_SUCCESS/EXIT_FAILURE * * Programmer: Vailin Choi; Nov 2010 * @@ -175,9 +174,10 @@ main(void) /* clean up tmp_links_env directory created by external link tests */ HDrmdir(TMPDIR); - return 0; + HDexit(EXIT_SUCCESS); error: HDputs("*** TESTS FAILED ***"); - return 1; -} + HDexit(EXIT_FAILURE); +} /* end main() */ + diff --git a/test/objcopy.c b/test/objcopy.c index 5a5afc0..05ddfa4 100644 --- a/test/objcopy.c +++ b/test/objcopy.c @@ -14090,7 +14090,7 @@ error: /*------------------------------------------------------------------------- - * Function: main + * Function: main * * Purpose: Test H5Ocopy() * @@ -14098,7 +14098,7 @@ error: * new or old format, messages can be shared in either, * both, or neither of the source and destination files. * - * Return: Non-negative on success/Negative on failure + * Return: EXIT_SUCCESS/EXIT_FAILURE * * Programmer: Peter Cao * Friday, September 30, 2005 @@ -14376,7 +14376,7 @@ main(void) if(nerrors) { HDprintf("***** %d OBJECT COPY TEST%s FAILED! *****\n", nerrors, (1 == nerrors ? "" : "S")); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } /* end if */ HDputs ("All object copying tests passed."); @@ -14406,9 +14406,9 @@ main(void) h5_cleanup(FILENAME, fapl); - return 0; + HDexit(EXIT_SUCCESS); error: - return 1; + HDexit(EXIT_FAILURE); } /* main */ diff --git a/test/swmr_addrem_writer.c b/test/swmr_addrem_writer.c index 01e2ce1..df984b1 100644 --- a/test/swmr_addrem_writer.c +++ b/test/swmr_addrem_writer.c @@ -302,7 +302,7 @@ usage(void) HDprintf("Defaults to verbose (no '-q' given), flushing every 1000 operations\n"); HDprintf("('-f 1000'), and will generate a random seed (no -r given).\n"); HDprintf("\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } int main(int argc, const char *argv[]) @@ -401,7 +401,7 @@ int main(int argc, const char *argv[]) /* Open file skeleton */ if((fid = open_skeleton(FILENAME, verbose)) < 0) { HDfprintf(stderr, "Error opening skeleton file!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ /* Send a message to indicate "H5Fopen" is complete--releasing the file lock */ @@ -414,7 +414,7 @@ int main(int argc, const char *argv[]) /* Grow and shrink datasets */ if(addrem_records(fid, verbose, (unsigned long)nops, (unsigned long)flush_count) < 0) { HDfprintf(stderr, "Error adding and removing records from datasets!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ /* Emit informational message */ @@ -424,7 +424,7 @@ int main(int argc, const char *argv[]) /* Clean up the symbols */ if(shutdown_symbols() < 0) { HDfprintf(stderr, "Error releasing symbols!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ /* Emit informational message */ @@ -434,7 +434,7 @@ int main(int argc, const char *argv[]) /* Close objects opened */ if(H5Fclose(fid) < 0) { HDfprintf(stderr, "Error closing file!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ return 0; diff --git a/test/swmr_generator.c b/test/swmr_generator.c index d986696..54a9900 100644 --- a/test/swmr_generator.c +++ b/test/swmr_generator.c @@ -283,7 +283,7 @@ usage(void) HDprintf("compression ('-c -1'), v1 b-tree indexing (-i b1), and will generate a random\n"); HDprintf("seed (no -r given).\n"); HDprintf("\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end usage() */ int main(int argc, const char *argv[]) @@ -377,7 +377,7 @@ int main(int argc, const char *argv[]) /* Generate file skeleton */ if(gen_skeleton(FILENAME, verbose, swmr_write, comp_level, index_type, random_seed) < 0) { HDfprintf(stderr, "Error generating skeleton file!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ return 0; diff --git a/test/swmr_reader.c b/test/swmr_reader.c index c994a71..cb354a7 100644 --- a/test/swmr_reader.c +++ b/test/swmr_reader.c @@ -384,7 +384,7 @@ usage(void) HDprintf("5 common symbols to poll ('-h 5'), 10 random symbols to poll ('-l 10'),\n"); HDprintf("and will generate a random seed (no -r given).\n"); HDprintf("\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } int main(int argc, const char *argv[]) @@ -485,7 +485,7 @@ int main(int argc, const char *argv[]) HDsnprintf(verbose_name, sizeof(verbose_name), "swmr_reader.out.%u", random_seed); if(NULL == (verbose_file = HDfopen(verbose_name, "w"))) { HDfprintf(stderr, "Can't open verbose output file!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } } /* end if */ @@ -508,7 +508,7 @@ int main(int argc, const char *argv[]) /* Generate dataset names */ if(generate_symbols() < 0) { HDfprintf(stderr, "Error generating symbol names!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ /* Create datatype for creating datasets */ @@ -518,7 +518,7 @@ int main(int argc, const char *argv[]) /* Reading records from datasets */ if(read_records(FILENAME, verbose, verbose_file, random_seed, (unsigned long)nseconds, (unsigned)poll_time, (unsigned)ncommon, (unsigned)nrandom) < 0) { HDfprintf(stderr, "Error reading records from datasets (random_seed = %u)!\n", random_seed); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ /* Emit informational message */ @@ -528,7 +528,7 @@ int main(int argc, const char *argv[]) /* Clean up the symbols */ if(shutdown_symbols() < 0) { HDfprintf(stderr, "Error releasing symbols!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ /* Emit informational message */ @@ -538,7 +538,7 @@ int main(int argc, const char *argv[]) /* Close objects created */ if(H5Tclose(symbol_tid) < 0) { HDfprintf(stderr, "Error closing symbol datatype!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ return 0; diff --git a/test/swmr_remove_reader.c b/test/swmr_remove_reader.c index b4f0d5b..9ca6045 100644 --- a/test/swmr_remove_reader.c +++ b/test/swmr_remove_reader.c @@ -370,7 +370,7 @@ usage(void) HDprintf("5 common symbols to poll ('-h 5'), 10 random symbols to poll ('-l 10'),\n"); HDprintf("and will generate a random seed (no -r given).\n"); HDprintf("\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } int main(int argc, const char *argv[]) @@ -480,7 +480,7 @@ int main(int argc, const char *argv[]) /* Generate dataset names */ if(generate_symbols() < 0) { HDfprintf(stderr, "Error generating symbol names!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ /* Create datatype for creating datasets */ @@ -490,7 +490,7 @@ int main(int argc, const char *argv[]) /* Reading records from datasets */ if(read_records(FILENAME, verbose, (unsigned long)nseconds, (unsigned)poll_time, (unsigned)ncommon, (unsigned)nrandom) < 0) { HDfprintf(stderr, "Error reading records from datasets!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ /* Emit informational message */ @@ -500,7 +500,7 @@ int main(int argc, const char *argv[]) /* Clean up the symbols */ if(shutdown_symbols() < 0) { HDfprintf(stderr, "Error releasing symbols!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ /* Emit informational message */ @@ -510,7 +510,7 @@ int main(int argc, const char *argv[]) /* Close objects created */ if(H5Tclose(symbol_tid) < 0) { HDfprintf(stderr, "Error closing symbol datatype!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ return 0; diff --git a/test/swmr_remove_writer.c b/test/swmr_remove_writer.c index c4f7b6e..e6d23de 100644 --- a/test/swmr_remove_writer.c +++ b/test/swmr_remove_writer.c @@ -236,7 +236,7 @@ usage(void) HDprintf("Defaults to verbose (no '-q' given), latest format when opening file (no '-o' given),\n"); HDprintf("flushing every 1000 shrinks ('-f 1000'), and will generate a random seed (no -r given).\n"); HDprintf("\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } int main(int argc, const char *argv[]) @@ -339,7 +339,7 @@ int main(int argc, const char *argv[]) /* Open file skeleton */ if((fid = open_skeleton(FILENAME, verbose, old)) < 0) { HDfprintf(stderr, "Error opening skeleton file!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ /* Send a message to indicate "H5Fopen" is complete--releasing the file lock */ @@ -352,7 +352,7 @@ int main(int argc, const char *argv[]) /* Remove records from datasets */ if(remove_records(fid, verbose, (unsigned long)nshrinks, (unsigned long)flush_count) < 0) { HDfprintf(stderr, "Error removing records from datasets!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ /* Emit informational message */ @@ -362,7 +362,7 @@ int main(int argc, const char *argv[]) /* Clean up the symbols */ if(shutdown_symbols() < 0) { HDfprintf(stderr, "Error releasing symbols!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ /* Emit informational message */ @@ -372,7 +372,7 @@ int main(int argc, const char *argv[]) /* Close objects opened */ if(H5Fclose(fid) < 0) { HDfprintf(stderr, "Error closing file!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ return 0; diff --git a/test/swmr_sparse_reader.c b/test/swmr_sparse_reader.c index cd0ece6..6adc6c5 100644 --- a/test/swmr_sparse_reader.c +++ b/test/swmr_sparse_reader.c @@ -338,7 +338,7 @@ usage(void) HDprintf("Note that the # of records *must* be the same as that supplied to\n"); HDprintf("swmr_sparse_writer\n"); HDprintf("\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end usage() */ int main(int argc, const char *argv[]) @@ -410,7 +410,7 @@ int main(int argc, const char *argv[]) /* Generate dataset names */ if(generate_symbols() < 0) { HDfprintf(stderr, "Error generating symbol names!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ /* Create datatype for creating datasets */ @@ -420,7 +420,7 @@ int main(int argc, const char *argv[]) /* Reading records from datasets */ if(read_records(FILENAME, verbose, (unsigned long) nrecords, (unsigned)poll_time, (unsigned)reopen_count) < 0) { HDfprintf(stderr, "Error reading records from datasets!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ /* Emit informational message */ @@ -430,7 +430,7 @@ int main(int argc, const char *argv[]) /* Clean up the symbols */ if(shutdown_symbols() < 0) { HDfprintf(stderr, "Error releasing symbols!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ /* Emit informational message */ @@ -440,7 +440,7 @@ int main(int argc, const char *argv[]) /* Close objects created */ if(H5Tclose(symbol_tid) < 0) { HDfprintf(stderr, "Error closing symbol datatype!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ return 0; diff --git a/test/swmr_sparse_writer.c b/test/swmr_sparse_writer.c index 17d8c61..5173c71 100644 --- a/test/swmr_sparse_writer.c +++ b/test/swmr_sparse_writer.c @@ -337,7 +337,7 @@ usage(void) HDprintf("Defaults to verbose (no '-q' given) and flushing every 1000 records\n"); HDprintf("('-f 1000')\n"); HDprintf("\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } int main(int argc, const char *argv[]) @@ -412,7 +412,7 @@ int main(int argc, const char *argv[]) /* Open file skeleton */ if((fid = open_skeleton(FILENAME, verbose)) < 0) { HDfprintf(stderr, "Error opening skeleton file!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ /* Send a message to indicate "H5Fopen" is complete--releasing the file lock */ @@ -425,7 +425,7 @@ int main(int argc, const char *argv[]) /* Append records to datasets */ if(add_records(fid, verbose, (unsigned long)nrecords, (unsigned long)flush_count) < 0) { HDfprintf(stderr, "Error appending records to datasets!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ /* Emit informational message */ @@ -435,7 +435,7 @@ int main(int argc, const char *argv[]) /* Clean up the symbols */ if(shutdown_symbols() < 0) { HDfprintf(stderr, "Error releasing symbols!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ /* Emit informational message */ @@ -445,7 +445,7 @@ int main(int argc, const char *argv[]) /* Close objects opened */ if(H5Fclose(fid) < 0) { HDfprintf(stderr, "Error closing file!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ return 0; diff --git a/test/swmr_start_write.c b/test/swmr_start_write.c index 0ee382d..c4222ad 100644 --- a/test/swmr_start_write.c +++ b/test/swmr_start_write.c @@ -357,7 +357,7 @@ usage(void) HDprintf("v1 b-tree indexing (-i b1), compression ('-c -1'),\n"); HDprintf("will generate a random seed (no -r given), and verbose (no '-q' given)\n"); HDprintf("\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* usage() */ /* @@ -468,7 +468,7 @@ int main(int argc, const char *argv[]) HDsnprintf(verbose_name, sizeof(verbose_name), "swmr_writer.out.%u", random_seed); if(NULL == (verbose_file = HDfopen(verbose_name, "w"))) { HDfprintf(stderr, "Can't open verbose output file!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } } /* end if */ @@ -487,7 +487,7 @@ int main(int argc, const char *argv[]) /* Create the test file */ if((fid = create_file(FILENAME, verbose, verbose_file, random_seed)) < 0) { HDfprintf(stderr, "Error creating the file...\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* Emit informational message */ @@ -501,13 +501,13 @@ int main(int argc, const char *argv[]) /* Create the datasets in the file */ if(create_datasets(fid, comp_level, verbose, verbose_file, index_type) < 0) { HDfprintf(stderr, "Error creating datasets...\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* Enable SWMR writing mode */ if(H5Fstart_swmr_write(fid) < 0) { HDfprintf(stderr, "Error starting SWMR writing mode...\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* Send a message to indicate "H5Fopen" is complete--releasing the file lock */ @@ -520,7 +520,7 @@ int main(int argc, const char *argv[]) /* Append records to datasets */ if(add_records(fid, verbose, verbose_file, (unsigned long)nrecords, (unsigned long)flush_count) < 0) { HDfprintf(stderr, "Error appending records to datasets!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ /* Emit informational message */ @@ -530,7 +530,7 @@ int main(int argc, const char *argv[]) /* Clean up the symbols */ if(shutdown_symbols() < 0) { HDfprintf(stderr, "Error releasing symbols!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ /* Emit informational message */ @@ -540,7 +540,7 @@ int main(int argc, const char *argv[]) /* Close objects opened */ if(H5Fclose(fid) < 0) { HDfprintf(stderr, "Error closing file!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ return 0; diff --git a/test/swmr_writer.c b/test/swmr_writer.c index 6df7355..4c3e64a 100644 --- a/test/swmr_writer.c +++ b/test/swmr_writer.c @@ -291,7 +291,7 @@ usage(void) HDprintf("Defaults to verbose (no '-q' given), latest format when opening file (no '-o' given),\n"); HDprintf("flushing every 10000 records ('-f 10000'), and will generate a random seed (no -r given).\n"); HDprintf("\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } int main(int argc, const char *argv[]) @@ -379,7 +379,7 @@ int main(int argc, const char *argv[]) HDsnprintf(verbose_name, sizeof(verbose_name), "swmr_writer.out.%u", random_seed); if(NULL == (verbose_file = HDfopen(verbose_name, "w"))) { HDfprintf(stderr, "Can't open verbose output file!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } } /* end if */ @@ -408,7 +408,7 @@ int main(int argc, const char *argv[]) /* Open file skeleton */ if((fid = open_skeleton(FILENAME, verbose, verbose_file, random_seed, old)) < 0) { HDfprintf(stderr, "Error opening skeleton file!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ /* Send a message to indicate "H5Fopen" is complete--releasing the file lock */ @@ -421,7 +421,7 @@ int main(int argc, const char *argv[]) /* Append records to datasets */ if(add_records(fid, verbose, verbose_file, (unsigned long)nrecords, (unsigned long)flush_count) < 0) { HDfprintf(stderr, "Error appending records to datasets!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ /* Emit informational message */ @@ -431,7 +431,7 @@ int main(int argc, const char *argv[]) /* Clean up the symbols */ if(shutdown_symbols() < 0) { HDfprintf(stderr, "Error releasing symbols!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ /* Emit informational message */ @@ -441,7 +441,7 @@ int main(int argc, const char *argv[]) /* Close objects opened */ if(H5Fclose(fid) < 0) { HDfprintf(stderr, "Error closing file!\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* end if */ return 0; diff --git a/test/testframe.c b/test/testframe.c index 68c66ec..3c2a335 100644 --- a/test/testframe.c +++ b/test/testframe.c @@ -90,7 +90,7 @@ AddTest(const char *TheName, void (*TheCall) (void), void (*Cleanup) (void), con /* Reallocate array */ if(NULL == (newTest = (TestStruct *)HDrealloc(Test, newAlloc * sizeof(TestStruct)))) { HDprintf("Out of memory for tests, Index = %u, TestAlloc = %u, newAlloc = %u\n", Index, TestAlloc, newAlloc); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } /* end if */ /* Update info */ diff --git a/test/twriteorder.c b/test/twriteorder.c index 60ee384..b104b72 100644 --- a/test/twriteorder.c +++ b/test/twriteorder.c @@ -134,7 +134,7 @@ parse_option(int argc, char * const argv[]) switch (c) { case 'h': usage(progname_g); - HDexit(0); + HDexit(EXIT_SUCCESS); break; case 'b': /* number of planes to write/read */ if ((blocksize_g = atoi(optarg)) <= 0) { @@ -407,12 +407,12 @@ main(int argc, char *argv[]) HDprintf("%d: launch reader process\n", mypid); if (read_wo_file() < 0) { HDfprintf(stderr, "read_wo_file encountered error\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } /* Reader is done. Clean up by removing the data file */ HDremove(DATAFILE); - HDexit(0); + HDexit(EXIT_SUCCESS); } } diff --git a/test/unlink.c b/test/unlink.c index f79aa29..6825dec 100644 --- a/test/unlink.c +++ b/test/unlink.c @@ -2421,17 +2421,13 @@ error: /*------------------------------------------------------------------------- * Function: main * - * Purpose: Test unlinking operations + * Purpose: Test unlinking operations * - * Return: Success: zero - * - * Failure: non-zero + * Return: EXIT_SUCCESS/EXIT_FAILURE * * Programmer: Robb Matzke * Friday, September 25, 1998 * - * Modifications: - * *------------------------------------------------------------------------- */ int @@ -2551,16 +2547,16 @@ main(void) if (nerrors) { HDprintf("***** %d FAILURE%s! *****\n", nerrors, 1==nerrors?"":"S"); - exit(EXIT_FAILURE); + HDexit(EXIT_FAILURE); } HDputs("All unlink tests passed."); h5_cleanup(FILENAME, fapl); - return 0; + HDexit(EXIT_SUCCESS); error: - return 1; -} + HDexit(EXIT_FAILURE); +} /* end main() */ diff --git a/test/use_append_chunk.c b/test/use_append_chunk.c index 4e8c672..6b34f1e 100644 --- a/test/use_append_chunk.c +++ b/test/use_append_chunk.c @@ -174,9 +174,9 @@ main(int argc, char *argv[]) HDprintf("%d: launch reader process\n", mypid); if (read_uc_file(send_wait) < 0){ HDfprintf(stderr, "read_uc_file encountered error\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } - HDexit(0); + HDexit(EXIT_SUCCESS); } } diff --git a/test/use_append_mchunks.c b/test/use_append_mchunks.c index 0414628..b7d45a4 100644 --- a/test/use_append_mchunks.c +++ b/test/use_append_mchunks.c @@ -167,9 +167,9 @@ main(int argc, char *argv[]) HDprintf("%d: launch reader process\n", mypid); if (read_uc_file(send_wait) < 0){ HDfprintf(stderr, "read_uc_file encountered error\n"); - HDexit(1); + HDexit(EXIT_FAILURE); } - HDexit(0); + HDexit(EXIT_SUCCESS); } } diff --git a/test/use_common.c b/test/use_common.c index b600dca..9effa06 100644 --- a/test/use_common.c +++ b/test/use_common.c @@ -63,7 +63,7 @@ parse_option(int argc, char * const argv[]) switch (c) { case 'h': usage(progname_g); - exit(0); + HDexit(EXIT_SUCCESS); break; case 'f': /* usecase data file name */ UC_opts.filename = optarg; diff --git a/test/use_disable_mdc_flushes.c b/test/use_disable_mdc_flushes.c index b349269..9cd202c 100644 --- a/test/use_disable_mdc_flushes.c +++ b/test/use_disable_mdc_flushes.c @@ -102,7 +102,7 @@ parse_option(int argc, char * const argv[]) switch (c) { case 'h': usage(progname_g); - exit(0); + HDexit(EXIT_SUCCESS); break; case 'f': /* usecase data file name */ filename_g = optarg; @@ -540,7 +540,7 @@ int main(void) { HDfprintf(stderr, "Non-POSIX platform. Skipping.\n"); - return EXIT_SUCCESS; + HDexit(EXIT_SUCCESS); } /* end main() */ #endif /* H5_HAVE_FORK */ -- cgit v0.12