[PATCH] D22165: [libcxx] [test] Make bucket_count() greater-equal assertions portable.
Stephan T. Lavavej via cfe-commits
cfe-commits at lists.llvm.org
Fri Jul 8 12:31:19 PDT 2016
STL_MSFT created this revision.
STL_MSFT added reviewers: EricWF, mclow.lists.
STL_MSFT added a subscriber: cfe-commits.
Make bucket_count() greater-equal assertions portable.
The Standard provides a guarantee here, but these assertions were going beyond that guarantee. These containers have 8 elements, so the bucket count is guaranteed to be at least 8, but may not be as large as 11 (and isn't in MSVC's implementation).
http://reviews.llvm.org/D22165
Files:
test/std/containers/unord/unord.map/bucket_count.pass.cpp
test/std/containers/unord/unord.multimap/bucket_count.pass.cpp
test/std/containers/unord/unord.multiset/bucket_count.pass.cpp
test/std/containers/unord/unord.set/bucket_count.pass.cpp
Index: test/std/containers/unord/unord.set/bucket_count.pass.cpp
===================================================================
--- test/std/containers/unord/unord.set/bucket_count.pass.cpp
+++ test/std/containers/unord/unord.set/bucket_count.pass.cpp
@@ -46,7 +46,7 @@
P(80)
};
const C c(std::begin(a), std::end(a));
- assert(c.bucket_count() >= 11);
+ assert(c.bucket_count() >= 8);
}
#if TEST_STD_VER >= 11
{
@@ -72,7 +72,7 @@
P(80)
};
const C c(std::begin(a), std::end(a));
- assert(c.bucket_count() >= 11);
+ assert(c.bucket_count() >= 8);
}
#endif
}
Index: test/std/containers/unord/unord.multiset/bucket_count.pass.cpp
===================================================================
--- test/std/containers/unord/unord.multiset/bucket_count.pass.cpp
+++ test/std/containers/unord/unord.multiset/bucket_count.pass.cpp
@@ -46,7 +46,7 @@
P(80)
};
const C c(std::begin(a), std::end(a));
- assert(c.bucket_count() >= 11);
+ assert(c.bucket_count() >= 8);
}
#if TEST_STD_VER >= 11
{
@@ -74,7 +74,7 @@
P(80)
};
const C c(std::begin(a), std::end(a));
- assert(c.bucket_count() >= 11);
+ assert(c.bucket_count() >= 8);
}
#endif
}
Index: test/std/containers/unord/unord.multimap/bucket_count.pass.cpp
===================================================================
--- test/std/containers/unord/unord.multimap/bucket_count.pass.cpp
+++ test/std/containers/unord/unord.multimap/bucket_count.pass.cpp
@@ -46,6 +46,6 @@
P(80, "eighty"),
};
const C c(std::begin(a), std::end(a));
- assert(c.bucket_count() >= 11);
+ assert(c.bucket_count() >= 8);
}
}
Index: test/std/containers/unord/unord.map/bucket_count.pass.cpp
===================================================================
--- test/std/containers/unord/unord.map/bucket_count.pass.cpp
+++ test/std/containers/unord/unord.map/bucket_count.pass.cpp
@@ -44,7 +44,7 @@
P(80, "eighty"),
};
const C c(std::begin(a), std::end(a));
- assert(c.bucket_count() >= 11);
+ assert(c.bucket_count() >= 8);
}
#if TEST_STD_VER >= 11
{
@@ -69,7 +69,7 @@
P(80, "eighty"),
};
const C c(std::begin(a), std::end(a));
- assert(c.bucket_count() >= 11);
+ assert(c.bucket_count() >= 8);
}
#endif
}
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D22165.63295.patch
Type: text/x-patch
Size: 2515 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160708/f561b5ce/attachment.bin>
More information about the cfe-commits
mailing list