Commit d368b83c authored by Greg McGary's avatar Greg McGary Committed by Facebook Github Bot

relax allocated-memory tests for libcxx

Summary:
[ Extend D17527441 changes from F15MapTest into F14SetTest ]
The current version of libc++ deallocates the existing capacity when calling operator=(initializer_list), even if the map is empty. This diff relaxes the expectations of F14's allocated memory tests (which fall back to the underlying STL std::unordered_map on some platforms) to accept this implementation.

Reviewed By: yfeldblum

Differential Revision: D17726849

fbshipit-source-id: 4757792a5aefe6d085b5d164ffe7b663f6078d9a
parent 6492bb70
...@@ -104,7 +104,9 @@ void runAllocatedMemorySizeTest() { ...@@ -104,7 +104,9 @@ void runAllocatedMemorySizeTest() {
s.reserve(5); s.reserve(5);
EXPECT_GT(testAllocatedMemorySize(), 0); EXPECT_GT(testAllocatedMemorySize(), 0);
s = {}; s = {};
EXPECT_GT(testAllocatedMemorySize(), 0); if (preciseAllocInfo) {
EXPECT_GT(testAllocatedMemorySize(), 0);
}
} }
EXPECT_EQ(testAllocatedMemorySize(), 0); EXPECT_EQ(testAllocatedMemorySize(), 0);
EXPECT_EQ(testAllocatedBlockCount(), 0); EXPECT_EQ(testAllocatedBlockCount(), 0);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment