|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r53525 - trunk/libs/unordered/test/unordered
From: daniel_james_at_[hidden]
Date: 2009-06-01 02:50:38
Author: danieljames
Date: 2009-06-01 02:50:37 EDT (Mon, 01 Jun 2009)
New Revision: 53525
URL: http://svn.boost.org/trac/boost/changeset/53525
Log:
Fix tests for when the library has support for initializer lists but the compiler doesn't.
Text files modified:
trunk/libs/unordered/test/unordered/assign_tests.cpp | 15 +++++++++++++++
trunk/libs/unordered/test/unordered/constructor_tests.cpp | 11 +++++++++++
2 files changed, 26 insertions(+), 0 deletions(-)
Modified: trunk/libs/unordered/test/unordered/assign_tests.cpp
==============================================================================
--- trunk/libs/unordered/test/unordered/assign_tests.cpp (original)
+++ trunk/libs/unordered/test/unordered/assign_tests.cpp 2009-06-01 02:50:37 EDT (Mon, 01 Jun 2009)
@@ -105,6 +105,21 @@
#if !defined(BOOST_NO_0X_HDR_INITIALIZER_LIST)
+UNORDERED_AUTO_TEST(assign_default_initializer_list) {
+ std::cerr<<"Initializer List Tests\n";
+ std::initializer_list<std::pair<int, int> > init;
+ boost::unordered_map<int, int> x1;
+ x1[25] = 3;
+ x1[16] = 10;
+ BOOST_TEST(!x1.empty());
+ x1 = init;
+ BOOST_TEST(x1.empty());
+}
+
+#endif
+
+#if !defined(BOOST_NO_INITIALIZER_LISTS)
+
UNORDERED_AUTO_TEST(assign_initializer_list)
{
std::cerr<<"Initializer List Tests\n";
Modified: trunk/libs/unordered/test/unordered/constructor_tests.cpp
==============================================================================
--- trunk/libs/unordered/test/unordered/constructor_tests.cpp (original)
+++ trunk/libs/unordered/test/unordered/constructor_tests.cpp 2009-06-01 02:50:37 EDT (Mon, 01 Jun 2009)
@@ -290,6 +290,17 @@
#if !defined(BOOST_NO_0X_HDR_INITIALIZER_LIST)
+UNORDERED_AUTO_TEST(test_default_initializer_list) {
+ std::cerr<<"Initializer List Tests\n";
+ std::initializer_list<int> init;
+ boost::unordered_set<int> x1 = init;
+ BOOST_TEST(x1.empty());
+}
+
+#endif
+
+#if !defined(BOOST_NO_INITIALIZER_LISTS)
+
UNORDERED_AUTO_TEST(test_initializer_list) {
std::cerr<<"Initializer List Tests\n";
boost::unordered_set<int> x1 = { 2, 10, 45, -5 };
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk