diff options
-rw-r--r-- | llvm/unittests/ADT/DenseMapTest.cpp | 9 | ||||
-rw-r--r-- | llvm/unittests/ADT/StringMapTest.cpp | 4 |
2 files changed, 9 insertions, 4 deletions
diff --git a/llvm/unittests/ADT/DenseMapTest.cpp b/llvm/unittests/ADT/DenseMapTest.cpp index 52753daf718..d940677b92e 100644 --- a/llvm/unittests/ADT/DenseMapTest.cpp +++ b/llvm/unittests/ADT/DenseMapTest.cpp @@ -392,7 +392,8 @@ TEST(DenseMapCustomTest, DefaultMinReservedSizeTest) { // Check that we grew EXPECT_NE(MemorySize, Map.getMemorySize()); // Check that move was called the expected number of times - EXPECT_EQ(ExpectedMaxInitialEntries + 2, CountCopyAndMove::Move); + // This relies on move-construction elision, and cannot be reliably tested. + // EXPECT_EQ(ExpectedMaxInitialEntries + 2, CountCopyAndMove::Move); // Check that no copy occured EXPECT_EQ(0, CountCopyAndMove::Copy); } @@ -415,7 +416,8 @@ TEST(DenseMapCustomTest, InitialSizeTest) { // Check that we didn't grow EXPECT_EQ(MemorySize, Map.getMemorySize()); // Check that move was called the expected number of times - EXPECT_EQ(Size * 2, CountCopyAndMove::Move); + // This relies on move-construction elision, and cannot be reliably tested. + // EXPECT_EQ(Size * 2, CountCopyAndMove::Move); // Check that no copy occured EXPECT_EQ(0, CountCopyAndMove::Copy); } @@ -457,7 +459,8 @@ TEST(DenseMapCustomTest, ReserveTest) { // Check that we didn't grow EXPECT_EQ(MemorySize, Map.getMemorySize()); // Check that move was called the expected number of times - EXPECT_EQ(Size * 2, CountCopyAndMove::Move); + // This relies on move-construction elision, and cannot be reliably tested. + // EXPECT_EQ(Size * 2, CountCopyAndMove::Move); // Check that no copy occured EXPECT_EQ(0, CountCopyAndMove::Copy); } diff --git a/llvm/unittests/ADT/StringMapTest.cpp b/llvm/unittests/ADT/StringMapTest.cpp index c986a9c09a9..3d733aa0461 100644 --- a/llvm/unittests/ADT/StringMapTest.cpp +++ b/llvm/unittests/ADT/StringMapTest.cpp @@ -394,7 +394,9 @@ TEST(StringMapCustomTest, InitialSizeTest) { CountCtorCopyAndMove::Copy = 0; for (int i = 0; i < Size; ++i) Map.insert(std::make_pair(Twine(i).str(), CountCtorCopyAndMove())); - EXPECT_EQ((unsigned)Size * 3, CountCtorCopyAndMove::Move); + // This relies on move-construction elision, and cannot be reliably tested. + // EXPECT_EQ((unsigned)Size * 3, CountCtorCopyAndMove::Move); + // No copy is expected. EXPECT_EQ(0u, CountCtorCopyAndMove::Copy); } } |