From 9abe3cb961f1456599e325b54fed70a7f973e9fb Mon Sep 17 00:00:00 2001 From: Dennis Heimbigner Date: Tue, 13 Aug 2024 20:53:04 -0600 Subject: [PATCH] Fix bug in run_newformat.sh Problem was basically that the test file ref_oldformat.zip was incorrect. Additionally, logic in zsync.c was incorrect. ### Misc. other fixes 1. Turn off accidental debug output --- RELEASE_NOTES.md | 2 +- libnczarr/zsync.c | 11 +++++------ nc_test/Makefile.am | 12 ++++++------ ncdap_test/Makefile.am | 12 ++++++------ nczarr_test/Makefile.am | 6 +++--- nczarr_test/ref_oldformat.zip | Bin 3457 -> 3342 bytes 6 files changed, 21 insertions(+), 22 deletions(-) diff --git a/RELEASE_NOTES.md b/RELEASE_NOTES.md index 61de9da520..f96349383a 100644 --- a/RELEASE_NOTES.md +++ b/RELEASE_NOTES.md @@ -7,7 +7,7 @@ This file contains a high-level description of this package's evolution. Release ## 4.9.3 - TBD -* Provide better documentation for the .rc file mechanism and API. See [Github #????](https://github.com/Unidata/netcdf-c/pull/????) for more information. +* Provide better documentation for the .rc file mechanism and API. See [Github #2956](https://github.com/Unidata/netcdf-c/pull/2956) for more information. * Convert NCZarr V2 to store all netcdf-4 specific info as attributes. This improves interoperability with other Zarr implementations by no longer using non-standard keys. The price to be paid is that lazy attribute reading cannot be supported. See [Github #2836](https://github.com/Unidata/netcdf-c/pull/2936) for more information. * Cleanup the option code for NETCDF_ENABLE_SET_LOG_LEVEL\[_FUNC\] See [Github #2931](https://github.com/Unidata/netcdf-c/pull/2931) for more information. * diff --git a/libnczarr/zsync.c b/libnczarr/zsync.c index 5fcb2547da..c9d55ee751 100644 --- a/libnczarr/zsync.c +++ b/libnczarr/zsync.c @@ -1513,7 +1513,7 @@ define_var1(NC_FILE_INFO_T* file, NC_GRP_INFO_T* grp, const char* varname) if(jvalue != NULL) var->storage = NC_CHUNKED; /* Extract dimrefs list */ - if((stat = dictgetalt(jncvar,"dimension_references","dimensions",&jdimrefs))) goto done; + if((stat = dictgetalt(jncvar,"dimension_references","dimrefs",&jdimrefs))) goto done; if(jdimrefs != NULL) { /* Extract the dimref names */ assert((NCJsort(jdimrefs) == NCJ_ARRAY)); if(zvar->scalar) { @@ -1851,7 +1851,7 @@ ncz_read_superblock(NC_FILE_INFO_T* file, char** nczarrvp, char** zarrfp) if(jsuper != NULL) { if(jsuper->sort != NCJ_DICT) {stat = NC_ENCZARR; goto done;} - if((stat = NCJdictget(jsuper,"version",&jtmp))<0) {stat = NC_EINVAL; goto done;} + if((stat = dictgetalt(jsuper,"nczarr_version","version",&jtmp))<0) {stat = NC_EINVAL; goto done;} nczarr_version = nulldup(NCJstring(jtmp)); } @@ -2572,14 +2572,13 @@ getnczarrkey(NC_OBJ* container, const char* name, const NCjson** jncxxxp) jxxx = NULL; if((stat = NCJdictget(zobj->atts,name,&jxxx))<0) {stat = NC_EINVAL; goto done;} } - if(name == NULL) { - jxxx = NULL; + if(jxxx == NULL) { /* Try .zxxx second */ if(zobj->obj != NULL) { if((stat = NCJdictget(zobj->obj,name,&jxxx))<0) {stat = NC_EINVAL; goto done;} } - /* Mark as old style with _nczarr_xxx in obj not attributes */ - zobj->nczv1 = 1; + if(jxxx != NULL) + zobj->nczv1 = 1; /* Mark as old style with _nczarr_xxx in obj not attributes */ } if(jncxxxp) *jncxxxp = jxxx; done: diff --git a/nc_test/Makefile.am b/nc_test/Makefile.am index 6654119acd..f46e8d6cf1 100644 --- a/nc_test/Makefile.am +++ b/nc_test/Makefile.am @@ -126,13 +126,13 @@ tst_http_nc3.cdl tst_http_nc4?.cdl tmp*.cdl tmp*.nc EXTRA_DIST += bad_cdf5_begin.nc run_cdf5.sh nc_enddef.cdl if NETCDF_ENABLE_CDF5 - # bad_cdf5_begin.nc is a corrupted CDF-5 file with bad variable starting - # file offsets. It is to be used by tst_open_cdf5.c to check if it can - # detect and report error code NC_ENOTNC. - TESTS += run_cdf5.sh - check_PROGRAMS += tst_open_cdf5 +# bad_cdf5_begin.nc is a corrupted CDF-5 file with bad variable starting +# file offsets. It is to be used by tst_open_cdf5.c to check if it can +# detect and report error code NC_ENOTNC. +TESTS += run_cdf5.sh +check_PROGRAMS += tst_open_cdf5 if LARGE_FILE_TESTS - TESTPROGRAMS += tst_large_cdf5 tst_cdf5_begin +TESTPROGRAMS += tst_large_cdf5 tst_cdf5_begin endif endif diff --git a/ncdap_test/Makefile.am b/ncdap_test/Makefile.am index 1e121db17c..e7d8ff834f 100644 --- a/ncdap_test/Makefile.am +++ b/ncdap_test/Makefile.am @@ -60,15 +60,15 @@ TESTS += tst_hyrax.sh TESTS += test_partvar # Various - TESTS += tst_longremote3.sh - tst_longremote3.log: tst_remote3.log +TESTS += tst_longremote3.sh +tst_longremote3.log: tst_remote3.log endif if NETCDF_ENABLE_DAP_LONG_TESTS - test_manyurls_SOURCES = test_manyurls.c manyurls.h - check_PROGRAMS += test_manyurls - test_manyurls.log: tst_longremote3.log - TESTS += test_manyurls +test_manyurls_SOURCES = test_manyurls.c manyurls.h +check_PROGRAMS += test_manyurls +test_manyurls.log: tst_longremote3.log +TESTS += test_manyurls endif test_partvar_SOURCES = test_partvar.c diff --git a/nczarr_test/Makefile.am b/nczarr_test/Makefile.am index e868feb57f..7054eeb42b 100644 --- a/nczarr_test/Makefile.am +++ b/nczarr_test/Makefile.am @@ -96,8 +96,8 @@ TESTS += run_unlim_io.sh run_nccopyz.sh endif if LARGE_FILE_TESTS - check_PROGRAMS += test_writecaching test_readcaching - TESTS += run_cachetest.sh +check_PROGRAMS += test_writecaching test_readcaching +TESTS += run_cachetest.sh endif endif #NETCDF_BUILD_UTILITIES @@ -105,7 +105,7 @@ endif #NETCDF_BUILD_UTILITIES if NETCDF_BUILD_UTILITIES if NETCDF_ENABLE_NCZARR_ZIP - TESTS += run_newformat.sh +TESTS += run_newformat.sh endif if LARGE_FILE_TESTS diff --git a/nczarr_test/ref_oldformat.zip b/nczarr_test/ref_oldformat.zip index ddf9c4d906cad3da4797bfc0afdc8e577899a660..41a49399577335e3e0738e9b2c8e807631d810c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