From 2c3aa550a34729f2daa80fcad9a1781a42e74f39 Mon Sep 17 00:00:00 2001 From: Ed Hartnett Date: Fri, 4 May 2018 07:16:58 -0600 Subject: [PATCH] test development --- tests/cunit/test_darray_fill.c | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/tests/cunit/test_darray_fill.c b/tests/cunit/test_darray_fill.c index a8c7427c0d9..2c3bf62fc19 100644 --- a/tests/cunit/test_darray_fill.c +++ b/tests/cunit/test_darray_fill.c @@ -141,7 +141,6 @@ int main(int argc, char **argv) { wcompmap[i] = i % 2 ? my_rank * MAPLEN + i + 1 : 0; /* Even values missing. */ rcompmap[i] = my_rank * MAPLEN + i + 1; - int_data[i] = wcompmap[i]; } /* Figure out iotypes. */ @@ -163,9 +162,30 @@ int main(int argc, char **argv) #define NUM_TYPES 1 int test_type[NUM_TYPES] = {PIO_INT}; + /* Determine what data to write. Put value of 42 into + * array elements that will not get written. Due to + * the decomposition, these will be replaced by fill + * 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; +#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; +#endif /* _NETCDF4 */ + } + /* Determine what data to expect from the test. For - * even i, the fill value will be used, and it may be - * custom or default fill value. */ + * even values of i, the fill value will be used, and + * 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);