Handle H5T_COMPLEX (HDF5 2.0) in generate_random_datatype#69
Open
brtnfld wants to merge 1 commit into
Open
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
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 a run that happened to roll a complex type (discovered while running HDFGroup/vol-daos's CI against HDF5 `develop`).
Adds 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.
Test plan
developend-to-end from this exact repo.