llvm.org GIT mirror llvm / df98afd
Ensure that the StringMap does not grow during the test for pre-allocation/reserve From: Mehdi Amini <mehdi.amini@apple.com> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@264416 91177308-0d34-0410-b5e6-96231b3b80d8 Mehdi Amini 3 years ago
1 changed file(s) with 3 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
389389 // arbitrary prime, picked without any good reason.
390390 for (auto Size : {1, 32, 67}) {
391391 StringMap Map(Size);
392 auto NumBuckets = Map.getNumBuckets();
392393 CountCtorCopyAndMove::Move = 0;
393394 CountCtorCopyAndMove::Copy = 0;
394395 for (int i = 0; i < Size; ++i)
397398 // EXPECT_EQ((unsigned)Size * 3, CountCtorCopyAndMove::Move);
398399 // No copy is expected.
399400 EXPECT_EQ(0u, CountCtorCopyAndMove::Copy);
401 // Check that the map didn't grow
402 EXPECT_EQ(Map.getNumBuckets(), NumBuckets);
400403 }
401404 }
402405