Fixed some exit calls.

This commit is contained in:
Dana Robinson 2019-09-06 18:06:26 -07:00
parent 5b9f3660d7
commit 78fda91295
28 changed files with 140 additions and 168 deletions

View File

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

View File

@ -41,7 +41,7 @@ const char *FILENAME[] = {
*/
static void catch_signal(int H5_ATTR_UNUSED signo)
{
HDexit(1);
HDexit(EXIT_FAILURE);
} /* catch_signal() */

View File

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

View File

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

View File

@ -35,7 +35,7 @@
*/
static void catch_signal(int H5_ATTR_UNUSED signo)
{
HDexit(1);
HDexit(EXIT_FAILURE);
} /* catch_signal() */

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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