2016-02-02 07:15:58 +08:00
|
|
|
/**
|
2016-10-26 01:56:25 +08:00
|
|
|
* @file
|
2016-02-02 07:15:58 +08:00
|
|
|
* Test some illegal mode combinations
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "nc_tests.h"
|
2016-10-26 01:56:25 +08:00
|
|
|
#include "err_macros.h"
|
2016-02-02 07:15:58 +08:00
|
|
|
#include "netcdf_par.h"
|
|
|
|
|
|
|
|
#define FILE_NAME "tst_mode.nc"
|
|
|
|
|
|
|
|
int
|
|
|
|
main(int argc, char** argv)
|
|
|
|
{
|
|
|
|
int ncid,varid;
|
2016-10-26 01:56:25 +08:00
|
|
|
int retval;
|
2016-02-02 07:15:58 +08:00
|
|
|
|
|
|
|
printf("\n*** Testing illegal mode combinations\n");
|
|
|
|
|
|
|
|
MPI_Init(&argc,&argv);
|
|
|
|
|
|
|
|
printf("*** Testing create + MPIO + fletcher32\n");
|
2018-09-23 09:22:34 +08:00
|
|
|
if ((retval = nc_create_par(FILE_NAME, NC_CLOBBER|NC_NETCDF4, MPI_COMM_WORLD, MPI_INFO_NULL, &ncid))) ERR;
|
2016-02-02 07:15:58 +08:00
|
|
|
if ((retval = nc_def_var(ncid,"whatever",NC_INT,0,NULL,&varid))) ERR;
|
|
|
|
retval = nc_def_var_fletcher32(ncid,varid,NC_FLETCHER32);
|
|
|
|
if(retval != NC_EINVAL) ERR;
|
|
|
|
if ((retval = nc_abort(ncid))) ERR;
|
|
|
|
|
|
|
|
printf("*** Testing create + MPIO + deflation\n");
|
2018-09-23 09:22:34 +08:00
|
|
|
if ((retval = nc_create_par(FILE_NAME, NC_CLOBBER|NC_NETCDF4, MPI_COMM_WORLD, MPI_INFO_NULL, &ncid))) ERR;
|
2016-02-02 07:15:58 +08:00
|
|
|
if ((retval = nc_def_var(ncid,"whatever",NC_INT,0,NULL,&varid))) ERR;
|
|
|
|
retval = nc_def_var_deflate(ncid,varid, NC_NOSHUFFLE, 1, 1);
|
|
|
|
if(retval != NC_EINVAL) ERR;
|
|
|
|
if ((retval = nc_abort(ncid))) ERR;
|
|
|
|
|
|
|
|
MPI_Finalize();
|
|
|
|
|
|
|
|
SUMMARIZE_ERR;
|
|
|
|
FINAL_RESULTS;
|
|
|
|
}
|