File: tst_mode.c

package info (click to toggle)
netcdf-parallel 1%3A4.6.2-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 101,668 kB
  • sloc: ansic: 200,241; sh: 10,807; yacc: 2,522; makefile: 1,306; lex: 1,153; xml: 173; awk: 2
file content (41 lines) | stat: -rw-r--r-- 1,119 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
/**
 * @file
 * Test some illegal mode combinations
 *
 */

#include "nc_tests.h"
#include "err_macros.h"
#include "netcdf_par.h"

#define FILE_NAME "tst_mode.nc"

int
main(int argc, char** argv)
{
   int ncid,varid;
   int retval;

   printf("\n*** Testing illegal mode combinations\n");

   MPI_Init(&argc,&argv);

   printf("*** Testing create + MPIO + fletcher32\n");
   if ((retval = nc_create_par(FILE_NAME, NC_CLOBBER|NC_NETCDF4, MPI_COMM_WORLD, MPI_INFO_NULL, &ncid))) ERR;
   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");
   if ((retval = nc_create_par(FILE_NAME, NC_CLOBBER|NC_NETCDF4, MPI_COMM_WORLD, MPI_INFO_NULL, &ncid))) ERR;
   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;
}