diff --git a/tests/cunit/test_async_3proc.c b/tests/cunit/test_async_3proc.c index 8eff69fdf2..ea89084c5c 100644 --- a/tests/cunit/test_async_3proc.c +++ b/tests/cunit/test_async_3proc.c @@ -71,7 +71,7 @@ int main(int argc, char **argv) { for (int flv = 0; flv < num_flavors; flv++) { - char filename[PIO_MAX_NAME + 1]; /* Test filename. */ + char filename[PIO_MAX_NAME * 2 + 1]; /* Test filename. */ int my_comp_idx = 0; /* Index in iosysid array. */ for (int sample = 0; sample < NUM_SAMPLES; sample++) diff --git a/tests/cunit/test_async_4proc.c b/tests/cunit/test_async_4proc.c index 833110388f..20395a74f5 100644 --- a/tests/cunit/test_async_4proc.c +++ b/tests/cunit/test_async_4proc.c @@ -69,7 +69,7 @@ int main(int argc, char **argv) { for (int flv = 0; flv < num_flavors; flv++) { - char filename[PIO_MAX_NAME + 1]; /* Test filename. */ + char filename[PIO_MAX_NAME * 2 + 1]; /* Test filename. */ int my_comp_idx = 0; /* Index in iosysid array. */ for (int sample = 0; sample < NUM_SAMPLES; sample++) diff --git a/tests/cunit/test_async_simple.c b/tests/cunit/test_async_simple.c index d8520efbd3..1ae6c6b0c0 100644 --- a/tests/cunit/test_async_simple.c +++ b/tests/cunit/test_async_simple.c @@ -90,7 +90,7 @@ int main(int argc, char **argv) for (int sample = 0; sample < NUM_SAMPLES; sample++) { - char filename[PIO_MAX_NAME + 1]; /* Test filename. */ + char filename[PIO_MAX_NAME * 2 + 1]; /* Test filename. */ char iotype_name[PIO_MAX_NAME + 1]; /* Create a filename. */ diff --git a/tests/cunit/test_pioc.c b/tests/cunit/test_pioc.c index 9bdb056035..c85e341e4a 100644 --- a/tests/cunit/test_pioc.c +++ b/tests/cunit/test_pioc.c @@ -838,7 +838,7 @@ int test_names(int iosysid, int num_flavors, int *flavor, int my_rank, { int ncid; int varid; - char filename[PIO_MAX_NAME + 1]; /* Test filename. */ + char filename[PIO_MAX_NAME * 2 + 1]; /* Test filename. */ char iotype_name[PIO_MAX_NAME + 1]; int dimids[NDIM]; /* The dimension IDs. */ int att_val = ATT_VAL; @@ -942,7 +942,7 @@ int test_files(int iosysid, int num_flavors, int *flavor, int my_rank) * available ways. */ for (int fmt = 0; fmt < num_flavors; fmt++) { - char filename[PIO_MAX_NAME + 1]; /* Test filename. */ + char filename[PIO_MAX_NAME * 2 + 1]; /* Test filename. */ char iotype_name[PIO_MAX_NAME + 1]; /* Overwrite existing test file. */ @@ -1041,7 +1041,7 @@ int test_empty_files(int iosysid, int num_flavors, int *flavor, int my_rank) * available ways. */ for (int fmt = 0; fmt < num_flavors; fmt++) { - char filename[PIO_MAX_NAME + 1]; /* Test filename. */ + char filename[PIO_MAX_NAME * 2 + 1]; /* Test filename. */ char iotype_name[PIO_MAX_NAME + 1]; /* Create a filename. */ @@ -1218,7 +1218,7 @@ int test_find_var_fillvalue(int iosysid, int num_flavors, int *flavor, * available ways. */ for (int fmt = 0; fmt < num_flavors; fmt++) { - char filename[PIO_MAX_NAME + 1]; /* Test filename. */ + char filename[PIO_MAX_NAME * 2 + 1]; /* Test filename. */ char iotype_name[PIO_MAX_NAME + 1]; int num_types = NUM_CLASSIC_TYPES; @@ -1370,7 +1370,7 @@ int test_deletefile(int iosysid, int num_flavors, int *flavor, int my_rank) * available ways. */ for (int fmt = 0; fmt < num_flavors; fmt++) { - char filename[PIO_MAX_NAME + 1]; /* Test filename. */ + char filename[PIO_MAX_NAME * 2 + 1]; /* Test filename. */ char iotype_name[PIO_MAX_NAME + 1]; int old_method; @@ -1456,7 +1456,7 @@ int test_nc4(int iosysid, int num_flavors, int *flavor, int my_rank) * available ways. */ for (int fmt = 0; fmt < num_flavors; fmt++) { - char filename[PIO_MAX_NAME + 1]; /* Test filename. */ + char filename[PIO_MAX_NAME * 2 + 1]; /* Test filename. */ char iotype_name[PIO_MAX_NAME + 1]; /* Create a filename. */ @@ -1793,7 +1793,7 @@ int test_scalar(int iosysid, int num_flavors, int *flavor, int my_rank, int asyn * available ways. */ for (int fmt = 0; fmt < num_flavors; fmt++) { - char filename[PIO_MAX_NAME + 1]; /* Test filename. */ + char filename[PIO_MAX_NAME * 2 + 1]; /* Test filename. */ char iotype_name[PIO_MAX_NAME + 1]; /* Create a filename. */ diff --git a/tests/cunit/test_pioc_fill.c b/tests/cunit/test_pioc_fill.c index 8296314209..8b502fed12 100644 --- a/tests/cunit/test_pioc_fill.c +++ b/tests/cunit/test_pioc_fill.c @@ -538,7 +538,7 @@ int test_fill(int iosysid, int num_flavors, int *flavor, int my_rank, * available ways. */ for (int fmt = 0; fmt < num_flavors; fmt++) { - char filename[PIO_MAX_NAME + 1]; /* Test filename. */ + char filename[PIO_MAX_NAME * 2 + 1]; /* Test filename. */ char iotype_name[PIO_MAX_NAME + 1]; int ncid; int varid[NUM_NETCDF_TYPES]; @@ -547,7 +547,8 @@ int test_fill(int iosysid, int num_flavors, int *flavor, int my_rank, /* Create a filename. */ if ((ret = get_iotype_name(flavor[fmt], iotype_name))) ERR(ret); - snprintf(filename, PIO_MAX_NAME, "%s_default_fill_%d_%s.nc", TEST_NAME, default_fill, iotype_name); + snprintf(filename, PIO_MAX_NAME * 2, "%s_default_fill_%d_%s.nc", TEST_NAME, + default_fill, iotype_name); /* Create test file with dims and vars defined. */ if ((ret = create_putget_file(iosysid, flavor[fmt], dim_len, varid, filename, @@ -635,7 +636,7 @@ int test_fill_mode(int iosysid, int num_flavors, int *flavor, int my_rank, { for (int t = 0; t < NUM_TYPES_TO_TEST; t++) { - char filename[PIO_MAX_NAME + 1]; /* Test filename. */ + char filename[PIO_MAX_NAME * 2 + 1]; /* Test filename. */ char iotype_name[PIO_MAX_NAME + 1]; int ncid; int dimid; @@ -653,7 +654,7 @@ int test_fill_mode(int iosysid, int num_flavors, int *flavor, int my_rank, /* Create a filename. */ if ((ret = get_iotype_name(flavor[fmt], iotype_name))) ERR(ret); - snprintf(filename, PIO_MAX_NAME, "%s_fill_mode_async_%d_default_fill_%d_extra_var_%d_%s.nc", + snprintf(filename, PIO_MAX_NAME * 2, "%s_fill_mode_async_%d_default_fill_%d_extra_var_%d_%s.nc", TEST_NAME, async, default_fill, extra_var, iotype_name); /* Create the test file. */ diff --git a/tests/cunit/test_pioc_putget.c b/tests/cunit/test_pioc_putget.c index 78e55f2e9d..ce2732718f 100644 --- a/tests/cunit/test_pioc_putget.c +++ b/tests/cunit/test_pioc_putget.c @@ -321,7 +321,7 @@ int test_atts_byte(int iosysid, int num_flavors, int *flavor, int my_rank, for (int fmt = 0; fmt < num_flavors; fmt++) { char iotype_name[PIO_MAX_NAME + 1]; - char filename[PIO_MAX_NAME + 1]; /* Test filename. */ + char filename[PIO_MAX_NAME * 2 + 1]; /* Test filename. */ int ncid; int ret; /* Return code. */ @@ -433,7 +433,7 @@ int test_atts_int64(int iosysid, int num_flavors, int *flavor, int my_rank, for (int fmt = 0; fmt < num_flavors; fmt++) { char iotype_name[PIO_MAX_NAME + 1]; - char filename[PIO_MAX_NAME + 1]; /* Test filename. */ + char filename[PIO_MAX_NAME * 2 + 1]; /* Test filename. */ int ncid; int ret; /* Return code. */ @@ -1917,7 +1917,7 @@ int test_putget(int iosysid, int num_flavors, int *flavor, int my_rank, * available ways. */ for (int fmt = 0; fmt < num_flavors; fmt++) { - char filename[PIO_MAX_NAME + 1]; /* Test filename. */ + char filename[PIO_MAX_NAME * 2 + 1]; /* Test filename. */ char iotype_name[PIO_MAX_NAME + 1]; int ncid; int varid[NUM_NETCDF4_TYPES + 1]; @@ -1926,7 +1926,7 @@ int test_putget(int iosysid, int num_flavors, int *flavor, int my_rank, /* Create a filename. */ if ((ret = get_iotype_name(flavor[fmt], iotype_name))) return ret; - snprintf(filename, PIO_MAX_NAME, "%s_putget_access_%d_unlim_%d_%s.nc", TEST_NAME, + snprintf(filename, PIO_MAX_NAME * 2, "%s_putget_access_%d_unlim_%d_%s.nc", TEST_NAME, access, unlim, iotype_name); /* Create test file with dims and vars defined. */