netcdf-c/nc_test
Dennis Heimbigner 9983b9d911 re e-support UBS-599337
re pull request https://github.com/Unidata/netcdf-c/pull/405
re pull request https://github.com/Unidata/netcdf-c/pull/446

Notes:
1. This branch is a cleanup of the magic.dmh branch.
2. magic.dmh was originally merged, but caused problems with parallel IO.
   It was re-issued as pull request https://github.com/Unidata/netcdf-c/pull/446.
3. This branch + pull request replace any previous pull requests and magic.dmh branch.

Given an otherwise valid netCDF file that has a corrupted header,
the netcdf library currently crashes. Instead, it should return
NC_ENOTNC.

Additionally, the NC_check_file_type code does not do the
forward search required by hdf5 files. It currently only looks
at file position 0 instead of 512, 1024, 2048,... Also, it turns
out that the HDF4 magic number is assumed to always be at the
beginning of the file (unlike HDF5).
The change is localized to libdispatch/dfile.c See
https://support.hdfgroup.org/release4/doc/DSpec_html/DS.pdf

Also, it turns out that the code in NC_check_file_type is duplicated
(mostly) in the function libsrc4/nc4file.c#nc_check_for_hdf.

This branch does the following.
1. Make NC_check_file_type return NC_ENOTNC instead of crashing.
2. Remove nc_check_for_hdf and centralize all file format checking
   NC_check_file_type.
3. Add proper forward search for HDF5 files (but not HDF4 files)
   to look for the magic number at offsets of 0, 512, 1024...
4. Add test tst_hdf5_offset.sh. This tests that hdf5 files with
   an offset are properly recognized. It does so by prefixing
   a legal file with some number of zero bytes: 512, 1024, etc.
5. Off-topic: Added -N flag to ncdump to force a specific output dataset name.
2017-10-24 16:25:09 -06:00
..
CMakeLists.txt Wiring in a large test to check against a regression for the issue described in https://github.com/Unidata/netcdf-c/pull/457 2017-08-11 18:18:11 -06:00
error.c match type of a subroutine argument 2016-10-25 13:28:38 -05:00
error.h match type of a subroutine argument 2016-10-25 13:28:38 -05:00
large_files.c Fixed issue on 32-bit systems. 2017-07-05 14:57:12 -06:00
Make0 re e-support UBS-599337 2017-10-24 16:25:09 -06:00
make_test_file.sh moving to trunk subdir 2010-06-03 13:24:43 +00:00
Makefile.am Wiring in a large test to check against a regression for the issue described in https://github.com/Unidata/netcdf-c/pull/457 2017-08-11 18:18:11 -06:00
nc_enddef.c moving to trunk subdir 2010-06-03 13:24:43 +00:00
nc_enddef.cdl moving to trunk subdir 2010-06-03 13:24:43 +00:00
nc_sync_child.c moving to trunk subdir 2010-06-03 13:24:43 +00:00
nc_sync.c Fix common typos 2015-08-20 11:42:05 +02:00
nc_sync.cdl moving to trunk subdir 2010-06-03 13:24:43 +00:00
nc_sync.h moving to trunk subdir 2010-06-03 13:24:43 +00:00
nc_test.c Updated nc_test to respect USE_CDF5 2017-09-18 13:24:11 -06:00
nc_test.html moving to trunk subdir 2010-06-03 13:24:43 +00:00
quick_large_files.c Housekeeping on large file tests. 2016-11-18 15:48:58 -07:00
ref_tst_diskless2.cdl - Implemented diskless files for both netcdf classic and extended. 2012-03-26 01:34:32 +00:00
run_diskless2.sh re e-support UBS-599337 2017-10-24 16:25:09 -06:00
run_diskless5.sh typo 2017-05-03 10:19:35 -06:00
run_diskless.sh Fix pull request https://github.com/Unidata/netcdf-c/pull/374 (dap4.dmh) 2017-04-03 21:39:44 -06:00
run_mmap.sh Fix pull request https://github.com/Unidata/netcdf-c/pull/374 (dap4.dmh) 2017-04-03 21:39:44 -06:00
run_pnetcdf_test.sh Primary change: add dap4 support 2017-03-08 17:01:10 -07:00
run_valgrind_tests.sh Fixed dap memory leaks 2010-12-17 23:54:09 +00:00
t_nc_p5.c merge-squash 2015-10-09 10:12:11 -06:00
t_nc.c Modified t_nc.c to only test cdf5 if it has been enabled. 2017-10-16 11:19:24 -06:00
test_get_p5.c merge-squash 2015-10-09 10:12:11 -06:00
test_get_p5.m4 add CDF format checking in hash4 to exclude the NC_BYTE-to-uchar exception fro CDF-5 format 2016-10-08 13:48:22 -05:00
test_get.m4 silence warnings from Travis CI 2017-03-11 12:51:04 -06:00
test_put.m4 silence warnings from Travis CI 2017-03-11 12:51:04 -06:00
test_read.m4 Corrected an issue on *nix systems 2017-03-16 15:13:38 -06:00
test_write.m4 Working on getting cdf5 tests running. 2017-09-15 18:00:28 -06:00
testnc3perf.c Fix pull request https://github.com/Unidata/netcdf-c/pull/374 (dap4.dmh) 2017-04-03 21:39:44 -06:00
tests.h Corrected an issue on *nix systems 2017-03-16 15:13:38 -06:00
tst_addvar.c [NCF-344] Modified addvar test to return 0 when called without an argument. Test doesn't run unless passed a file, but it isn't a failure. The test is run properly through a shell script already. 2015-10-30 17:11:27 +00:00
tst_atts3.c sync with master branch 2016-10-28 11:54:25 -05:00
tst_atts.c More refactoring, pushing to avoid accidental loss. 2016-10-21 19:24:40 +00:00
tst_big_rvar.c Housekeeping on large file tests. 2016-11-18 15:48:58 -07:00
tst_big_var2.c Housekeeping on large file tests. 2016-11-18 15:48:58 -07:00
tst_big_var6.c Housekeeping on large file tests. 2016-11-18 15:48:58 -07:00
tst_big_var.c Housekeeping on large file tests. 2016-11-18 15:48:58 -07:00
tst_cdf5format.c merge-squash 2015-10-09 10:12:11 -06:00
tst_diskless2.c Fix non-portable test that depends on nonstandardized floating-point format using e+08, not e+008. Fixes for some problems reported in scan-build static analysis. 2012-04-23 23:59:24 +00:00
tst_diskless3.c More refactoring, pushing to avoid accidental loss. 2016-10-21 19:24:40 +00:00
tst_diskless4.c More refactoring, pushing to avoid accidental loss. 2016-10-21 19:24:40 +00:00
tst_diskless5.c Corrected a build issue on windows for tst_diskless5, and updated release notes. 2017-05-04 10:58:18 -06:00
tst_diskless5.cdl Add testcase 2017-05-03 09:58:49 -06:00
tst_diskless.c More refactoring, pushing to avoid accidental loss. 2016-10-21 19:24:40 +00:00
tst_elatefill.c rename macro ERR to ERR_CHK, as ERR is already defined in err_macros.h 2017-04-03 22:17:36 -05:00
tst_formatx_pnetcdf.c Call nc_close, which calls MPI_File_close, to avoid MPI wraning messages on MPI objects are still allocated. 2017-08-08 16:54:38 -05:00
tst_global_fillval.c reverted test. 2017-10-06 12:58:49 -06:00
tst_inq_type.c More refactoring, pushing to avoid accidental loss. 2016-10-21 19:24:40 +00:00
tst_large_cdf5.c Fixed a simple mistake in test organization. 2017-08-11 18:36:44 -06:00
tst_large.c Housekeeping on large file tests. 2016-11-18 15:48:58 -07:00
tst_meta.c merge-squash 2015-10-09 10:12:11 -06:00
tst_misc.c Refactoring tests to separate out error macros from tests, in support of fixing http://github.com/Unidata/netcdf-c/issues/321 2016-10-21 17:17:39 +00:00
tst_names.c Refactoring tests to separate out error macros from tests, in support of fixing http://github.com/Unidata/netcdf-c/issues/321 2016-10-21 17:17:39 +00:00
tst_nofill2.c Refactoring tests to separate out error macros from tests, in support of fixing http://github.com/Unidata/netcdf-c/issues/321 2016-10-21 17:17:39 +00:00
tst_nofill3.c Refactoring tests to separate out error macros from tests, in support of fixing http://github.com/Unidata/netcdf-c/issues/321 2016-10-21 17:17:39 +00:00
tst_nofill.c Refactoring tests to separate out error macros from tests, in support of fixing http://github.com/Unidata/netcdf-c/issues/321 2016-10-21 17:17:39 +00:00
tst_norm.c Refactoring tests to separate out error macros from tests, in support of fixing http://github.com/Unidata/netcdf-c/issues/321 2016-10-21 17:17:39 +00:00
tst_parallel2.c Corrected parallel tests in support of https://github.com/Unidata/netcdf-c/issues.321 2016-10-24 22:45:15 +00:00
tst_pnetcdf.c Corrected parallel tests in support of https://github.com/Unidata/netcdf-c/issues.321 2016-10-24 22:45:15 +00:00
tst_put_vars.c Added the [NCF-326] test to CMake build system. 2015-03-10 09:53:13 -06:00
tst_small.c Updated tst_small 2017-09-18 15:08:49 -06:00
tst_utf8_phrases.c Corrected an issue in support of https://github.com/Unidata/netcdf-c/issues/420 2017-06-09 12:46:37 -06:00
tst_utf8_validate.c Corrected an issue in support of https://github.com/Unidata/netcdf-c/issues/420 2017-06-09 12:46:37 -06:00
util.c Fix dap4 related warnings in https://github.com/Unidata/netcdf-c/issues/501. 2017-10-20 21:17:12 -06:00