netcdf-c/libdap4/d4debug.h
Dennis Heimbigner 835b81a285 Cleanup DAP4 testing
NOTE: This PR should not be included in 4.9.1 since additional
DAP4 related PRs will be forthcoming.

This PR makes major changes to libdap4 and dap4_test driven by changes to TDS.

* Enable DAP4
* Clean up the test input files and the test baseline comparison files. This entails:
    * Remove a multitude of unused test input and baseline data files; among them are dap4_test/: daptestfiles, dmrtestfiles, nctestfiles, and misctestfiles.
    * Define a canonical set of test input files and record in dap4_test/cdltestfiles.
    * Use the cdltestfiles to generate the .nc test inputs. This set of .nc files is then moved to the d4ts (DAP4 test server) war file in the tds repository. This set then becomes the canonical set of DAP4 test sources.
    * Scrape d4ts to obtain copies of the raw streams of DAP4 encoded data. The .dmr and .dap streams are then stored in dap4_test/rawtestfiles.
    * Disable some remote server tests until those servers are fixed.
* Add an option to ncdump (-XF) that forces the type of the _FillValue attribute; this is primarily to simplify testing of fill mismatch.
* Minor bug fixes to ncgen.
* Changes to libdap4:
    * Replace old checksum hack with the dap4.checksum flag.
    * Support the dap4.XXX controls.
    * Cleanup _FillValue handling, especially var-attribute type mismatches.
    * Fix enum handling based on changes to netcdf-java.
* Changes to dap4_test:
    * Add getopt support to various test support programs.
    * Remove unneeded shell scripts.
    * Add new scripts: test_curlopt.sh
2022-11-13 13:15:11 -07:00

70 lines
1.7 KiB
C

/*********************************************************************
* Copyright 2018, UCAR/Unidata
* See netcdf/COPYRIGHT file for copying and redistribution conditions.
*********************************************************************/
#ifndef D4DEBUG_H
#define D4DEBUG_H
#include <assert.h>
#include <stdarg.h>
#undef D4CATCH /* Warning: significant performance impact */
#undef D4DEBUG /* general debug */
#undef D4DEBUGPARSER
#undef D4DEBUGMETA
#undef D4DUMPDAP
#undef D4DUMPRAW
#undef D4DEBUGDATA
#undef D4DUMPDMR
#undef D4DUMPCSUM
#ifdef D4DEBUG
#define D4DEBUGPARSER
#define D4DEBUGMETA
#define D4DEBUGDATA
#define D4DUMPCSUM
#define D4DUMPDMR
#define D4DUMPDAP
#endif
#define PANIC(msg) assert(d4panic(msg));
#define PANIC1(msg,arg) assert(d4panic(msg,arg));
#define PANIC2(msg,arg1,arg2) assert(d4panic(msg,arg1,arg2));
#define ASSERT(expr) if(!(expr)) {PANIC(#expr);} else {}
extern int ncd4debug;
extern int d4panic(const char* fmt, ...);
#define MEMCHECK(var) {if((var)==NULL) return (NC_ENOMEM);}
#ifdef D4CATCH
/* Place breakpoint on dapbreakpoint to catch errors close to where they occur*/
#define THROW(e) d4throw(e)
#define THROWCHK(e) (void)d4throw(e)
extern int d4breakpoint(int err);
extern int d4throw(int err);
#else
#define THROW(e) (e)
#define THROWCHK(e)
#endif
#ifdef D4DEBUG
#define SHOWFETCH (1)
#else
#define SHOWFETCH FLAGSET(nccomm->controls,NCF_SHOWFETCH)
#endif
#define LOG0(level,msg) nclog(level,msg)
#define LOG1(level,msg,a1) nclog(level,msg,a1)
#define LOG2(level,msg,a1,a2) nclog(level,msg,a1,a2)
extern const char* NCD4_sortname(NCD4sort sort);
extern const char* NCD4_subsortname(nc_type subsort);
extern int NCD4_debugcopy(NCD4INFO* info);
#endif /*D4DEBUG_H*/