[wpiutil] Upgrade to LLVM 17.0.1 (#5482)

This commit is contained in:
Tyler Veness
2023-09-21 19:54:33 -07:00
committed by GitHub
parent 07a0d22fe6
commit 1b6ec5a95d
82 changed files with 1697 additions and 901 deletions

View File

@@ -39,6 +39,7 @@ protected:
EXPECT_TRUE(testMap.begin() == testMap.end());
// Lookup tests
EXPECT_FALSE(testMap.contains(testKey));
EXPECT_EQ(0u, testMap.count(testKey));
EXPECT_EQ(0u, testMap.count(std::string_view(testKeyFirst, testKeyLength)));
EXPECT_EQ(0u, testMap.count(testKeyStr));
@@ -62,6 +63,7 @@ protected:
EXPECT_TRUE(it == testMap.end());
// Lookup tests
EXPECT_TRUE(testMap.contains(testKey));
EXPECT_EQ(1u, testMap.count(testKey));
EXPECT_EQ(1u, testMap.count(std::string_view(testKeyFirst, testKeyLength)));
EXPECT_EQ(1u, testMap.count(testKeyStr));
@@ -203,6 +205,18 @@ TEST_F(StringMapTest, CopyCtorTest) {
EXPECT_EQ(5, Map2.lookup("funf"));
}
TEST_F(StringMapTest, AtTest) {
wpi::StringMap<int> Map;
// keys both found and not found on non-empty map
Map["a"] = 1;
Map["b"] = 2;
Map["c"] = 3;
EXPECT_EQ(1, Map.at("a"));
EXPECT_EQ(2, Map.at("b"));
EXPECT_EQ(3, Map.at("c"));
}
// A more complex iteration test.
TEST_F(StringMapTest, IterationTest) {
bool visited[100];