From 2c58077f0ffe79881c4b04892c819de5342dc794 Mon Sep 17 00:00:00 2001 From: Ed Hartnett Date: Wed, 27 Mar 2019 06:59:53 -0600 Subject: [PATCH] more codacy warning fixes --- tests/cunit/test_pioc_putget.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) 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)))