Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve parallel builds, fixed SEGFAULT for NULL parameter for nc_inq_format(), added testing, documentation #680

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
7664dc1
fixing cmake build
edhartnett Nov 20, 2017
8c0d929
fixing cmake build
edhartnett Nov 20, 2017
a7a5dca
fixing cmake build
edhartnett Nov 20, 2017
5b19a2b
merged upstream/master
edhartnett Nov 20, 2017
4d907a0
fixed accidental changes
edhartnett Nov 20, 2017
7e662c6
fixed easy warnings
edhartnett Nov 20, 2017
53d9c30
undid changes to CMakeLists.txt
edhartnett Nov 20, 2017
f9dcd56
changing back to CMakeLists.txt from upstream repo
edhartnett Nov 20, 2017
ec6e462
changing back to ncdump/CMakeLists.txt from upstream repo
edhartnett Nov 20, 2017
15fc02f
changed back
edhartnett Nov 20, 2017
3a48f59
removed legacy test that was no longer being run
edhartnett Nov 22, 2017
70c7398
fixed SEGFAULT for NULL parameter for nc_inq_format(), added testing,…
edhartnett Nov 22, 2017
b5ed095
makefile cleanup
edhartnett Nov 22, 2017
d4495e8
more testing
edhartnett Nov 22, 2017
845355e
added hdf4 test for inq_format calls
edhartnett Nov 22, 2017
365bd0c
added new test to CMake build
edhartnett Nov 22, 2017
74a895a
fixed copy of HDF4 file in CMake build with nc_test/tst_formats.c
edhartnett Nov 22, 2017
2b3e1b1
trying to get cmake build to work
edhartnett Nov 22, 2017
0c7684b
removed tst_filters from CMake build
edhartnett Nov 22, 2017
843db97
finally got my distcheck act together by moving hdf4 file test to nc_…
edhartnett Nov 23, 2017
60d1d62
fixing order in CMake
edhartnett Nov 23, 2017
fab6ed8
combined two tests to eliminate dependency
edhartnett Nov 23, 2017
1456e22
more changes to attempt to get cmake working
edhartnett Nov 23, 2017
b4bccb6
fixing test order problem
edhartnett Nov 23, 2017
fa7f17a
got cmake working with HDF4 format test
edhartnett Nov 24, 2017
69f2089
cleaned up err_macros.h
edhartnett Nov 24, 2017
273b1d5
merged ejh_check_test
edhartnett Nov 24, 2017
8e47b9b
merged ejh_more_warnings
edhartnett Nov 24, 2017
8011fab
now run tst_large2, also cleaned up some more warnings
edhartnett Nov 24, 2017
a208cc0
changed ncdump C test to build but not run (again) under CMake build
edhartnett Nov 25, 2017
e064855
removed ncdump test dependencies for tst_netcdf4.sh
edhartnett Nov 25, 2017
fa690cd
eliminated dependencies
edhartnett Nov 25, 2017
c8605e0
removing dependencies between tests
edhartnett Nov 25, 2017
6fdbbf4
removed redundant check
edhartnett Nov 25, 2017
8d9e7b3
removed many dependencies in ncdump testing
edhartnett Nov 25, 2017
38b53c0
cleaned up comments
edhartnett Nov 25, 2017
579bfcb
removed tst_ctest.sh from cmake build
edhartnett Nov 25, 2017
f779345
eliminating test dependencies in ncdap_test
edhartnett Nov 26, 2017
bebe7e1
merged master
edhartnett Nov 26, 2017
6ebe589
clean up
edhartnett Nov 26, 2017
0157c56
readded some cleanfiles to ncdump makefile
edhartnett Nov 26, 2017
f33897e
fixed some warnings, added some files to makefile.am to be cleaned
edhartnett Nov 26, 2017
922734b
removed mention of deleted tst_h_rd_cmp.c from h5_test CMake build
edhartnett Nov 26, 2017
ce97137
removed properties from tst_interops3 which is no longer a test in CM…
edhartnett Nov 26, 2017
3c5404c
Merge branch 'master' into ejh_ncfunc_testing
edhartnett Nov 28, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions h5_test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
SET(H5TESTS tst_h_files tst_h_files2 tst_h_files4 tst_h_atts tst_h_atts3 tst_h_atts4 tst_h_vars tst_h_vars2 tst_h_vars3 tst_h_grps tst_h_compounds tst_h_compounds2 tst_h_wrt_cmp tst_h_rd_cmp tst_h_vl tst_h_opaques tst_h_strings tst_h_strings1 tst_h_strings2 tst_h_ints tst_h_dimscales tst_h_dimscales1 tst_h_dimscales2 tst_h_dimscales3 tst_h_enums tst_h_dimscales4)
SET(H5TESTS tst_h_files tst_h_files2 tst_h_files4 tst_h_atts tst_h_atts3 tst_h_atts4 tst_h_vars tst_h_vars2 tst_h_vars3 tst_h_grps tst_h_compounds tst_h_compounds2 tst_h_wrt_cmp tst_h_vl tst_h_opaques tst_h_strings tst_h_strings1 tst_h_strings2 tst_h_ints tst_h_dimscales tst_h_dimscales1 tst_h_dimscales2 tst_h_dimscales3 tst_h_enums tst_h_dimscales4)

FILE(GLOB COPY_FILES ${CMAKE_CURRENT_SOURCE_DIR}/*.h5 ${CMAKE_CURRENT_SOURCE_DIR}/*.nc)
FILE(COPY ${COPY_FILES} DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/)
Expand All @@ -12,5 +12,3 @@ FOREACH(CTEST ${H5TESTS})
)
ADD_TEST(${CTEST} ${EXECUTABLE_OUTPUT_PATH}/${CTEST})
ENDFOREACH()

SET_TESTS_PROPERTIES(tst_h_rd_cmp PROPERTIES DEPENDS tst_h_wrt_cmp)
4 changes: 3 additions & 1 deletion h5_test/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
# only use HDF5; these tests don't use netCDF at all.
#
# If one of these tests fails, then netCDF-4 will not work correctly.
# Ed Hartnett, Ward Fisher

# Set AM_CPPFLAGS and AM_LDFLAGS based on user choices.
include $(top_srcdir)/lib_flags.am
Expand Down Expand Up @@ -46,7 +47,8 @@ endif # USE_VALGRIND_TESTS
# We must include these files in the distribution.
EXTRA_DIST = run_par_tests.sh run_valgrind_tests.sh \
ref_tst_h_compounds.h5 ref_tst_h_compounds2.h5 run_par_tests.sh \
run_valgrind_tests.sh ref_tst_compounds.nc h5_err_macros.h CMakeLists.txt
run_valgrind_tests.sh ref_tst_compounds.nc h5_err_macros.h \
CMakeLists.txt

# Clean up test results.
CLEANFILES = tst_h_*.h5
2 changes: 1 addition & 1 deletion h5_test/tst_h_files.c
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ main()
printf("*** large file test for HDF5...");
{
hid_t fapl_id, fcpl_id, fileid, grpid, spaceid, datasetid;
hid_t dim1_dimscaleid, dim2_dimscaleid, plistid, datasetid2, file_spaceid;
hid_t dim1_dimscaleid, dim2_dimscaleid, plistid, file_spaceid;
hid_t mem_spaceid, xfer_plistid, native_typeid;
hsize_t *chunksize, dims[1], maxdims[1], *dimsize, *maxdimsize;
hsize_t fdims[MAX_DIMS], fmaxdims[MAX_DIMS];
Expand Down
62 changes: 0 additions & 62 deletions h5_test/tst_h_rd_cmp.c

This file was deleted.

45 changes: 37 additions & 8 deletions h5_test/tst_h_wrt_cmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
Copyright 2007 University Corporation for Atmospheric Research/Unidata
See COPYRIGHT file for conditions of use.

Test HDF5 compound types.
Test HDF5 compound types.
Ed Hartnett
*/

#include "h5_err_macros.h"
Expand All @@ -20,7 +21,7 @@ main()
hid_t datasetid;
hsize_t dims[1];
char dummy[] = " ";
struct s1
struct s1
{
unsigned char c1;
double d;
Expand All @@ -46,7 +47,7 @@ main()
/* Open file and create group. */
if ((access_plist = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR;
if (H5Pset_fclose_degree(access_plist, H5F_CLOSE_STRONG)) ERR;
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
if ((fileid = H5Fcreate(FILE_NAME, H5F_ACC_TRUNC, H5P_DEFAULT,
access_plist)) < 0) ERR;

/* Create a simple compound type. */
Expand All @@ -60,11 +61,11 @@ main()
if ((spaceid = H5Screate_simple(1, dims, dims)) < 0) ERR;

/* Create a dataset of this compound type. */
if ((datasetid = H5Dcreate(fileid, VAR_NAME, typeid, spaceid,
if ((datasetid = H5Dcreate(fileid, VAR_NAME, typeid, spaceid,
H5P_DEFAULT)) < 0) ERR;

/* Write some data. */
if (H5Dwrite(datasetid, typeid, H5S_ALL, H5S_ALL, H5P_DEFAULT,
if (H5Dwrite(datasetid, typeid, H5S_ALL, H5S_ALL, H5P_DEFAULT,
data) < 0) ERR;

/* Release all resources. */
Expand All @@ -75,7 +76,7 @@ main()
}
SUMMARIZE_ERR;
printf("*** Checking packing of HDF5 compound types...");
{
{
/* Open file. */
if ((access_plist = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR;
if (H5Pset_fclose_degree(access_plist, H5F_CLOSE_STRONG)) ERR;
Expand All @@ -92,10 +93,38 @@ main()
/* Get type. */
if ((typeid = H5Dget_type(datasetid)) < 0) ERR;

/* if ((native_type = H5Tget_native_type(typeid, H5T_DIR_DEFAULT)) < 0) ERR;*/
/* Read the data. */
if (H5Dread(datasetid, typeid, H5S_ALL, H5S_ALL, H5P_DEFAULT,
data) < 0) ERR;

/* Check the data. */
for (i=0; i<DIM1_LEN; i++)
if (data[i].c1 != 126 || data[i].d != -9999999) ERR;

/* Release all resources. */
if (H5Fclose(fileid) < 0) ERR;
}
SUMMARIZE_ERR;
printf("*** Checking packing of HDF5 compound types...");
{
/* Open file. */
if ((access_plist = H5Pcreate(H5P_FILE_ACCESS)) < 0) ERR;
if (H5Pset_fclose_degree(access_plist, H5F_CLOSE_STRONG)) ERR;
if ((fileid = H5Fopen(FILE_NAME, H5F_ACC_RDONLY, access_plist)) < 0) ERR;

/* Open dataset. */
if ((datasetid = H5Dopen1(fileid, VAR_NAME)) < 0) ERR;

/* Check space. */
if ((spaceid = H5Dget_space(datasetid)) < 0) ERR;
if (H5Sget_simple_extent_ndims(spaceid) != 1) ERR;
if (H5Sget_simple_extent_npoints(spaceid) != DIM1_LEN) ERR;

/* Get type. */
if ((typeid = H5Dget_type(datasetid)) < 0) ERR;

/* Read the data. */
if (H5Dread(datasetid, typeid, H5S_ALL, H5S_ALL, H5P_DEFAULT,
if (H5Dread(datasetid, typeid, H5S_ALL, H5S_ALL, H5P_DEFAULT,
data) < 0) ERR;

/* Check the data. */
Expand Down
29 changes: 6 additions & 23 deletions include/err_macros.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

Common includes, defines, etc., for test code in the libsrc4 and
nc_test4 directories.

Ed Hartnett, Russ Rew, Dennis Heimbigner
*/

#ifndef _ERR_MACROS_H
Expand All @@ -20,31 +22,19 @@
* generally cosists of several sets of tests. */
static int total_err = 0, err = 0;

#if 0
/* This is handy for print statements. */
static char *format_name[] = {"", "classic", "64-bit offset", "netCDF-4",
"netCDF-4 classic model"};
#endif

/* This macro prints an error message with line number and name of
* test program. */
#define ERR do { \
fflush(stdout); /* Make sure our stdout is synced with stderr. */ \
err++; \
fprintf(stderr, "Sorry! Unexpected result, %s, line: %d\n", \
__FILE__, __LINE__); \
fflush(stderr); \
return 2; \
} while (0)

/* This macro prints an error message with line number and name of
* test program, and then exits the program. */

#define ERR_RET do { \
fflush(stdout); /* Make sure our stdout is synced with stderr. */ \
fprintf(stderr, "Sorry! Unexpected result, %s, line: %d\n", \
__FILE__, __LINE__); \
return 2; \
} while (0)
/* Duplicate with different name. */
#define ERR_RET ERR

#define ERR_GOTO do { \
fflush(stdout); /* Make sure our stdout is synced with stderr. */ \
Expand All @@ -58,13 +48,12 @@ int ERR_report(int stat, const char* file, int line)
fflush(stdout);
fprintf(stderr, "Sorry! Unexpected result, %s, line: %d; status=%d\n",
file,line,stat);
fflush(stdout);
fflush(stderr);
return 1;
}

#define ERRSTAT(stat) {err+=ERR_report(stat,__FILE__,__LINE__);}


/* After a set of tests, report the number of errors, and increment
* total_err. */
#define SUMMARIZE_ERR do { \
Expand All @@ -78,12 +67,6 @@ int ERR_report(int stat, const char* file, int line)
printf("ok.\n"); \
} while (0)

/* If extra memory debugging is not in use (as it usually isn't),
* define away the nc_exit function, which may be in some tests. */
#ifndef EXTRA_MEM_DEBUG
#define nc_exit()
#endif

/* This macro prints out our total number of errors, if any, and exits
* with a 0 if there are not, or a 2 if there were errors. Make will
* stop if a non-zero value is returned from a test program. */
Expand Down
4 changes: 0 additions & 4 deletions libdap2/ncd2dispatch.c
Original file line number Diff line number Diff line change
Expand Up @@ -653,7 +653,6 @@ builddims(NCDAPCOMMON* dapcomm)
NCerror ncstat = NC_NOERR;
int dimid;
NClist* dimset = NULL;
NC* drno = dapcomm->controller;
NC* ncsub;
char* definename;

Expand Down Expand Up @@ -738,7 +737,6 @@ buildvars(NCDAPCOMMON* dapcomm)
NCerror ncstat = NC_NOERR;
int varid;
NClist* varnodes = dapcomm->cdf.ddsroot->tree->varnodes;
NC* drno = dapcomm->controller;
char* definename;

ASSERT((varnodes != NULL));
Expand Down Expand Up @@ -816,7 +814,6 @@ buildglobalattrs(NCDAPCOMMON* dapcomm, CDFnode* root)
char *nltxt, *p;
NCbytes* buf = NULL;
NClist* cdfnodes;
NC* drno = dapcomm->controller;

if(root->attributes != NULL) {
for(i=0;i<nclistlength(root->attributes);i++) {
Expand Down Expand Up @@ -895,7 +892,6 @@ buildattribute(NCDAPCOMMON* dapcomm, NCattribute* att, nc_type vartype, int vari
int i;
NCerror ncstat = NC_NOERR;
unsigned int nvalues = nclistlength(att->values);
NC* drno = dapcomm->controller;

/* If the type of the attribute is string, then we need*/
/* to convert to a single character string by concatenation.
Expand Down
Loading