diff options
author | Mehdi Amini <mehdi.amini@apple.com> | 2016-03-25 15:46:14 +0000 |
---|---|---|
committer | Mehdi Amini <mehdi.amini@apple.com> | 2016-03-25 15:46:14 +0000 |
commit | 9706dcf93b0ba49fca2f149e849d286e5412f765 (patch) | |
tree | 1d4ac0a70a4a297c3b7557f387d4b86e6266d0ea /llvm | |
parent | 5dd1e56de5346a7e5e85ca33f4dfe4bfd7b54795 (diff) | |
download | bcm5719-llvm-9706dcf93b0ba49fca2f149e849d286e5412f765.tar.gz bcm5719-llvm-9706dcf93b0ba49fca2f149e849d286e5412f765.zip |
Disable counting the number of move in the unittest, it seems to rely on move-construction elision
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 264412
Diffstat (limited to 'llvm')
-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); } } |