[wpiutil] Reduce llvm collections patches (#4268)

This commit is contained in:
PJ Reiniger
2022-05-27 16:41:28 -04:00
committed by GitHub
parent db2e1d170e
commit 3e94805220
43 changed files with 429 additions and 813 deletions

View File

@@ -223,12 +223,13 @@ TEST_F(StringMapTest, IterationTest) {
// Test StringMapEntry::Create() method.
TEST_F(StringMapTest, StringMapEntryTest) {
MallocAllocator Allocator;
StringMap<uint32_t>::value_type *entry =
StringMap<uint32_t>::value_type::Create(
std::string_view(testKeyFirst, testKeyLength), 1u);
std::string_view(testKeyFirst, testKeyLength), Allocator, 1u);
EXPECT_STREQ(testKey, entry->first().data());
EXPECT_EQ(1u, entry->second);
entry->Destroy();
entry->Destroy(Allocator);
}
// Test insert() method.
@@ -237,7 +238,7 @@ TEST_F(StringMapTest, InsertTest) {
testMap.insert(
StringMap<uint32_t>::value_type::Create(
std::string_view(testKeyFirst, testKeyLength),
1u));
testMap.getAllocator(), 1u));
assertSingleItemMap();
}
@@ -352,14 +353,15 @@ TEST_F(StringMapTest, MoveOnly) {
StringMap<MoveOnly> t;
t.insert(std::make_pair("Test", MoveOnly(42)));
std::string_view Key = "Test";
StringMapEntry<MoveOnly>::Create(Key, MoveOnly(42))
->Destroy();
StringMapEntry<MoveOnly>::Create(Key, t.getAllocator(), MoveOnly(42))
->Destroy(t.getAllocator());
}
TEST_F(StringMapTest, CtorArg) {
std::string_view Key = "Test";
StringMapEntry<MoveOnly>::Create(Key, Immovable())
->Destroy();
MallocAllocator Allocator;
StringMapEntry<MoveOnly>::Create(Key, Allocator, Immovable())
->Destroy(Allocator);
}
TEST_F(StringMapTest, MoveConstruct) {