Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r66494 - in trunk: boost/icl libs/icl/test
From: afojgo_at_[hidden]
Date: 2010-11-11 11:51:13


Author: jofaber
Date: 2010-11-11 11:51:08 EST (Thu, 11 Nov 2010)
New Revision: 66494
URL: http://svn.boost.org/trac/boost/changeset/66494

Log:
Adaptations for test matrix failures. Portability fixes for msvc-7.1 and clang-2.9. Added some macros for portability.
Added:
   trunk/libs/icl/test/portability.hpp (contents, props changed)
Text files modified:
   trunk/boost/icl/split_interval_set.hpp | 18 +++---
   trunk/libs/icl/test/test_functions.hpp | 47 ++++++++++--------
   trunk/libs/icl/test/test_icl_quantifier_shared.hpp | 13 ++--
   trunk/libs/icl/test/test_interval_quantifier_shared.hpp | 11 ++--
   trunk/libs/icl/test/test_set_interval_set_shared.hpp | 98 +++++++++------------------------------
   5 files changed, 72 insertions(+), 115 deletions(-)

Modified: trunk/boost/icl/split_interval_set.hpp
==============================================================================
--- trunk/boost/icl/split_interval_set.hpp (original)
+++ trunk/boost/icl/split_interval_set.hpp 2010-11-11 11:51:08 EST (Thu, 11 Nov 2010)
@@ -6,8 +6,8 @@
       (See accompanying file LICENCE.txt or copy at
            http://www.boost.org/LICENSE_1_0.txt)
 +-----------------------------------------------------------------------------*/
-#ifndef __split_interval_set_JOFA_990223__
-#define __split_interval_set_JOFA_990223__
+#ifndef BOOST_ICL_SPLIT_INTERVAL_SET_HPP_JOFA_990223
+#define BOOST_ICL_SPLIT_INTERVAL_SET_HPP_JOFA_990223
 
 #include <boost/icl/type_traits/is_interval_splitter.hpp>
 #include <boost/icl/interval_base_set.hpp>
@@ -138,9 +138,9 @@
         iterator it_ = first_;
         interval_type rest_interval = addend;
 
- add_front(rest_interval, it_);
- add_main (rest_interval, it_, last_);
- add_rear (rest_interval, it_);
+ this->add_front(rest_interval, it_);
+ this->add_main (rest_interval, it_, last_);
+ this->add_rear (rest_interval, it_);
         return it_;
     }
 
@@ -154,9 +154,9 @@
         iterator it_ = first_;
         interval_type rest_interval = addend;
 
- add_front(rest_interval, it_);
- add_main (rest_interval, it_, last_);
- add_rear (rest_interval, it_);
+ this->add_front(rest_interval, it_);
+ this->add_main (rest_interval, it_, last_);
+ this->add_rear (rest_interval, it_);
 
         return it_;
     }
@@ -201,7 +201,7 @@
 
 }} // namespace icl boost
 
-#endif
+#endif // BOOST_ICL_SPLIT_INTERVAL_SET_HPP_JOFA_990223
 
 
 

Added: trunk/libs/icl/test/portability.hpp
==============================================================================
--- (empty file)
+++ trunk/libs/icl/test/portability.hpp 2010-11-11 11:51:08 EST (Thu, 11 Nov 2010)
@@ -0,0 +1,60 @@
+/*-----------------------------------------------------------------------------+
+Copyright (c) 2010-2010: Joachim Faulhaber
++------------------------------------------------------------------------------+
+ Distributed under the Boost Software License, Version 1.0.
+ (See accompanying file LICENCE.txt or copy at
+ http://www.boost.org/LICENSE_1_0.txt)
++-----------------------------------------------------------------------------*/
+#ifndef BOOST_ICL_TEST_PORTABILITY_HPP_JOFA_101111
+#define BOOST_ICL_TEST_PORTABILITY_HPP_JOFA_101111
+
+#include <boost/icl/detail/design_config.hpp>
+
+// This file contains auxiliary macros to help with portability problems
+// It is not designed to for general use but only in the context of test
+// code for the ICL. There will be a number of specific assumptions about
+// e.g. template parameter names that are only valid for icl tests.
+
+//PORT: msvc-7.1: For local template template parameters, msvc-7.1 does not
+// accept a subsequent instantiation of that parameter using default arguments e.g.:
+// test_functions.hpp(37) : error C2976: 'IntervalMap' : too few template arguments
+
+//ASSUMPTION: Fixed name IntervalMap
+#define ICL_PORT_msvc_7_1_IntervalMap(tp_T, tp_U, tp_Trt) \
+IntervalMap<tp_T, tp_U, tp_Trt \
+ ,ICL_COMPARE_INSTANCE(std::less, tp_T) \
+ ,ICL_COMBINE_INSTANCE(icl::inplace_plus, tp_U) \
+ ,ICL_SECTION_INSTANCE(icl::inter_section, tp_U) \
+ ,ICL_INTERVAL_INSTANCE(ICL_INTERVAL_DEFAULT, tp_T, ICL_COMPARE_INSTANCE(std::less, tp_T)) \
+ ,std::allocator>
+
+//ASSUMPTION: Fixed name IntervalSet
+#define ICL_PORT_msvc_7_1_IntervalSet(tp_T) \
+IntervalSet<tp_T \
+ ,ICL_COMPARE_INSTANCE(std::less, tp_T) \
+ ,ICL_INTERVAL_INSTANCE(ICL_INTERVAL_DEFAULT, tp_T, ICL_COMPARE_INSTANCE(std::less, tp_T)) \
+ ,std::allocator>
+
+
+//------------------------------------------------------------------------------
+// Signature Macros: Help reducing redundancies in template headers
+//------------------------------------------------------------------------------
+#define ICL_IntervalMap_TEMPLATE(tp_T, tp_U, tp_Traits, tp_Trt) \
+template<class tp_T, class tp_U, \
+ class tp_Traits = tp_Trt, \
+ ICL_COMPARE Compare = ICL_COMPARE_INSTANCE(std::less, tp_T), \
+ ICL_COMBINE Combine = ICL_COMBINE_INSTANCE(icl::inplace_plus, tp_U), \
+ ICL_SECTION Section = ICL_SECTION_INSTANCE(icl::inter_section, tp_U), \
+ ICL_INTERVAL(ICL_COMPARE) Interval = ICL_INTERVAL_INSTANCE(ICL_INTERVAL_DEFAULT, tp_T, Compare), \
+ ICL_ALLOC Alloc = std::allocator>class
+
+
+#define ICL_IntervalSet_TEMPLATE(tp_T) \
+template<class tp_T, \
+ ICL_COMPARE Compare = ICL_COMPARE_INSTANCE(std::less, tp_T), \
+ ICL_INTERVAL(ICL_COMPARE) Interval = ICL_INTERVAL_INSTANCE(ICL_INTERVAL_DEFAULT, tp_T, Compare), \
+ ICL_ALLOC Alloc = std::allocator>class
+
+
+#endif // BOOST_ICL_TEST_PORTABILITY_HPP_JOFA_101111
+

Modified: trunk/libs/icl/test/test_functions.hpp
==============================================================================
--- trunk/libs/icl/test/test_functions.hpp (original)
+++ trunk/libs/icl/test/test_functions.hpp 2010-11-11 11:51:08 EST (Thu, 11 Nov 2010)
@@ -18,23 +18,26 @@
 
 #include <boost/icl/type_traits/identity_element.hpp>
 #include <boost/icl/functors.hpp>
+#include "portability.hpp"
+
 
 namespace boost{namespace icl
 {
 
-template <class T, class U, class Trt,
- template<class T, class U,
- class Traits = Trt,
- ICL_COMPARE Compare = ICL_COMPARE_INSTANCE(std::less, T),
- ICL_COMBINE Combine = ICL_COMBINE_INSTANCE(icl::inplace_plus, U),
- ICL_SECTION Section = ICL_SECTION_INSTANCE(icl::inter_section, U),
- ICL_INTERVAL(ICL_COMPARE) Interval = ICL_INTERVAL_INSTANCE(ICL_INTERVAL_DEFAULT, T, Compare),
- ICL_ALLOC Alloc = std::allocator
- >class IntervalMap,
+template <class T, class U, class Trt,
+ ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap,
+ //CL template<class _T, class _U,
+ // class Traits = Trt,
+ // ICL_COMPARE Compare = ICL_COMPARE_INSTANCE(std::less, _T),
+ // ICL_COMBINE Combine = ICL_COMBINE_INSTANCE(icl::inplace_plus, _U),
+ // ICL_SECTION Section = ICL_SECTION_INSTANCE(icl::inter_section, _U),
+ // ICL_INTERVAL(ICL_COMPARE) Interval = ICL_INTERVAL_INSTANCE(ICL_INTERVAL_DEFAULT, _T, Compare),
+ // ICL_ALLOC Alloc = std::allocator
+ // >class IntervalMap,
           class SequenceT
>
 void itl_map_copy(const SequenceT& segments,
- IntervalMap<T,U,Trt>& destination)
+ ICL_PORT_msvc_7_1_IntervalMap(T,U,Trt)& destination)
 {
     ICL_const_FORALL(typename SequenceT, segment_, segments)
         destination.insert(*segment_);
@@ -42,20 +45,22 @@
 
 
 template <class T, class U, class Trt,
- template<class T, class U,
- class Traits = Trt,
- ICL_COMPARE Compare = ICL_COMPARE_INSTANCE(std::less, U),
- ICL_COMBINE Combine = ICL_COMBINE_INSTANCE(icl::inplace_plus, U),
- ICL_SECTION Section = ICL_SECTION_INSTANCE(icl::inter_section, U),
- ICL_INTERVAL(ICL_COMPARE) Interval = ICL_INTERVAL_INSTANCE(ICL_INTERVAL_DEFAULT, T, Compare),
- ICL_ALLOC Alloc = std::allocator
- >class IntervalMap,
+ ICL_IntervalMap_TEMPLATE(_T,_U,Traits,Trt) IntervalMap,
+ //template<class T, class U,
+ // class Traits = Trt,
+ // ICL_COMPARE Compare = ICL_COMPARE_INSTANCE(std::less, U),
+ // ICL_COMBINE Combine = ICL_COMBINE_INSTANCE(icl::inplace_plus, U),
+ // ICL_SECTION Section = ICL_SECTION_INSTANCE(icl::inter_section, U),
+ // ICL_INTERVAL(ICL_COMPARE) Interval = ICL_INTERVAL_INSTANCE(ICL_INTERVAL_DEFAULT, T, Compare),
+ // ICL_ALLOC Alloc = std::allocator
+ // >class IntervalMap,
           class SequenceT
>
-void test_interval_map_copy_via_inserter(const SequenceT& segments, IntervalMap<T,U,Trt>& std_copied_map)
+void test_interval_map_copy_via_inserter(const SequenceT& segments,
+ ICL_PORT_msvc_7_1_IntervalMap(T,U,Trt)& std_copied_map)
 {
- // The second parameter (std_copied_map) could be omitted and only held as a
- // local variable. I is there to help gcc-3.4.4 resolving the function template type.
+ // The second parameter (std_copied_map) could be omitted and is only held as a
+ // local variable. It is there to help gcc-3.4.4 resolving the function template type.
     typedef IntervalMap<T,U,Trt> IntervalMapT;
     IntervalMapT looped_copied_map;
     std_copied_map.clear();

Modified: trunk/libs/icl/test/test_icl_quantifier_shared.hpp
==============================================================================
--- trunk/libs/icl/test/test_icl_quantifier_shared.hpp (original)
+++ trunk/libs/icl/test/test_icl_quantifier_shared.hpp 2010-11-11 11:51:08 EST (Thu, 11 Nov 2010)
@@ -8,6 +8,7 @@
 #ifndef __TEST_ICL_QUANTIFIER_SHARED_H_JOFA_100819__
 #define __TEST_ICL_QUANTIFIER_SHARED_H_JOFA_100819__
 
+#include "portability.hpp"
 
 template <class T, class U, class Trt,
           template<class T, class U,
@@ -25,7 +26,7 @@
                     icl::map<T,U,Trt>& map_c,
                     std::pair<T,U>& map_pair_a,
                     std::pair<T,U>& map_pair_b,
- IntervalMap<T,U,Trt>*)
+ ICL_PORT_msvc_7_1_IntervalMap(T,U,Trt)*)
 {
     typedef IntervalMap<T,U,Trt> IntervalMapT;
     typedef icl::map<T,U,Trt> MapT;
@@ -118,12 +119,12 @@
 //------------------------------------------------------------------------------
 
 template <class T, class U, class Trt,
- template<class T, class U,
+ template<class _T, class _U,
                    class Traits = Trt,
- ICL_COMPARE Compare = ICL_COMPARE_INSTANCE(std::less, U),
- ICL_COMBINE Combine = ICL_COMBINE_INSTANCE(icl::inplace_plus, U),
- ICL_SECTION Section = ICL_SECTION_INSTANCE(icl::inter_section, U),
- ICL_INTERVAL(ICL_COMPARE) Interval = ICL_INTERVAL_INSTANCE(ICL_INTERVAL_DEFAULT, T, Compare),
+ ICL_COMPARE Compare = ICL_COMPARE_INSTANCE(std::less, _U),
+ ICL_COMBINE Combine = ICL_COMBINE_INSTANCE(icl::inplace_plus, _U),
+ ICL_SECTION Section = ICL_SECTION_INSTANCE(icl::inter_section, _U),
+ ICL_INTERVAL(ICL_COMPARE) Interval = ICL_INTERVAL_INSTANCE(ICL_INTERVAL_DEFAULT, _T, Compare),
                    ICL_ALLOC Alloc = std::allocator
>class IntervalMap
>

Modified: trunk/libs/icl/test/test_interval_quantifier_shared.hpp
==============================================================================
--- trunk/libs/icl/test/test_interval_quantifier_shared.hpp (original)
+++ trunk/libs/icl/test/test_interval_quantifier_shared.hpp 2010-11-11 11:51:08 EST (Thu, 11 Nov 2010)
@@ -8,7 +8,8 @@
 #ifndef __TEST_INTERVAL_QUANTIFIER_SHARED_H_JOFA_090119__
 #define __TEST_INTERVAL_QUANTIFIER_SHARED_H_JOFA_090119__
 
-
+#include "portability.hpp"
+
 template <class T, class U, class Trt,
           template<class T, class U,
                    class Traits = Trt,
@@ -20,10 +21,10 @@
>class IntervalMap
>
 void make_3_itv_maps_and_derivatives_1
- (IntervalMap<T,U,Trt>& itv_map_a,
- IntervalMap<T,U,Trt>& itv_map_b,
- IntervalMap<T,U,Trt>& itv_map_c,
- typename IntervalMap<T,U,Trt>::interval_mapping_type& val_pair,
+ (ICL_PORT_msvc_7_1_IntervalMap(T,U,Trt)& itv_map_a,
+ ICL_PORT_msvc_7_1_IntervalMap(T,U,Trt)& itv_map_b,
+ ICL_PORT_msvc_7_1_IntervalMap(T,U,Trt)& itv_map_c,
+ typename ICL_PORT_msvc_7_1_IntervalMap(T,U,Trt)::interval_mapping_type& val_pair,
                     mapping_pair<T,U>& map_pair)
 {
     typedef IntervalMap<T,U,Trt> IntervalMapT;

Modified: trunk/libs/icl/test/test_set_interval_set_shared.hpp
==============================================================================
--- trunk/libs/icl/test/test_set_interval_set_shared.hpp (original)
+++ trunk/libs/icl/test/test_set_interval_set_shared.hpp 2010-11-11 11:51:08 EST (Thu, 11 Nov 2010)
@@ -5,24 +5,24 @@
       (See accompanying file LICENCE.txt or copy at
            http://www.boost.org/LICENSE_1_0.txt)
 +-----------------------------------------------------------------------------*/
-#ifndef LIBS_ICL_TEST_TEST_ICL_set_interval_set_h_JOFA_090119__
-#define LIBS_ICL_TEST_TEST_ICL_set_interval_set_h_JOFA_090119__
+#ifndef LIBS_ICL_TEST_TEST_SET_INTERVAL_SET_SHARED_HPP_JOFA_090119
+#define LIBS_ICL_TEST_TEST_SET_INTERVAL_SET_SHARED_HPP_JOFA_090119
 
+#include "portability.hpp"
 
-
-template <class T,
- template<class T,
- ICL_COMPARE Compare = ICL_COMPARE_INSTANCE(std::less, U),
- ICL_INTERVAL(ICL_COMPARE) Interval = ICL_INTERVAL_INSTANCE(ICL_INTERVAL_DEFAULT, T, Compare),
- ICL_ALLOC Alloc = std::allocator
- >class IntervalSet
- >
+template <class T, ICL_IntervalSet_TEMPLATE(_T) IntervalSet>
+ //CL template<class T,
+ // ICL_COMPARE Compare = ICL_COMPARE_INSTANCE(std::less, U),
+ // ICL_INTERVAL(ICL_COMPARE) Interval = ICL_INTERVAL_INSTANCE(ICL_INTERVAL_DEFAULT, T, Compare),
+ // ICL_ALLOC Alloc = std::allocator
+ // >class IntervalSet
+ //>
 void make_3_interval_sets_and_derivatives_1
- (IntervalSet<T>& set_a,
- IntervalSet<T>& set_b,
- IntervalSet<T>& set_c,
- typename IntervalSet<T>::segment_type& segm_d,
- typename IntervalSet<T>::element_type& elem_e)
+ (ICL_PORT_msvc_7_1_IntervalSet(T)& set_a,
+ ICL_PORT_msvc_7_1_IntervalSet(T)& set_b,
+ ICL_PORT_msvc_7_1_IntervalSet(T)& set_c,
+ typename ICL_PORT_msvc_7_1_IntervalSet(T)::segment_type& segm_d,
+ typename ICL_PORT_msvc_7_1_IntervalSet(T)::element_type& elem_e)
 {
     typedef IntervalSet<T> IntervalSetT;
     typedef typename IntervalSetT::segment_type IntervalT;
@@ -42,13 +42,7 @@
 //------------------------------------------------------------------------------
 // Monoid EAN
 //------------------------------------------------------------------------------
-template <class T,
- template<class T,
- ICL_COMPARE Compare = ICL_COMPARE_INSTANCE(std::less, U),
- ICL_INTERVAL(ICL_COMPARE) Interval = ICL_INTERVAL_INSTANCE(ICL_INTERVAL_DEFAULT, T, Compare),
- ICL_ALLOC Alloc = std::allocator
- >class IntervalSet
- >
+template <class T, ICL_IntervalSet_TEMPLATE(_T) IntervalSet>
 void interval_set_check_monoid_plus_4_bicremental_types()
 {
     typedef IntervalSet<T> IntervalSetT;
@@ -66,13 +60,7 @@
     CHECK_MONOID_INSTANCE_WRT(pipe) (set_a, set_b, set_c, inter_val1, inter_val2);
 }
 
-template <class T,
- template<class T,
- ICL_COMPARE Compare = ICL_COMPARE_INSTANCE(std::less, U),
- ICL_INTERVAL(ICL_COMPARE) Interval = ICL_INTERVAL_INSTANCE(ICL_INTERVAL_DEFAULT, T, Compare),
- ICL_ALLOC Alloc = std::allocator
- >class IntervalSet
- >
+template <class T, ICL_IntervalSet_TEMPLATE(_T) IntervalSet>
 void interval_set_check_monoid_et_4_bicremental_types()
 {
     typedef IntervalSet<T> IntervalSetT;
@@ -94,13 +82,7 @@
 // Abelian monoid EANC
 //------------------------------------------------------------------------------
 
-template <class T,
- template<class T,
- ICL_COMPARE Compare = ICL_COMPARE_INSTANCE(std::less, U),
- ICL_INTERVAL(ICL_COMPARE) Interval = ICL_INTERVAL_INSTANCE(ICL_INTERVAL_DEFAULT, T, Compare),
- ICL_ALLOC Alloc = std::allocator
- >class IntervalSet
- >
+template <class T, ICL_IntervalSet_TEMPLATE(_T) IntervalSet>
 void interval_set_check_abelian_monoid_plus_4_bicremental_types()
 {
     typedef IntervalSet<T> IntervalSetT;
@@ -118,13 +100,7 @@
     CHECK_ABELIAN_MONOID_INSTANCE_WRT(pipe) (set_a, set_b, set_c, inter_val1, inter_val2);
 }
 
-template <class T,
- template<class T,
- ICL_COMPARE Compare = ICL_COMPARE_INSTANCE(std::less, U),
- ICL_INTERVAL(ICL_COMPARE) Interval = ICL_INTERVAL_INSTANCE(ICL_INTERVAL_DEFAULT, T, Compare),
- ICL_ALLOC Alloc = std::allocator
- >class IntervalSet
- >
+template <class T, ICL_IntervalSet_TEMPLATE(_T) IntervalSet>
 void interval_set_check_abelian_monoid_et_4_bicremental_types()
 {
     typedef IntervalSet<T> IntervalSetT;
@@ -146,13 +122,7 @@
 //------------------------------------------------------------------------------
 // Abelian partial invertive monoid
 //------------------------------------------------------------------------------
-template <class T,
- template<class T,
- ICL_COMPARE Compare = ICL_COMPARE_INSTANCE(std::less, U),
- ICL_INTERVAL(ICL_COMPARE) Interval = ICL_INTERVAL_INSTANCE(ICL_INTERVAL_DEFAULT, T, Compare),
- ICL_ALLOC Alloc = std::allocator
- >class IntervalSet
- >
+template <class T, ICL_IntervalSet_TEMPLATE(_T) IntervalSet>
 void interval_set_check_partial_invertive_monoid_plus_4_bicremental_types()
 {
     typedef IntervalSet<T> IntervalSetT;
@@ -174,13 +144,7 @@
 //------------------------------------------------------------------------------
 // Containedness
 //------------------------------------------------------------------------------
-template <class T,
- template<class T,
- ICL_COMPARE Compare = ICL_COMPARE_INSTANCE(std::less, U),
- ICL_INTERVAL(ICL_COMPARE) Interval = ICL_INTERVAL_INSTANCE(ICL_INTERVAL_DEFAULT, T, Compare),
- ICL_ALLOC Alloc = std::allocator
- >class IntervalSet
- >
+template <class T, ICL_IntervalSet_TEMPLATE(_T) IntervalSet>
 void interval_set_check_containedness_4_bicremental_types()
 {
     typedef IntervalSet<T> IntervalSetT;
@@ -205,13 +169,7 @@
 //------------------------------------------------------------------------------
 // Inner complement
 //------------------------------------------------------------------------------
-template <class T,
- template<class T,
- ICL_COMPARE Compare = ICL_COMPARE_INSTANCE(std::less, U),
- ICL_INTERVAL(ICL_COMPARE) Interval = ICL_INTERVAL_INSTANCE(ICL_INTERVAL_DEFAULT, T, Compare),
- ICL_ALLOC Alloc = std::allocator
- >class IntervalSet
- >
+template <class T, ICL_IntervalSet_TEMPLATE(_T) IntervalSet>
 void interval_set_check_inner_complementarity_4_bicremental_types()
 {
     typedef IntervalSet<T> IntervalSetT;
@@ -228,13 +186,7 @@
     has_inner_complementarity<IntervalSetT,IntervalSetT>(set_c);
 }
 
-template <class T,
- template<class T,
- ICL_COMPARE Compare = ICL_COMPARE_INSTANCE(std::less, U),
- ICL_INTERVAL(ICL_COMPARE) Interval = ICL_INTERVAL_INSTANCE(ICL_INTERVAL_DEFAULT, T, Compare),
- ICL_ALLOC Alloc = std::allocator
- >class IntervalSet
- >
+template <class T, ICL_IntervalSet_TEMPLATE(_T) IntervalSet>
 void interval_set_check_length_complementarity_4_bicremental_types()
 {
     typedef IntervalSet<T> IntervalSetT;
@@ -255,7 +207,5 @@
     has_length_as_distance<IntervalSetT,IntervalSetT>(set_c);
 }
 
-
-
-#endif // LIBS_ICL_TEST_TEST_ICL_set_interval_set_h_JOFA_090119__
+#endif // LIBS_ICL_TEST_TEST_SET_INTERVAL_SET_SHARED_HPP_JOFA_090119
 


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