Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r61441 - in trunk/libs: multi_array/test range/test/adaptor_test
From: neil_at_[hidden]
Date: 2010-04-20 17:56:33


Author: neilgroves
Date: 2010-04-20 17:56:33 EDT (Tue, 20 Apr 2010)
New Revision: 61441
URL: http://svn.boost.org/trac/boost/changeset/61441

Log:
Boost.MultiArray disambiguated calls to equal functions in the unit tests. These became ambiguous due to changes in Boost.Range.
Text files modified:
   trunk/libs/multi_array/test/assign.cpp | 10 +++++-----
   trunk/libs/multi_array/test/assign_to_array.cpp | 10 +++++-----
   trunk/libs/multi_array/test/constructors.cpp | 22 +++++++++++-----------
   trunk/libs/range/test/adaptor_test/strided2.cpp | 3 +++
   4 files changed, 24 insertions(+), 21 deletions(-)

Modified: trunk/libs/multi_array/test/assign.cpp
==============================================================================
--- trunk/libs/multi_array/test/assign.cpp (original)
+++ trunk/libs/multi_array/test/assign.cpp 2010-04-20 17:56:33 EDT (Tue, 20 Apr 2010)
@@ -1,6 +1,6 @@
 // Copyright 2002 The Trustees of Indiana University.
 
-// Use, modification and distribution is subject to the Boost Software
+// Use, modification and distribution is subject to the Boost Software
 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
 
@@ -10,9 +10,9 @@
 // Andrew Lumsdaine
 // See http://www.boost.org/libs/multi_array for documentation.
 
-//
+//
 // assign.cpp - Test out operator=() on the different types
-//
+//
 //
 #include "generative_tests.hpp"
 #include "boost/array.hpp"
@@ -32,7 +32,7 @@
   typename ArrayA::const_iterator ia;
   typename ArrayB::const_iterator ib = B.begin();
   for (ia = A.begin(); ia != A.end(); ++ia, ++ib)
- if (!equal(*ia, *ib))
+ if (!::equal(*ia, *ib))
       return false;
   return true;
 }
@@ -59,7 +59,7 @@
 
   A = filler;
 
- BOOST_CHECK(equal(A,filler));
+ BOOST_CHECK(::equal(A,filler));
   ++tests_run;
 }
 

Modified: trunk/libs/multi_array/test/assign_to_array.cpp
==============================================================================
--- trunk/libs/multi_array/test/assign_to_array.cpp (original)
+++ trunk/libs/multi_array/test/assign_to_array.cpp 2010-04-20 17:56:33 EDT (Tue, 20 Apr 2010)
@@ -1,6 +1,6 @@
 // Copyright 2002 The Trustees of Indiana University.
 
-// Use, modification and distribution is subject to the Boost Software
+// Use, modification and distribution is subject to the Boost Software
 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
 
@@ -10,10 +10,10 @@
 // Andrew Lumsdaine
 // See http://www.boost.org/libs/multi_array for documentation.
 
-//
+//
 // assign_to_array.cpp - multi_array should be constructible from any other
 // array type in the library.
-//
+//
 //
 #include "generative_tests.hpp"
 #include "boost/array.hpp"
@@ -33,7 +33,7 @@
   typename ArrayA::const_iterator ia;
   typename ArrayB::const_iterator ib = B.begin();
   for (ia = A.begin(); ia != A.end(); ++ia, ++ib)
- if (!equal(*ia, *ib))
+ if (!::equal(*ia, *ib))
       return false;
   return true;
 }
@@ -50,7 +50,7 @@
 void access(Array& A, const const_array_tag&) {
   typedef boost::multi_array<int,3> array3;
   array3 acopy(A);
- BOOST_CHECK(equal(acopy,A));
+ BOOST_CHECK(::equal(acopy,A));
   ++tests_run;
 }
 

Modified: trunk/libs/multi_array/test/constructors.cpp
==============================================================================
--- trunk/libs/multi_array/test/constructors.cpp (original)
+++ trunk/libs/multi_array/test/constructors.cpp 2010-04-20 17:56:33 EDT (Tue, 20 Apr 2010)
@@ -1,6 +1,6 @@
 // Copyright 2002 The Trustees of Indiana University.
 
-// Use, modification and distribution is subject to the Boost Software
+// Use, modification and distribution is subject to the Boost Software
 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)
 
@@ -25,8 +25,8 @@
 {}
 
 template <class Array>
-void check_shape(const Array& A,
- std::size_t* sizes,
+void check_shape(const Array& A,
+ std::size_t* sizes,
                  int* strides,
                  unsigned int num_elements)
 {
@@ -49,7 +49,7 @@
   typename ArrayA::const_iterator ia;
   typename ArrayB::const_iterator ib = B.begin();
   for (ia = A.begin(); ia != A.end(); ++ia, ++ib)
- if (!equal(*ia, *ib))
+ if (!::equal(*ia, *ib))
       return false;
   return true;
 }
@@ -76,7 +76,7 @@
     double* ptr = 0;
     boost::multi_array_ref<double,3> B(ptr,sizes);
     check_shape(B, &sizes[0], strides, num_elements);
-
+
     const double* cptr = ptr;
     boost::const_multi_array_ref<double,3> C(cptr,sizes);
     check_shape(C, &sizes[0], strides, num_elements);
@@ -132,7 +132,7 @@
     A.assign(vals.begin(),vals.end());
     boost::multi_array<double, 3> B(A);
     check_shape(B, &sizes[0], strides, num_elements);
- BOOST_CHECK(equal(A, B));
+ BOOST_CHECK(::equal(A, B));
 
     double ptr[27];
     boost::multi_array_ref<double, 3> C(ptr,sizes);
@@ -182,7 +182,7 @@
     A.assign(vals.begin(),vals.end());
     B = A;
     check_shape(B, &sizes[0], strides, num_elements);
- BOOST_CHECK(equal(A, B));
+ BOOST_CHECK(::equal(A, B));
 
     double ptr1[27];
     double ptr2[27];
@@ -190,12 +190,12 @@
     C.assign(vals.begin(),vals.end());
     D = C;
     check_shape(D, &sizes[0], strides, num_elements);
- BOOST_CHECK(equal(C,D));
+ BOOST_CHECK(::equal(C,D));
   }
 
 
   // subarray value_type is multi_array
- {
+ {
     typedef boost::multi_array<double,3> array;
     typedef array::size_type size_type;
     size_type num_elements = 27;
@@ -209,8 +209,8 @@
     subarray::value_type C = B[0];
 
     // should comparisons between the types work?
- BOOST_CHECK(equal(A[1][0],C));
- BOOST_CHECK(equal(B[0],C));
+ BOOST_CHECK(::equal(A[1][0],C));
+ BOOST_CHECK(::equal(B[0],C));
   }
   return boost::exit_success;
 }

Modified: trunk/libs/range/test/adaptor_test/strided2.cpp
==============================================================================
--- trunk/libs/range/test/adaptor_test/strided2.cpp (original)
+++ trunk/libs/range/test/adaptor_test/strided2.cpp 2010-04-20 17:56:33 EDT (Tue, 20 Apr 2010)
@@ -51,6 +51,9 @@
             reference += 4,8;
             BOOST_CHECK_EQUAL_COLLECTIONS( reference.begin(), reference.end(),
                 z.begin(), z.end() );
+
+ // C++0x Lambda experiment
+ std::sort( v.begin(), v.end(), [](int l, int r) { return l < r; });
         }
     }
 }


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