File indexing completed on 2025-07-31 02:19:15
0001 #include <catch.hpp>
0002
0003 #include "FWCore/Utilities/interface/IndexSet.h"
0004
0005 TEST_CASE("IndexSet basic operations", "[IndexSet]") {
0006 edm::IndexSet set;
0007 REQUIRE(set.empty());
0008 REQUIRE(set.size() == 0);
0009 REQUIRE(!set.has(0));
0010
0011 set.reserve(10);
0012
0013 REQUIRE(set.empty());
0014 REQUIRE(set.size() == 0);
0015 REQUIRE(!set.has(0));
0016
0017 set.insert(0);
0018 REQUIRE(!set.empty());
0019 REQUIRE(set.size() == 1);
0020 REQUIRE(set.has(0));
0021 REQUIRE(!set.has(1));
0022
0023 set.insert(2);
0024 REQUIRE(set.size() == 2);
0025 REQUIRE(set.has(0));
0026 REQUIRE(!set.has(1));
0027 REQUIRE(set.has(2));
0028 REQUIRE(!set.has(3));
0029
0030 set.insert(20);
0031 REQUIRE(set.size() == 3);
0032 REQUIRE(set.has(0));
0033 REQUIRE(!set.has(1));
0034 REQUIRE(set.has(2));
0035 REQUIRE(!set.has(3));
0036 REQUIRE(!set.has(19));
0037 REQUIRE(set.has(20));
0038 REQUIRE(!set.has(21));
0039
0040 set.insert(2);
0041 REQUIRE(set.size() == 3);
0042 REQUIRE(set.has(2));
0043
0044 set.clear();
0045 REQUIRE(set.empty());
0046 REQUIRE(set.size() == 0);
0047 REQUIRE(!set.has(0));
0048 REQUIRE(!set.has(1));
0049 REQUIRE(!set.has(2));
0050 REQUIRE(!set.has(3));
0051 }