mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-14 00:32:55 +00:00
Test coverage for non-default-constructible elements in a StringMap
This functionality was enabled by r198374. Here's a test to ensure it works and we don't regress it. Based on a patch by Maciej Piechotka. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198377 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
a11df460ac
commit
4c9b681d6d
@ -203,4 +203,19 @@ TEST_F(StringMapTest, InsertTest) {
|
||||
assertSingleItemMap();
|
||||
}
|
||||
|
||||
// Create a non-default constructable value
|
||||
TEST_F(StringMapTest, NonDefaultConstructable) {
|
||||
struct StringMapTestStruct {
|
||||
StringMapTestStruct(int i) : i(i) {}
|
||||
StringMapTestStruct() LLVM_DELETED_FUNCTION;
|
||||
int i;
|
||||
};
|
||||
|
||||
StringMap<StringMapTestStruct> t;
|
||||
t.GetOrCreateValue("Test", StringMapTestStruct(123));
|
||||
StringMap<StringMapTestStruct>::iterator iter = t.find("Test");
|
||||
ASSERT_NE(iter, t.end());
|
||||
ASSERT_EQ(iter->second.i, 123);
|
||||
}
|
||||
|
||||
} // end anonymous namespace
|
||||
|
Loading…
x
Reference in New Issue
Block a user