2003-04-01 01:59:04 +08:00
|
|
|
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
2007-02-07 22:56:24 +08:00
|
|
|
* Copyright by The HDF Group. *
|
2003-04-01 01:59:04 +08:00
|
|
|
* Copyright by the Board of Trustees of the University of Illinois. *
|
|
|
|
* All rights reserved. *
|
|
|
|
* *
|
|
|
|
* This file is part of HDF5. The full HDF5 copyright notice, including *
|
|
|
|
* terms governing use, modification, and redistribution, is contained in *
|
2017-04-15 00:54:16 +08:00
|
|
|
* the COPYING file, which can be found at the root of the source code *
|
|
|
|
* distribution tree, or in https://support.hdfgroup.org/ftp/HDF5/releases. *
|
|
|
|
* If you do not have access to either file, you may request a copy from *
|
|
|
|
* help@hdfgroup.org. *
|
2003-04-01 01:59:04 +08:00
|
|
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
|
1997-07-31 05:17:56 +08:00
|
|
|
|
|
|
|
/*
|
|
|
|
FILE
|
1998-01-17 06:23:43 +08:00
|
|
|
testhdf5.c - HDF5 testing framework main file.
|
1997-07-31 05:17:56 +08:00
|
|
|
|
|
|
|
REMARKS
|
1998-01-17 06:23:43 +08:00
|
|
|
General test wrapper for HDF5 base library test programs
|
1997-07-31 05:17:56 +08:00
|
|
|
|
|
|
|
DESIGN
|
1998-01-17 06:23:43 +08:00
|
|
|
Each test function should be implemented as function having no
|
|
|
|
parameters and returning void (i.e. no return value). They should be put
|
2004-01-07 01:53:13 +08:00
|
|
|
into the list of AddTest() calls in main() below. Functions which depend
|
|
|
|
on other functionality should be placed below the AddTest() call for the
|
1998-01-17 06:23:43 +08:00
|
|
|
base functionality testing.
|
|
|
|
Each test module should include testhdf5.h and define a unique set of
|
|
|
|
names for test files they create.
|
1997-07-31 05:17:56 +08:00
|
|
|
|
|
|
|
BUGS/LIMITATIONS
|
|
|
|
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
2004-01-07 01:53:13 +08:00
|
|
|
/* ANY new test needs to have a prototype in testhdf5.h */
|
2001-04-04 02:09:16 +08:00
|
|
|
#include "testhdf5.h"
|
1997-07-31 05:17:56 +08:00
|
|
|
|
2005-08-14 04:53:35 +08:00
|
|
|
int
|
1998-01-17 06:23:43 +08:00
|
|
|
main(int argc, char *argv[])
|
1997-07-31 05:17:56 +08:00
|
|
|
{
|
2004-01-07 01:53:13 +08:00
|
|
|
/* Initialize testing framework */
|
2004-08-19 14:32:47 +08:00
|
|
|
TestInit(argv[0], NULL, NULL);
|
1998-03-01 02:19:05 +08:00
|
|
|
|
1997-07-31 05:17:56 +08:00
|
|
|
/* Tests are generally arranged from least to most complexity... */
|
2004-10-15 03:12:44 +08:00
|
|
|
AddTest("config", test_configure, cleanup_configure, "Configure definitions", NULL);
|
2006-08-22 07:27:11 +08:00
|
|
|
AddTest("metadata", test_metadata, cleanup_metadata, "Encoding/decoding metadata", NULL);
|
|
|
|
AddTest("checksum", test_checksum, cleanup_checksum, "Checksum algorithm", NULL);
|
2004-03-31 07:35:16 +08:00
|
|
|
AddTest("tst", test_tst, NULL, "Ternary Search Trees", NULL);
|
|
|
|
AddTest("heap", test_heap, NULL, "Memory Heaps", NULL);
|
2004-11-28 00:07:11 +08:00
|
|
|
AddTest("skiplist", test_skiplist, NULL, "Skip Lists", NULL);
|
2004-03-31 07:35:16 +08:00
|
|
|
AddTest("refstr", test_refstr, NULL, "Reference Counted Strings", NULL);
|
|
|
|
AddTest("file", test_file, cleanup_file, "Low-Level File I/O", NULL);
|
2007-06-27 00:08:38 +08:00
|
|
|
AddTest("objects", test_h5o, cleanup_h5o, "Generic Object Functions", NULL);
|
2004-03-31 07:35:16 +08:00
|
|
|
AddTest("h5s", test_h5s, cleanup_h5s, "Dataspaces", NULL);
|
2007-12-21 05:09:58 +08:00
|
|
|
AddTest("coords", test_coords, cleanup_coords, "Dataspace coordinates", NULL);
|
2007-02-20 08:23:19 +08:00
|
|
|
AddTest("sohm", test_sohm, cleanup_sohm, "Shared Object Header Messages", NULL);
|
2004-03-31 07:35:16 +08:00
|
|
|
AddTest("attr", test_attr, cleanup_attr, "Attributes", NULL);
|
|
|
|
AddTest("select", test_select, cleanup_select, "Selections", NULL);
|
|
|
|
AddTest("time", test_time, cleanup_time, "Time Datatypes", NULL);
|
|
|
|
AddTest("reference", test_reference, cleanup_reference, "References", NULL);
|
|
|
|
AddTest("vltypes", test_vltypes, cleanup_vltypes, "Variable-Length Datatypes", NULL);
|
|
|
|
AddTest("vlstrings", test_vlstrings, cleanup_vlstrings, "Variable-Length Strings", NULL);
|
|
|
|
AddTest("iterate", test_iterate, cleanup_iterate, "Group & Attribute Iteration", NULL);
|
|
|
|
AddTest("array", test_array, cleanup_array, "Array Datatypes", NULL);
|
|
|
|
AddTest("genprop", test_genprop, cleanup_genprop, "Generic Properties", NULL);
|
2005-05-24 02:20:07 +08:00
|
|
|
AddTest("unicode", test_unicode, cleanup_unicode, "UTF-8 Encoding", NULL);
|
2005-06-18 03:36:57 +08:00
|
|
|
AddTest("id", test_ids, NULL, "User-Created Identifiers", NULL);
|
2004-03-31 07:35:16 +08:00
|
|
|
AddTest("misc", test_misc, cleanup_misc, "Miscellaneous", NULL);
|
2004-01-07 01:53:13 +08:00
|
|
|
|
|
|
|
/* Display testing information */
|
|
|
|
TestInfo(argv[0]);
|
|
|
|
|
|
|
|
/* Parse command line arguments */
|
2004-08-19 14:32:47 +08:00
|
|
|
TestParseCmdLine(argc,argv);
|
2004-01-07 01:53:13 +08:00
|
|
|
|
|
|
|
/* Perform requested testing */
|
|
|
|
PerformTests();
|
|
|
|
|
|
|
|
/* Display test summary, if requested */
|
2004-08-19 14:32:47 +08:00
|
|
|
if (GetTestSummary())
|
2004-01-07 01:53:13 +08:00
|
|
|
TestSummary();
|
|
|
|
|
|
|
|
/* Clean up test files, if allowed */
|
2004-08-19 14:32:47 +08:00
|
|
|
if (GetTestCleanup() && !getenv("HDF5_NOCLEANUP"))
|
2004-01-07 01:53:13 +08:00
|
|
|
TestCleanup();
|
1998-07-11 06:00:26 +08:00
|
|
|
|
2016-07-19 06:36:44 +08:00
|
|
|
/* Release test infrastructure */
|
|
|
|
TestShutdown();
|
|
|
|
|
2014-01-28 06:33:34 +08:00
|
|
|
/* Exit failure if errors encountered; else exit success. */
|
|
|
|
/* No need to print anything since PerformTests() already does. */
|
|
|
|
if (GetTestNumErrs() > 0)
|
|
|
|
exit(EXIT_FAILURE);
|
|
|
|
else
|
|
|
|
exit(EXIT_SUCCESS);
|
2008-07-23 04:36:31 +08:00
|
|
|
} /* end main() */
|
[svn-r17351] Description:
Clean up code (to align w/future sblock_mdc branch changes), tweak
tests for [slightly] easier debugging, fix memory leak when copying chunked
datasets with I/O filters, fix memory leak of free space section when it was
exactly the right size to use for extending an existing block in the file.
Tested on:
FreeBSD/32 6.3 (duty) in debug mode
FreeBSD/64 6.3 (liberty) w/C++ & FORTRAN, in debug mode
Linux/32 2.6 (kagiso) w/PGI compilers, w/C++ & FORTRAN, w/threadsafe,
in debug mode
Linux/64-amd64 2.6 (smirom) w/Intel compilers w/default API=1.6.x,
w/C++ & FORTRAN, in production mode
Solaris/32 2.10 (linew) w/deprecated symbols disabled, w/C++ & FORTRAN,
w/szip filter, in production mode
Linux/64-ia64 2.6 (cobalt) w/Intel compilers, w/C++ & FORTRAN,
in production mode
Linux/64-ia64 2.4 (tg-login3) w/parallel, w/FORTRAN, in production mode
Linux/64-amd64 2.6 (abe) w/parallel, w/FORTRAN, in production mode
2009-08-14 01:09:55 +08:00
|
|
|
|