diff --git a/tests/selected_colls_roundtrip.h b/tests/selected_colls_roundtrip.h index 210349997..8a71e74c3 100644 --- a/tests/selected_colls_roundtrip.h +++ b/tests/selected_colls_roundtrip.h @@ -1,3 +1,5 @@ +#include "read_test.h" + #include #include @@ -24,10 +26,13 @@ /// be called by backend specific tests /// The collection names that will be written into the new file -const std::vector collectionSelection = {"mcparticles", "links", "userInts", "hits"}; +const std::vector collectionSelection = {"mcparticles", "links", "userInts", "hits", "clusters"}; /// The collections to select in the second round -const std::vector roundTripSelection = {"hits", "userInts"}; +const std::vector roundTripSelection = {"hits", "userInts", "mcparticles"}; + +/// Collections that were available originally and shouldn't be any longer +const std::vector droppedCollections = {"moreMCs", "userDoubles", "info", "refs", "hitRefs"}; /// Write a new file containing only a few selected collections and only one /// event @@ -71,6 +76,21 @@ int readSelectedFileFull(const std::string& filename) { return 1; } + for (const auto& name : droppedCollections) { + if (event.get(name)) { + std::cerr << "The frame contained a dropped collection: " << name << std::endl; + return 1; + } + } + + checkMCParticleCollection(event, reader.currentFileVersion()); + checkHitCollection(event, 0); + const auto& hits = event.get("hits"); + checkClusterCollection(event, hits); + const auto& clusters = event.get("clusters"); + checkIntUserDataCollection(event, 0); + checkLinkCollection(event, hits, clusters); + return 0; } @@ -90,6 +110,10 @@ int readSelectedFilePartial(const std::string& filename) { return 1; } + checkMCParticleCollection(event, reader.currentFileVersion()); + checkHitCollection(event, 0); + checkIntUserDataCollection(event, 0); + return 0; }