Commit Graph

177 Commits

Author SHA1 Message Date
Dennis Heimbigner
99fccab359 1. Keep up to date by merging master
2. Fixed plugin building (nc_test4/hdf5plugins)
   to be done properly by cmake and automake.
4. Duplicated part of the nc_test4 filter test code
   in examples/C

An incomplete and untested set of hooks exist
for OS-X in nc_test4/findplugins.in. They need testing.
2018-01-16 11:00:09 -07:00
Ed Hartnett
0fbfc2bce4 more warnings 2017-11-30 09:16:29 -07:00
Ed Hartnett
3c5404ccf7
Merge branch 'master' into ejh_ncfunc_testing 2017-11-28 00:04:38 +00:00
Ed Hartnett
f779345b23 eliminating test dependencies in ncdap_test 2017-11-26 07:00:17 -07:00
Dennis Heimbigner
4db4393e69 Begin changing over to use strlcat instead of strncat because
strlcat provides better protection against buffer overflows.

Code is taken from the FreeBSD project source code. Specifically:
https://github.com/freebsd/freebsd/blob/master/lib/libc/string/strlcat.c
License appears to be acceptable, but needs to be checked by e.g. Debian.

Step 1:
1. Add to netcdf-c/include/ncconfigure.h to use our version
   if not already available as determined by HAVE_STRLCAT in config.h.
2. Add the strlcat code to libdispatch/dstring.c
3. Turns out that strlcat was already defined in several places.
   So remove it from:
	ncgen3/genlib.c
	ncdump/dumplib.c
3. Define strlcat extern definition in ncconfigure.h.
4. Modify following directories to use strlcat:
	libdap2 libdap4 ncdap_test dap4_test
   Will do others in subsequent steps.
2017-11-23 10:55:24 -07:00
Ed Hartnett
66ddc9dfb4 getting make -j check working 2017-11-17 10:49:06 -07:00
Ward Fisher
16d6f94f30 Merge branch 'master' into filters.dmh 2017-11-13 11:15:02 -07:00
Ed Hartnett
74519d550b moved tests dependant on ncdump inside BUILD_UTILITIES block in Makefile.am files 2017-11-04 08:12:48 -06:00
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
Dennis Heimbigner
d8d4ed627a master merge 2017-08-29 18:05:46 -06:00
Dennis Heimbigner
e9888829f0 Suppress debug output 2017-08-29 15:10:55 -06:00
Dennis Heimbigner
b0cf032ddd Merge branch 'master' into authtesting.dmh 2017-08-20 15:01:19 -06:00
Ward Fisher
9e7a902dcf Merge branch 'issue435.dmh' into multi-pull 2017-07-27 12:20:11 -06:00
Ward Fisher
30711ccb20 Updated shell scripts to accomodate windows style carriage returns. 2017-07-26 13:35:27 -06:00
Dennis Heimbigner
07d67e737a 1. Cleaned up some holdover debug code.
2. modified ncdap_tests to remove <cr>
   from generated output before comparison
   to expected. This is a hack because
   my other attempts to force windows to use
   binary mode have not worked.
2017-07-25 14:58:29 -06:00
Dennis Heimbigner
adb86f9aed ckp 2017-07-21 13:54:09 -06:00
Dennis Heimbigner
6505ff6880 Force file opens to default to binary mode for cygwin and windows 2017-07-17 18:58:45 -06:00
Dennis Heimbigner
88b3d20e4e turn debug on 2017-07-16 13:13:10 -06:00
Dennis Heimbigner
967187f1a5 turn of extra debug 2017-07-15 20:21:24 -06:00
Dennis Heimbigner
d08a028a37 use srcdir instead of pws 2017-07-15 19:16:45 -06:00
Dennis Heimbigner
86c8898bdd add tst_ber.sh to extra dist 2017-07-15 15:39:34 -06:00
Dennis Heimbigner
aa74d73da0 update file permissions on test_ber 2017-07-15 14:45:57 -06:00
Dennis Heimbigner
fb0a679c2a verbose output 2017-07-15 14:32:21 -06:00
Dennis Heimbigner
75c551f53d bug fix in dwinpath 2017-07-15 13:03:35 -06:00
Dennis Heimbigner
1b138ecf64 more debug info 2017-07-14 19:37:35 -06:00
Dennis Heimbigner
081963ef8a forgot to add to cmake 2017-07-14 16:44:50 -06:00
Dennis Heimbigner
5117cc1052 Attempt to get more debug info out of ber test 2017-07-14 16:38:50 -06:00
Dennis Heimbigner
d1544b8ad9 Error in ncuri in handling user:pwd@ in url 2017-07-05 14:39:23 -06:00
Dennis Heimbigner
9719fbfbad re: hithub issue https://github.com/Unidata/netcdf-c/issues/435
Some temporary files are being left in a tempdir (e.g. /tmp
under *nix*).

The situation is described tersely in
netcdf-c/docs/auth.html#REDIR Basically, when a url is used that
requires redirection, a physical cookiejar file is required
to exist in the file system in order for this to work.

Since it was difficult to figure out when redirection was
being used (it was internal to libcurl) I needed to be prepared for that
eventuality. The result was that I always created a cookiejar file if one
was not specified in the rc file. This actually occurs in two places:
one inside oc2 and one inside libdap4.

The solution was two-fold:
1. do not use a cookiejar directory -- create cookiejar file directly
2. ensure that all cookiejar related files are reclaimed by nc_close().
Note that if nc_close (or nc_abort) is not called for whatever reason,
then reclamation will not occur.
2017-07-05 10:03:48 -06:00
Dennis Heimbigner
0ae22325f3 Forgot to add test files to github 2017-06-28 15:08:20 -06:00
Dennis Heimbigner
dc9e31df68 Fix for github issue https://github.com/Unidata/netcdf-c/issues/310.
The problem was that for opendap, it is possible to use keywords
as identifiers
 when there is no ambiguity. However, the DAP2
parser lost the case of the identifier used the lower case version.
Fix is to use the actual text of the symbol when it is used as an identifier.
Also added a test case for this (kwcase.*).

Additionally cleaned up some misc. dap2 testing problems.
1. ncdap_test/tst_ncdap3.sh was using an empty test set.
   restored the testing of datasets.
2. as a consequence of #1, some tests needed to be updated with minor
   tweeks.
3. fix dapmerge to handle multiple DODS_EXTRAS attributes.
4. modify buildattribute to suppress nul characters and terminate
   the name at the first nul.
5. clean up various test scripts to remove residual, unused
   references to obsolete netcdf-4 translation.
6. export e.g. NCDUMP from test_common.in so that non-top-level
   shell scripts can access it.
2017-06-28 13:51:01 -06:00
Dennis Heimbigner
6d8809100f Fix pull request https://github.com/Unidata/netcdf-c/pull/374 (dap4.dmh)
1. When running under windows (as opposed to cygwin)
   we need to make sure to not user /cygdrive/ file paths.
   This was ocurring in libdap4/d4read.c, but may occur
   elsewhere.
2. Shell scripts in the git repo are not being checked-out
   with the executable mode set. Had core.filemode set to false.
   Was a major hassle to fix.
2017-04-03 21:39:44 -06:00
Dennis Heimbigner
be6e1b65dc Fix conflicts with master 2017-03-17 14:58:38 -06:00
Dennis Heimbigner
3024070a58 Update affected test cases 2017-03-11 18:17:38 -07:00
Dennis Heimbigner
3db4f013bf Primary change: add dap4 support
Specific changes:
1. Add dap4 code: libdap4 and dap4_test.
   Note that until the d4ts server problem is solved, dap4 is turned off.
2. Modify various files to support dap4 flags:
	configure.ac, Makefile.am, CMakeLists.txt, etc.
3. Add nc_test/test_common.sh. This centralizes
   the handling of the locations of various
   things in the build tree: e.g. where is
   ncgen.exe located. See nc_test/test_common.sh
   for details.
4. Modify .sh files to use test_common.sh
5. Obsolete separate oc2 by moving it to be part of
   netcdf-c. This means replacing code with netcdf-c
   equivalents.
5. Add --with-testserver to configure.ac to allow
   override of the servers to be used for --enable-dap-remote-tests.
6. There were multiple versions of nctypealignment code. Try to
   centralize in libdispatch/doffset.c and include/ncoffsets.h
7. Add a unit test for the ncuri code because of its complexity.
8. Move the findserver code out of libdispatch and into
   a separate, self contained program in ncdap_test and dap4_test.
9. Move the dispatch header files (nc{3,4}dispatch.h) to
   .../include because they are now shared by modules.
10. Revamp the handling of TOPSRCDIR and TOPBUILDDIR for shell scripts.
11. Make use of MREMAP if available
12. Misc. minor changes e.g.
	- #include <config.h> -> #include "config.h"
	- Add some no-install headers to /include
	- extern -> EXTERNL and vice versa as needed
	- misc header cleanup
	- clean up checking for misc. unix vs microsoft functions
13. Change copyright decls in some files to point to LICENSE file.
14. Add notes to RELEASENOTES.md
2017-03-08 17:01:10 -07:00
Dennis Heimbigner
ee2916f60a Originally, libdap2 was also going to provide
a dap2->netcdf-4 translation. That is now
superceded by dap4. But there is some cruft
in the dap2 code around this that should be removed.
2017-02-21 15:13:37 -07:00
Dennis Heimbigner
7be9506aac Modified ncdap_test to allow a different method
to get TOPSRCDIR that avoids use of
TEST_ENVIRONMENT and makes automake and cmake
more consistent.

Basic assumption is that abs_top_srcdir (and
cmake equivalent) is known at 'make check' time,
so we can use -D flag to compile a program that
has the value of abs_top_srcdir embedded into it
as a constant.

We define two new files in ncdap_test:
1. t_srcdir.h -- provide a gettopsrcdir() function
   to return the topsrcdir value to the test program.
2. topsrcdir.c -- a program that calls gettopsrcdir()
   and prints its output (minus any newline) on stdout.
   This is used in .sh files to get topsrcdir.
2017-01-18 21:46:47 -07:00
Ward Fisher
b477a9c1b3 Corrected a typo resulting in a cmake warning. 2016-09-06 12:41:48 -06:00
Ward Fisher
486f69522c Merged utility-based tests fix into cmake-based builds. 2016-08-31 15:48:10 -06:00
Ward Fisher
b2e4b74e3a Restricted tests from running when they require the utilities but the utilities were not built, in autoconf-based tests. See https://github.com/Unidata/netcdf-c/issues/313 for more information. 2016-08-31 15:38:59 -06:00
dmh
764a1c40a3 ckp 2016-04-06 19:51:40 -06:00
Dennis Heimbigner
a8ff523677 ckp 2016-04-06 14:05:58 -06:00
dmh
cbb6df3232 Github issue 152: https://github.com/Unidata/netcdf-c/issues/152
User request to have all orphaned DAP2 attributes kept as netcdf
global attributes. This is primarily a change in the oc code
nplus testcase dataset changes.

Result may be inconsistent with netcdf-Java output.
2015-11-29 20:38:12 -07:00
dmh
859f105005 merge-squash 2015-08-15 16:26:35 -06:00
Russ Rew
ec89eb5806 Fix ncdump clang warnings. Fix invalid encodings for some non-ascii strings in tests. 2015-08-02 16:09:47 -06:00
dmh
c5fe913d54 re: https://github.com/Unidata/netcdf-c/issues/117
It appears the problem is that synth9 was erroneously
included in testing. It involves a nested sequence which
is not translatable. Not sure why it was still there,
but fix is to suppress the test.
2015-07-05 19:26:01 -06:00
dmh
dbc7215063 1. fix nc_open_mem doxygen description
2. fix some bugs wrt to cygwin vs linux.
3. add to RELEASE_NOTES
4. try to fix tst_inmemory fd error by putting the first
   arg to dotest in quotes.
2015-05-28 19:23:33 -06:00
dmh
3dd807a155 The original mem branch somehow got
hosed, so I rebuilt it as a new mem2 branch.
2015-05-28 15:10:10 -06:00
dmh
805a4882cb conflicts 2015-05-26 15:56:21 -06:00
dmh
be5e3cd606 1. Allow for the user specified rc file via the env variable
DAPRCFILE.  Note that the value of this environment
   variable should be the absolute path of the rc file, not
   the path to its containing directory.
2. fixup testauth.sh and add some new tests
3. synch oc
2015-05-24 17:31:39 -06:00