diff --git a/tests/cunit/test_async_manyproc.c b/tests/cunit/test_async_manyproc.c index 7a203a1d37d..212d125d1df 100644 --- a/tests/cunit/test_async_manyproc.c +++ b/tests/cunit/test_async_manyproc.c @@ -34,16 +34,9 @@ int main(int argc, char **argv) { int my_rank; /* Zero-based rank of processor. */ int ntasks; /* Number of processors involved in current execution. */ - int iosysid[COMPONENT_COUNT]; /* The ID for the parallel I/O system. */ int num_iotypes; /* Number of PIO netCDF iotypes in this build. */ - int iotype[NUM_IOTYPES]; /* iotypes for the supported netCDF IO iotypes. */ - int num_procs[COMPONENT_COUNT] = {NUM_COMP_PROCS, NUM_COMP_PROCS}; /* Num procs for IO and computation. */ int io_proc_list[NUM_IO_PROCS]; - int comp_proc_list1[NUM_COMP_PROCS] = {NUM_IO_PROCS, NUM_IO_PROCS + 1}; - int comp_proc_list2[NUM_COMP_PROCS] = {NUM_IO_PROCS + 2, NUM_IO_PROCS + 3}; - int *proc_list[COMPONENT_COUNT] = {comp_proc_list1, comp_proc_list2}; MPI_Comm test_comm; - int verbose = 0; int ret; /* Return code. */ /* Initialize our list of IO tasks. */ @@ -61,6 +54,13 @@ int main(int argc, char **argv) /* Only do something on TARGET_NTASKS tasks. */ if (my_rank < TARGET_NTASKS) { + int iosysid[COMPONENT_COUNT]; /* The ID for the parallel I/O system. */ + int iotype[NUM_IOTYPES]; /* iotypes for the supported netCDF IO iotypes. */ + int num_procs[COMPONENT_COUNT] = {NUM_COMP_PROCS, NUM_COMP_PROCS}; /* Num procs for IO and computation. */ + int comp_proc_list1[NUM_COMP_PROCS] = {NUM_IO_PROCS, NUM_IO_PROCS + 1}; + int comp_proc_list2[NUM_COMP_PROCS] = {NUM_IO_PROCS + 2, NUM_IO_PROCS + 3}; + int *proc_list[COMPONENT_COUNT] = {comp_proc_list1, comp_proc_list2}; + /* Figure out iotypes. */ if ((ret = get_iotypes(&num_iotypes, iotype))) ERR(ret); @@ -71,9 +71,6 @@ int main(int argc, char **argv) if ((ret = PIOc_init_async(test_comm, NUM_IO_PROCS, io_proc_list, COMPONENT_COUNT, num_procs, (int **)proc_list, NULL, NULL, PIO_REARR_BOX, iosysid))) ERR(ERR_INIT); - if (verbose) - for (int c = 0; c < COMPONENT_COUNT; c++) - printf("my_rank %d cmp %d iosysid[%d] %d\n", my_rank, c, c, iosysid[c]); /* All the netCDF calls are only executed on the computation * tasks. */ @@ -88,12 +85,12 @@ int main(int argc, char **argv) /* /\* Create sample file. *\/ */ /* if ((ret = create_nc_sample_3(iosysid[my_comp_idx], iotype[i], my_rank, my_comp_idx, */ - /* filename, TEST_NAME, verbose, 0, 0))) */ + /* filename, TEST_NAME, 0, 0, 0))) */ /* ERR(ret); */ /* /\* Check the file for correctness. *\/ */ /* if ((ret = check_nc_sample_3(iosysid[my_comp_idx], iotype[i], my_rank, my_comp_idx, */ - /* filename, verbose, 0, 0))) */ + /* filename, 0, 0, 0))) */ /* ERR(ret); */ } /* next netcdf iotype */ diff --git a/tests/cunit/test_async_multi2.c b/tests/cunit/test_async_multi2.c index bedafd611bb..cf2cd276d24 100644 --- a/tests/cunit/test_async_multi2.c +++ b/tests/cunit/test_async_multi2.c @@ -32,16 +32,8 @@ int main(int argc, char **argv) { int my_rank; /* Zero-based rank of processor. */ int ntasks; /* Number of processors involved in current execution. */ - int iosysid[COMPONENT_COUNT]; /* The ID for the parallel I/O system. */ int num_iotypes; /* Number of PIO netCDF iotypes in this build. */ - int iotype[NUM_IOTYPES]; /* iotypes for the supported netCDF IO iotypes. */ - int num_procs[COMPONENT_COUNT] = {1, 1}; /* Num procs for IO and computation. */ - int io_proc_list[NUM_IO_PROCS] = {0}; - int comp_proc_list1[NUM_COMP_PROCS] = {1}; - int comp_proc_list2[NUM_COMP_PROCS] = {2}; - int *proc_list[COMPONENT_COUNT] = {comp_proc_list1, comp_proc_list2}; MPI_Comm test_comm; - int verbose = 0; int ret; /* Return code. */ /* Initialize test. */ @@ -55,6 +47,14 @@ int main(int argc, char **argv) /* Only do something on TARGET_NTASKS tasks. */ if (my_rank < TARGET_NTASKS) { + int iosysid[COMPONENT_COUNT]; /* The ID for the parallel I/O system. */ + int iotype[NUM_IOTYPES]; /* iotypes for the supported netCDF IO iotypes. */ + int num_procs[COMPONENT_COUNT] = {1, 1}; /* Num procs for IO and computation. */ + int io_proc_list[NUM_IO_PROCS] = {0}; + int comp_proc_list1[NUM_COMP_PROCS] = {1}; + int comp_proc_list2[NUM_COMP_PROCS] = {2}; + int *proc_list[COMPONENT_COUNT] = {comp_proc_list1, comp_proc_list2}; + /* Figure out iotypes. */ if ((ret = get_iotypes(&num_iotypes, iotype))) ERR(ret); @@ -65,9 +65,6 @@ int main(int argc, char **argv) if ((ret = PIOc_init_async(test_comm, NUM_IO_PROCS, io_proc_list, COMPONENT_COUNT, num_procs, (int **)proc_list, NULL, NULL, PIO_REARR_BOX, iosysid))) ERR(ERR_INIT); - if (verbose) - for (int c = 0; c < COMPONENT_COUNT; c++) - printf("my_rank %d cmp %d iosysid[%d] %d\n", my_rank, c, c, iosysid[c]); /* All the netCDF calls are only executed on the computation * tasks. */ @@ -89,12 +86,12 @@ int main(int argc, char **argv) /* Create sample file. */ if ((ret = create_nc_sample_4(iosysid[my_comp_idx], iotype[i], my_rank, my_comp_idx, - filename, TEST_NAME, verbose, num_types))) + filename, TEST_NAME, 0, num_types))) ERR(ret); /* Check the file for correctness. */ if ((ret = check_nc_sample_4(iosysid[my_comp_idx], iotype[i], my_rank, my_comp_idx, - filename, verbose, num_types))) + filename, 0, num_types))) ERR(ret); /* Free the decompositions. */ diff --git a/tests/cunit/test_async_multicomp.c b/tests/cunit/test_async_multicomp.c index 9fecc7c839a..ed865cd74da 100644 --- a/tests/cunit/test_async_multicomp.c +++ b/tests/cunit/test_async_multicomp.c @@ -38,16 +38,8 @@ int main(int argc, char **argv) { int my_rank; /* Zero-based rank of processor. */ int ntasks; /* Number of processors involved in current execution. */ - int iosysid[COMPONENT_COUNT]; /* The ID for the parallel I/O system. */ int num_iotypes; /* Number of PIO netCDF iotypes in this build. */ - int iotype[NUM_IOTYPES]; /* iotypes for the supported netCDF IO iotypes. */ - int num_procs[COMPONENT_COUNT] = {1, 1}; /* Num procs for IO and computation. */ - int io_proc_list[NUM_IO_PROCS] = {0}; - int comp_proc_list1[NUM_COMP_PROCS] = {1}; - int comp_proc_list2[NUM_COMP_PROCS] = {2}; - int *proc_list[COMPONENT_COUNT] = {comp_proc_list1, comp_proc_list2}; MPI_Comm test_comm; - int verbose = 0; int ret; /* Return code. */ /* Initialize test. */ @@ -61,6 +53,14 @@ int main(int argc, char **argv) /* Only do something on TARGET_NTASKS tasks. */ if (my_rank < TARGET_NTASKS) { + int iosysid[COMPONENT_COUNT]; /* The ID for the parallel I/O system. */ + int iotype[NUM_IOTYPES]; /* iotypes for the supported netCDF IO iotypes. */ + int num_procs[COMPONENT_COUNT] = {1, 1}; /* Num procs for IO and computation. */ + int io_proc_list[NUM_IO_PROCS] = {0}; + int comp_proc_list1[NUM_COMP_PROCS] = {1}; + int comp_proc_list2[NUM_COMP_PROCS] = {2}; + int *proc_list[COMPONENT_COUNT] = {comp_proc_list1, comp_proc_list2}; + /* Figure out iotypes. */ if ((ret = get_iotypes(&num_iotypes, iotype))) ERR(ret); @@ -76,9 +76,6 @@ int main(int argc, char **argv) if ((ret = PIOc_init_async(test_comm, NUM_IO_PROCS, io_proc_list, COMPONENT_COUNT, num_procs, (int **)proc_list, NULL, NULL, PIO_REARR_BOX, iosysid))) ERR(ERR_INIT); - if (verbose) - for (int c = 0; c < COMPONENT_COUNT; c++) - printf("my_rank %d cmp %d iosysid[%d] %d\n", my_rank, c, c, iosysid[c]); /* All the netCDF calls are only executed on the computation * tasks. */ @@ -101,12 +98,12 @@ int main(int argc, char **argv) /* Create sample file. */ if ((ret = create_nc_sample_3(iosysid[my_comp_idx], iotype[i], my_rank, my_comp_idx, - filename, TEST_NAME, verbose, use_darray, ioid))) + filename, TEST_NAME, 0, use_darray, ioid))) ERR(ret); /* Check the file for correctness. */ if ((ret = check_nc_sample_3(iosysid[my_comp_idx], iotype[i], my_rank, my_comp_idx, - filename, verbose, 0, ioid))) + filename, 0, 0, ioid))) ERR(ret); } /* next use_darray */ diff --git a/tests/cunit/test_async_simple.c b/tests/cunit/test_async_simple.c index aa197713a30..a0659966e8b 100644 --- a/tests/cunit/test_async_simple.c +++ b/tests/cunit/test_async_simple.c @@ -34,15 +34,9 @@ int main(int argc, char **argv) #define NUM_COMP_PROCS 1 int my_rank; /* Zero-based rank of processor. */ int ntasks; /* Number of processors involved in current execution. */ - int iosysid[COMPONENT_COUNT]; /* The ID for the parallel I/O system. */ int num_flavors; /* Number of PIO netCDF flavors in this build. */ - int flavor[NUM_FLAVORS]; /* iotypes for the supported netCDF IO flavors. */ - int ret; /* Return code. */ - int num_procs[COMPONENT_COUNT] = {1}; /* Num procs for IO and computation. */ - int io_proc_list[NUM_IO_PROCS] = {0}; - int comp_proc_list[NUM_COMP_PROCS] = {1}; - int *proc_list[COMPONENT_COUNT] = {comp_proc_list}; MPI_Comm test_comm; + int ret; /* Return code. */ /* Initialize test. */ if ((ret = pio_test_init2(argc, argv, &my_rank, &ntasks, TARGET_NTASKS, TARGET_NTASKS, @@ -52,6 +46,13 @@ int main(int argc, char **argv) /* Only do something on TARGET_NTASKS tasks. */ if (my_rank < TARGET_NTASKS) { + int iosysid[COMPONENT_COUNT]; /* The ID for the parallel I/O system. */ + int flavor[NUM_FLAVORS]; /* iotypes for the supported netCDF IO flavors. */ + int num_procs[COMPONENT_COUNT] = {1}; /* Num procs for IO and computation. */ + int io_proc_list[NUM_IO_PROCS] = {0}; + int comp_proc_list[NUM_COMP_PROCS] = {1}; + int *proc_list[COMPONENT_COUNT] = {comp_proc_list}; + /* Figure out iotypes. */ if ((ret = get_iotypes(&num_flavors, flavor))) ERR(ret); diff --git a/tests/cunit/test_darray_fill.c b/tests/cunit/test_darray_fill.c index 2e6c43e9829..7065e37b021 100644 --- a/tests/cunit/test_darray_fill.c +++ b/tests/cunit/test_darray_fill.c @@ -137,7 +137,7 @@ int main(int argc, char **argv) * numbers, like in Fortran! */ for (int i = 0; i < MAPLEN; i++) { - wcompmap[i] = i % 2 ? my_rank * MAPLEN + i + 1 : 0; /* Even values missing. */ + wcompmap[i] = (i % 2) ? my_rank * MAPLEN + i + 1 : 0; /* Even values missing. */ rcompmap[i] = my_rank * MAPLEN + i + 1; } @@ -173,18 +173,18 @@ int main(int argc, char **argv) * values. */ for (int i = 0; i < MAPLEN; i++) { - byte_data[i] = i % 2 ? my_rank * MAPLEN + i + 1 : TEST_VAL_42; - char_data[i] = i % 2 ? my_rank * MAPLEN + i + 1 : TEST_VAL_42; - short_data[i] = i % 2 ? my_rank * MAPLEN + i + 1 : TEST_VAL_42; - int_data[i] = i % 2 ? my_rank * MAPLEN + i + 1 : TEST_VAL_42; - float_data[i] = i % 2 ? my_rank * MAPLEN + i + 1 : TEST_VAL_42; - double_data[i] = i % 2 ? my_rank * MAPLEN + i + 1 : TEST_VAL_42; + byte_data[i] = (i % 2) ? my_rank * MAPLEN + i + 1 : TEST_VAL_42; + char_data[i] = (i % 2) ? my_rank * MAPLEN + i + 1 : TEST_VAL_42; + short_data[i] = (i % 2) ? my_rank * MAPLEN + i + 1 : TEST_VAL_42; + int_data[i] = (i % 2) ? my_rank * MAPLEN + i + 1 : TEST_VAL_42; + float_data[i] = (i % 2) ? my_rank * MAPLEN + i + 1 : TEST_VAL_42; + double_data[i] = (i % 2) ? my_rank * MAPLEN + i + 1 : TEST_VAL_42; #ifdef _NETCDF4 - ubyte_data[i] = i % 2 ? my_rank * MAPLEN + i + 1 : TEST_VAL_42; - ushort_data[i] = i % 2 ? my_rank * MAPLEN + i + 1 : TEST_VAL_42; - uint_data[i] = i % 2 ? my_rank * MAPLEN + i + 1 : TEST_VAL_42; - int64_data[i] = i % 2 ? my_rank * MAPLEN + i + 1 : TEST_VAL_42; - uint64_data[i] = i % 2 ? my_rank * MAPLEN + i + 1 : TEST_VAL_42; + ubyte_data[i] = (i % 2) ? my_rank * MAPLEN + i + 1 : TEST_VAL_42; + ushort_data[i] = (i % 2) ? my_rank * MAPLEN + i + 1 : TEST_VAL_42; + uint_data[i] = (i % 2) ? my_rank * MAPLEN + i + 1 : TEST_VAL_42; + int64_data[i] = (i % 2) ? my_rank * MAPLEN + i + 1 : TEST_VAL_42; + uint64_data[i] = (i % 2) ? my_rank * MAPLEN + i + 1 : TEST_VAL_42; #endif /* _NETCDF4 */ } @@ -193,18 +193,18 @@ int main(int argc, char **argv) * it may be custom or default fill value. */ for (int i = 0; i < MAPLEN; i++) { - byte_expected[i] = i % 2 ? my_rank * MAPLEN + i + 1 : (fv ? byte_default_fill : byte_fill); - char_expected[i] = i % 2 ? my_rank * MAPLEN + i + 1 : (fv ? char_default_fill : char_fill); - short_expected[i] = i % 2 ? my_rank * MAPLEN + i + 1 : (fv ? short_default_fill : short_fill); - int_expected[i] = i % 2 ? my_rank * MAPLEN + i + 1 : (fv ? int_default_fill : int_fill); - float_expected[i] = i % 2 ? my_rank * MAPLEN + i + 1 : (fv ? float_default_fill : float_fill); - double_expected[i] = i % 2 ? my_rank * MAPLEN + i + 1 : (fv ? double_default_fill : double_fill); + byte_expected[i] = (i % 2) ? my_rank * MAPLEN + i + 1 : (fv ? byte_default_fill : byte_fill); + char_expected[i] = (i % 2) ? my_rank * MAPLEN + i + 1 : (fv ? char_default_fill : char_fill); + short_expected[i] = (i % 2) ? my_rank * MAPLEN + i + 1 : (fv ? short_default_fill : short_fill); + int_expected[i] = (i % 2) ? my_rank * MAPLEN + i + 1 : (fv ? int_default_fill : int_fill); + float_expected[i] = (i % 2) ? my_rank * MAPLEN + i + 1 : (fv ? float_default_fill : float_fill); + double_expected[i] = (i % 2) ? my_rank * MAPLEN + i + 1 : (fv ? double_default_fill : double_fill); #ifdef _NETCDF4 - ubyte_expected[i] = i % 2 ? my_rank * MAPLEN + i + 1 : (fv ? ubyte_default_fill : ubyte_fill); - ushort_expected[i] = i % 2 ? my_rank * MAPLEN + i + 1 : (fv ? ushort_default_fill : ushort_fill); - uint_expected[i] = i % 2 ? my_rank * MAPLEN + i + 1 : (fv ? uint_default_fill : uint_fill); - int64_expected[i] = i % 2 ? my_rank * MAPLEN + i + 1 : (fv ? int64_default_fill : int64_fill); - uint64_expected[i] = i % 2 ? my_rank * MAPLEN + i + 1 : (fv ? uint64_default_fill : uint64_fill); + ubyte_expected[i] = (i % 2) ? my_rank * MAPLEN + i + 1 : (fv ? ubyte_default_fill : ubyte_fill); + ushort_expected[i] = (i % 2) ? my_rank * MAPLEN + i + 1 : (fv ? ushort_default_fill : ushort_fill); + uint_expected[i] = (i % 2) ? my_rank * MAPLEN + i + 1 : (fv ? uint_default_fill : uint_fill); + int64_expected[i] = (i % 2) ? my_rank * MAPLEN + i + 1 : (fv ? int64_default_fill : int64_fill); + uint64_expected[i] = (i % 2) ? my_rank * MAPLEN + i + 1 : (fv ? uint64_default_fill : uint64_fill); #endif /* _NETCDF4 */ } diff --git a/tests/cunit/test_decomp_frame.c b/tests/cunit/test_decomp_frame.c index 6a635dbdb3a..0f359d791f6 100644 --- a/tests/cunit/test_decomp_frame.c +++ b/tests/cunit/test_decomp_frame.c @@ -138,7 +138,7 @@ int main(int argc, char **argv) * numbers, like in Fortran! */ for (int i = 0; i < MAPLEN; i++) { - wcompmap[i] = i % 2 ? my_rank * MAPLEN + i + 1 : 0; /* Even values missing. */ + wcompmap[i] = (i % 2) ? my_rank * MAPLEN + i + 1 : 0; /* Even values missing. */ rcompmap[i] = my_rank * MAPLEN + i + 1; } @@ -174,18 +174,18 @@ int main(int argc, char **argv) * values. */ for (int i = 0; i < MAPLEN; i++) { - byte_data[i] = i % 2 ? my_rank * MAPLEN + i + 1 : TEST_VAL_42; - char_data[i] = i % 2 ? my_rank * MAPLEN + i + 1 : TEST_VAL_42; - short_data[i] = i % 2 ? my_rank * MAPLEN + i + 1 : TEST_VAL_42; - int_data[i] = i % 2 ? my_rank * MAPLEN + i + 1 : TEST_VAL_42; - float_data[i] = i % 2 ? my_rank * MAPLEN + i + 1 : TEST_VAL_42; - double_data[i] = i % 2 ? my_rank * MAPLEN + i + 1 : TEST_VAL_42; + byte_data[i] = (i % 2) ? my_rank * MAPLEN + i + 1 : TEST_VAL_42; + char_data[i] = (i % 2) ? my_rank * MAPLEN + i + 1 : TEST_VAL_42; + short_data[i] = (i % 2) ? my_rank * MAPLEN + i + 1 : TEST_VAL_42; + int_data[i] = (i % 2) ? my_rank * MAPLEN + i + 1 : TEST_VAL_42; + float_data[i] = (i % 2) ? my_rank * MAPLEN + i + 1 : TEST_VAL_42; + double_data[i] = (i % 2) ? my_rank * MAPLEN + i + 1 : TEST_VAL_42; #ifdef _NETCDF4 - ubyte_data[i] = i % 2 ? my_rank * MAPLEN + i + 1 : TEST_VAL_42; - ushort_data[i] = i % 2 ? my_rank * MAPLEN + i + 1 : TEST_VAL_42; - uint_data[i] = i % 2 ? my_rank * MAPLEN + i + 1 : TEST_VAL_42; - int64_data[i] = i % 2 ? my_rank * MAPLEN + i + 1 : TEST_VAL_42; - uint64_data[i] = i % 2 ? my_rank * MAPLEN + i + 1 : TEST_VAL_42; + ubyte_data[i] = (i % 2) ? my_rank * MAPLEN + i + 1 : TEST_VAL_42; + ushort_data[i] = (i % 2) ? my_rank * MAPLEN + i + 1 : TEST_VAL_42; + uint_data[i] = (i % 2) ? my_rank * MAPLEN + i + 1 : TEST_VAL_42; + int64_data[i] = (i % 2) ? my_rank * MAPLEN + i + 1 : TEST_VAL_42; + uint64_data[i] = (i % 2) ? my_rank * MAPLEN + i + 1 : TEST_VAL_42; #endif /* _NETCDF4 */ } @@ -194,18 +194,18 @@ int main(int argc, char **argv) * it may be custom or default fill value. */ for (int i = 0; i < MAPLEN; i++) { - byte_expected[i] = i % 2 ? my_rank * MAPLEN + i + 1 : (fv ? byte_default_fill : byte_fill); - char_expected[i] = i % 2 ? my_rank * MAPLEN + i + 1 : (fv ? char_default_fill : char_fill); - short_expected[i] = i % 2 ? my_rank * MAPLEN + i + 1 : (fv ? short_default_fill : short_fill); - int_expected[i] = i % 2 ? my_rank * MAPLEN + i + 1 : (fv ? int_default_fill : int_fill); - float_expected[i] = i % 2 ? my_rank * MAPLEN + i + 1 : (fv ? float_default_fill : float_fill); - double_expected[i] = i % 2 ? my_rank * MAPLEN + i + 1 : (fv ? double_default_fill : double_fill); + byte_expected[i] = (i % 2) ? my_rank * MAPLEN + i + 1 : (fv ? byte_default_fill : byte_fill); + char_expected[i] = (i % 2) ? my_rank * MAPLEN + i + 1 : (fv ? char_default_fill : char_fill); + short_expected[i] = (i % 2) ? my_rank * MAPLEN + i + 1 : (fv ? short_default_fill : short_fill); + int_expected[i] = (i % 2) ? my_rank * MAPLEN + i + 1 : (fv ? int_default_fill : int_fill); + float_expected[i] = (i % 2) ? my_rank * MAPLEN + i + 1 : (fv ? float_default_fill : float_fill); + double_expected[i] = (i % 2) ? my_rank * MAPLEN + i + 1 : (fv ? double_default_fill : double_fill); #ifdef _NETCDF4 - ubyte_expected[i] = i % 2 ? my_rank * MAPLEN + i + 1 : (fv ? ubyte_default_fill : ubyte_fill); - ushort_expected[i] = i % 2 ? my_rank * MAPLEN + i + 1 : (fv ? ushort_default_fill : ushort_fill); - uint_expected[i] = i % 2 ? my_rank * MAPLEN + i + 1 : (fv ? uint_default_fill : uint_fill); - int64_expected[i] = i % 2 ? my_rank * MAPLEN + i + 1 : (fv ? int64_default_fill : int64_fill); - uint64_expected[i] = i % 2 ? my_rank * MAPLEN + i + 1 : (fv ? uint64_default_fill : uint64_fill); + ubyte_expected[i] = (i % 2) ? my_rank * MAPLEN + i + 1 : (fv ? ubyte_default_fill : ubyte_fill); + ushort_expected[i] = (i % 2) ? my_rank * MAPLEN + i + 1 : (fv ? ushort_default_fill : ushort_fill); + uint_expected[i] = (i % 2) ? my_rank * MAPLEN + i + 1 : (fv ? uint_default_fill : uint_fill); + int64_expected[i] = (i % 2) ? my_rank * MAPLEN + i + 1 : (fv ? int64_default_fill : int64_fill); + uint64_expected[i] = (i % 2) ? my_rank * MAPLEN + i + 1 : (fv ? uint64_default_fill : uint64_fill); #endif /* _NETCDF4 */ } diff --git a/tests/cunit/test_pioc_putget.c b/tests/cunit/test_pioc_putget.c index 15452eb99c4..fea2af1fea1 100644 --- a/tests/cunit/test_pioc_putget.c +++ b/tests/cunit/test_pioc_putget.c @@ -153,15 +153,10 @@ int test_att_conv_byte(int ncid, int flavor, char *name, int *expected, long lon { signed char byte_array_in[ATT_LEN]; short short_array_in[ATT_LEN]; - unsigned char ubyte_array_in[ATT_LEN]; int int_array_in[ATT_LEN]; long long_array_in[ATT_LEN]; float float_array_in[ATT_LEN]; double double_array_in[ATT_LEN]; - unsigned short ushort_array_in[ATT_LEN]; - unsigned int uint_array_in[ATT_LEN]; - long long int64_array_in[ATT_LEN]; - unsigned long long uint64_array_in[ATT_LEN]; /* Read the att and check results. */ if (expected[PIO_BYTE] != PIOc_get_att_schar(ncid, NC_GLOBAL, name, byte_array_in)) @@ -214,6 +209,12 @@ int test_att_conv_byte(int ncid, int flavor, char *name, int *expected, long lon if (flavor == PIO_IOTYPE_NETCDF4C || flavor == PIO_IOTYPE_NETCDF4P) { + unsigned char ubyte_array_in[ATT_LEN]; + unsigned short ushort_array_in[ATT_LEN]; + unsigned int uint_array_in[ATT_LEN]; + long long int64_array_in[ATT_LEN]; + unsigned long long uint64_array_in[ATT_LEN]; + if ((expected[PIO_UBYTE] != PIOc_get_att_uchar(ncid, NC_GLOBAL, name, ubyte_array_in))) return ERR_WRONG; @@ -271,10 +272,6 @@ int test_att_conv_int64(int ncid, int flavor, char *name, int *expected, long lo { float float_array_in[ATT_LEN]; double double_array_in[ATT_LEN]; - unsigned char ubyte_array_in[ATT_LEN]; - unsigned short ushort_array_in[ATT_LEN]; - unsigned int uint_array_in[ATT_LEN]; - long long int64_array_in[ATT_LEN]; /* Read the att and check results. */ if (expected[PIO_FLOAT] != PIOc_get_att_float(ncid, NC_GLOBAL, name, float_array_in)) @@ -285,6 +282,11 @@ int test_att_conv_int64(int ncid, int flavor, char *name, int *expected, long lo if (flavor == PIO_IOTYPE_NETCDF4C || flavor == PIO_IOTYPE_NETCDF4P) { + unsigned char ubyte_array_in[ATT_LEN]; + unsigned short ushort_array_in[ATT_LEN]; + unsigned int uint_array_in[ATT_LEN]; + long long int64_array_in[ATT_LEN]; + if ((expected[PIO_UBYTE] != PIOc_get_att_uchar(ncid, NC_GLOBAL, name, ubyte_array_in))) return ERR_WRONG; if ((expected[PIO_USHORT] != PIOc_get_att_ushort(ncid, NC_GLOBAL, name, ushort_array_in)))