mirror of
https://github.com/Unidata/netcdf-c.git
synced 2024-12-21 08:39:46 +08:00
eb3d9eb0c9
Primary changes: * Add an improved cache system to speed up performance. * Fix NCZarr to properly handle scalar variables. Misc. Related Changes: * Added unit tests for extendible hash and for the generic cache. * Add config parameter to set size of the NCZarr cache. * Add initial performance tests but leave them unused. * Add CRC64 support. * Move location of ncdumpchunks utility from /ncgen to /ncdump. * Refactor auth support. Misc. Unrelated Changes: * More cleanup of the S3 support * Add support for S3 authentication in .rc files: HTTP.S3.ACCESSID and HTTP.S3.SECRETKEY. * Remove the hashkey from the struct OBJHDR since it is never used.
77 lines
1.7 KiB
C
77 lines
1.7 KiB
C
/*
|
|
* Copyright 2018, University Corporation for Atmospheric Research
|
|
* See netcdf/COPYRIGHT file for copying and redistribution conditions.
|
|
*/
|
|
|
|
#ifndef ZTEST_H
|
|
#define ZTEST_H
|
|
|
|
#include "nclist.h"
|
|
|
|
typedef struct Dimdef {
|
|
char* name;
|
|
size64_t size;
|
|
} Dimdef;
|
|
|
|
typedef struct Vardef {
|
|
char* name;
|
|
nc_type typeid;
|
|
size_t typesize;
|
|
int rank;
|
|
Dimdef* dimrefs[NC_MAX_VAR_DIMS];
|
|
size64_t dimsizes[NC_MAX_VAR_DIMS];
|
|
size64_t chunksizes[NC_MAX_VAR_DIMS];
|
|
} Vardef;
|
|
|
|
/* Expose functions for unit tests */
|
|
typedef struct NCZ_UT_PRINTER {
|
|
int printsort;
|
|
void (*printer)(struct NCZ_UT_PRINTER*);
|
|
/* Union of all fields */
|
|
int rank;
|
|
size64_t count;
|
|
size64_t offset;
|
|
size64_t* indices;
|
|
size64_t* vector;
|
|
void** pvector;
|
|
NCZOdometer* odom;
|
|
void* output;
|
|
size_t used;
|
|
} NCZ_UT_PRINTER;
|
|
|
|
/* Arguments from command line */
|
|
struct UTOptions {
|
|
int debug;
|
|
char** cmds;
|
|
char* file;
|
|
char* output;
|
|
char* kind;
|
|
NCZChunkRange ranges[NC_MAX_VAR_DIMS];
|
|
int nslices;
|
|
NCZSlice slices[NC_MAX_VAR_DIMS];
|
|
NClist* dimdefs; /*List<struct Dimdef*> */
|
|
NClist* vardefs; /*List<struct Vardef*> */
|
|
size_t idatalen;
|
|
int* idata;
|
|
};
|
|
|
|
struct Test {
|
|
char* cmd;
|
|
int (*test)(void);
|
|
};
|
|
|
|
extern struct UTOptions utoptions;
|
|
|
|
#define NCCHECK(expr) nccheck((expr),__LINE__)
|
|
|
|
extern void usage(int err);
|
|
extern int ut_init(int argc, char** argv, struct UTOptions* test);
|
|
|
|
extern void nccheck(int stat, int line);
|
|
extern char* makeurl(const char* file,NCZM_IMPL);
|
|
//extern int setup(int argc, char** argv);
|
|
extern struct Test* findtest(const char* cmd, struct Test* tests);
|
|
extern int runtests(const char** cmds, struct Test* tests);
|
|
|
|
#endif /*ZTEST_H*/
|