From aa6a3969b714fdaa56360f64104ae193b92ea459 Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Wed, 30 Mar 2016 15:03:20 -0600 Subject: [PATCH] Included expected failures for netcdf-3 files and nc_inq_type. --- nc_test/tst_inq_type.c | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/nc_test/tst_inq_type.c b/nc_test/tst_inq_type.c index 097fb5619..c09bfaa24 100644 --- a/nc_test/tst_inq_type.c +++ b/nc_test/tst_inq_type.c @@ -30,6 +30,16 @@ check_err(const int stat, const int line, const char *file) { } } + +int test_type_should_fail(int ncid, int type, char* tstring) { + + printf("\t* Testing Type (Should Fail) %s:\t",tstring); + if(!nc_inq_type(ncid,type,NULL,NULL)) ERR; + else printf("expected failure.\n"); + + return 0; +} + int test_type(int ncid, int type, char* tstring) { printf("\t* Testing Type %s:\t",tstring); @@ -58,14 +68,14 @@ int main(int argc, char **argv) { test_type(ncid, NC_FLOAT,"NC_FLOAT"); test_type(ncid, NC_DOUBLE,"NC_DOUBLE"); - /* Not Valid for Classic - test_type(ncid, NC_UBYTE,"NC_UBYTE"); - test_type(ncid, NC_USHORT,"NC_USHORT"); - test_type(ncid, NC_UINT,"NC_UINT"); - test_type(ncid, NC_INT64,"NC_INT64"); - test_type(ncid, NC_UINT64,"NC_UINT64"); - test_type(ncid, NC_STRING,"NC_STRING"); - */ + /* Not Valid for Classic */ + test_type_should_fail(ncid, NC_UBYTE,"NC_UBYTE"); + test_type_should_fail(ncid, NC_USHORT,"NC_USHORT"); + test_type_should_fail(ncid, NC_UINT,"NC_UINT"); + test_type_should_fail(ncid, NC_INT64,"NC_INT64"); + test_type_should_fail(ncid, NC_UINT64,"NC_UINT64"); + test_type_should_fail(ncid, NC_STRING,"NC_STRING"); + if(nc_close(ncid)) ERR; } @@ -92,6 +102,8 @@ int main(int argc, char **argv) { if(nc_close(ncid)) ERR; } +#ifdef USE_NETCDF4 + { printf("\n* Testing nc_inq_type with netcdf-4 + Classic Model\n"); @@ -136,6 +148,7 @@ int main(int argc, char **argv) { if(nc_close(ncid)) ERR; } +#endif // USE_NETCDF4 printf("* Finished.\n");