From 0c940d1053694e2e6993e0a6c0ef7830dbf3e698 Mon Sep 17 00:00:00 2001 From: Scot Breitenfeld Date: Thu, 2 Jul 2026 17:41:34 -0500 Subject: [PATCH] Handle H5T_COMPLEX in generate_random_datatype HDF5 2.0 (tracked by the develop branch) adds a new datatype class, H5T_COMPLEX (native complex-number support), bumping H5T_NCLASSES from 11 to 12. generate_random_datatype()'s rand() % H5T_NCLASSES roll had no case for the new value, falling through to the default "invalid datatype class" error path and returning an invalid datatype - breaking every subsequent test in the run that happened to roll a complex type. Add a case treating it like the other currently-unsupported classes (H5T_TIME, H5T_BITFIELD, H5T_OPAQUE, H5T_VLEN): retry with a different random class. Version-gated since H5T_COMPLEX doesn't exist as a symbol pre-2.0. --- vol_test_util.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/vol_test_util.c b/vol_test_util.c index 106d158..874a820 100644 --- a/vol_test_util.c +++ b/vol_test_util.c @@ -166,6 +166,12 @@ generate_random_datatype(H5T_class_t parent_class, hbool_t is_compact) gen_func = generate_random_datatype_array; break; +#if H5_VERSION_GE(2, 0, 0) + case H5T_COMPLEX: + /* Complex number datatypes are unsupported, try again */ + goto roll_datatype; + break; +#endif default: HDprintf(" invalid datatype class\n"); goto done;