Skip to content

Commit

Permalink
more codacy warning fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
edhartnett committed Mar 27, 2019
1 parent 0eff1f1 commit 2c58077
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions tests/cunit/test_pioc_putget.c
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down Expand Up @@ -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;

Expand Down Expand Up @@ -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))
Expand All @@ -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)))
Expand Down

0 comments on commit 2c58077

Please sign in to comment.