Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r71364 - in branches/release/libs/icl/test: . fix_tickets_ test_casual_ test_doc_code_
From: afojgo_at_[hidden]
Date: 2011-04-17 17:46:06


Author: jofaber
Date: 2011-04-17 17:46:06 EDT (Sun, 17 Apr 2011)
New Revision: 71364
URL: http://svn.boost.org/trac/boost/changeset/71364

Log:
Merged changes [71328-71362] Bug fix for ticket #5482
Added:
   branches/release/libs/icl/test/fix_tickets_/
      - copied from r71331, /trunk/libs/icl/test/fix_tickets_/
   branches/release/libs/icl/test/fix_tickets_/fix_tickets.cpp
      - copied unchanged from r71331, /trunk/libs/icl/test/fix_tickets_/fix_tickets.cpp
   branches/release/libs/icl/test/fix_tickets_/vc9_fix_tickets.vcproj
      - copied unchanged from r71331, /trunk/libs/icl/test/fix_tickets_/vc9_fix_tickets.vcproj
Properties modified:
   branches/release/libs/icl/test/ (props changed)
   branches/release/libs/icl/test/test_doc_code_/ (props changed)
Text files modified:
   branches/release/libs/icl/test/Jamfile.v2 | 1
   branches/release/libs/icl/test/portability.hpp | 35 +++++++++++------
   branches/release/libs/icl/test/test_casual_/test_casual.cpp | 79 +++++++++++++++++++++++++++++----------
   branches/release/libs/icl/test/vc9_icl_fast_tests.sln | 6 +++
   4 files changed, 88 insertions(+), 33 deletions(-)

Modified: branches/release/libs/icl/test/Jamfile.v2
==============================================================================
--- branches/release/libs/icl/test/Jamfile.v2 (original)
+++ branches/release/libs/icl/test/Jamfile.v2 2011-04-17 17:46:06 EDT (Sun, 17 Apr 2011)
@@ -70,6 +70,7 @@
       
       # Bug fixes --------------------------------------------------------------
       [ run fix_icl_after_thread_/fix_icl_after_thread.cpp ]
+ [ run fix_tickets_/fix_tickets.cpp ]
       
       # Check for compiler bugs ------------------------------------------------
       # compile-fail-tests

Modified: branches/release/libs/icl/test/portability.hpp
==============================================================================
--- branches/release/libs/icl/test/portability.hpp (original)
+++ branches/release/libs/icl/test/portability.hpp 2011-04-17 17:46:06 EDT (Sun, 17 Apr 2011)
@@ -22,17 +22,17 @@
 //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_COMPARE_INSTANCE(ICL_COMPARE_DEFAULT, 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)) \
+ ,ICL_INTERVAL_INSTANCE(ICL_INTERVAL_DEFAULT, tp_T, ICL_COMPARE_INSTANCE(ICL_COMPARE_DEFAULT, 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)) \
+ ,ICL_COMPARE_INSTANCE(ICL_COMPARE_DEFAULT, tp_T) \
+ ,ICL_INTERVAL_INSTANCE(ICL_INTERVAL_DEFAULT, tp_T, ICL_COMPARE_INSTANCE(ICL_COMPARE_DEFAULT, tp_T)) \
            ,std::allocator>
 
 
@@ -42,19 +42,30 @@
 #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_COMPARE Compare = ICL_COMPARE_INSTANCE(ICL_COMPARE_DEFAULT, 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
 
+#ifndef ICL_INTERVAL_BITSET_IMPL
 
-#endif // BOOST_ICL_TEST_PORTABILITY_HPP_JOFA_101111
+# define ICL_IntervalSet_TEMPLATE(tp_T) \
+ template<class tp_T, \
+ ICL_COMPARE Compare = ICL_COMPARE_INSTANCE(ICL_COMPARE_DEFAULT, tp_T), \
+ ICL_INTERVAL(ICL_COMPARE) Interval = ICL_INTERVAL_INSTANCE(ICL_INTERVAL_DEFAULT, tp_T, Compare), \
+ ICL_ALLOC Alloc = std::allocator>class
+
+#else
+
+# define ICL_IntervalSet_TEMPLATE(tp_T) \
+ template<class tp_T, \
+ class BitSetT = icl::bits<unsigned long>, \
+ ICL_COMPARE Compare = ICL_COMPARE_INSTANCE(ICL_COMPARE_DEFAULT, tp_T), \
+ ICL_INTERVAL(ICL_COMPARE) Interval = ICL_INTERVAL_INSTANCE(ICL_INTERVAL_DEFAULT, tp_T, Compare), \
+ ICL_ALLOC Alloc = std::allocator>class
 
+#endif //ICL_INTERVAL_BITSET_IMPL
+
+#endif // BOOST_ICL_TEST_PORTABILITY_HPP_JOFA_101111

Modified: branches/release/libs/icl/test/test_casual_/test_casual.cpp
==============================================================================
--- branches/release/libs/icl/test/test_casual_/test_casual.cpp (original)
+++ branches/release/libs/icl/test/test_casual_/test_casual.cpp 2011-04-17 17:46:06 EDT (Sun, 17 Apr 2011)
@@ -183,32 +183,69 @@
 
 }
 
-BOOST_AUTO_TEST_CASE(casual)
+BOOST_AUTO_TEST_CASE(invariance_wrt_compare_ordering_ticket_5482)
 {
- //typedef int T;
- //typedef int U;
- //typedef interval_map<T,U, total_absorber> IntervalMapT;
- //typedef interval_set<T> IntervalSetT;
- //typedef IntervalMapT::interval_type IntervalT;
-
- BOOST_CHECK((has_std_infinity<double>::value));
-
- BOOST_CHECK((boost::detail::is_incrementable<chrono::duration<int> >::value));
+ typedef int T;
+ typedef int U;
+ typedef interval_map<T,U, partial_absorber> IntervalMapT;
+ typedef interval_map<T,U, partial_absorber,std::less> IntervalLtMapT;
+ typedef interval_map<T,U, partial_absorber,std::greater> IntervalGtMapT;
+ typedef interval_set<T> IntervalSetT;
+ typedef IntervalMapT::interval_type IntervalT;
+ typedef IntervalLtMapT::interval_type IntervalLtT;
+ typedef IntervalGtMapT::interval_type IntervalGtT;
+
+ IntervalLtMapT lt_map;
+ IntervalGtMapT gt_map;
+
+ BOOST_CHECK( IntervalLtMapT::domain_compare()(0,1));
+ BOOST_CHECK(!IntervalLtMapT::domain_compare()(1,0));
+ BOOST_CHECK( IntervalGtMapT::domain_compare()(1,0));
+ BOOST_CHECK(!IntervalGtMapT::domain_compare()(0,1));
+
+ IntervalGtT(5);
+
+ lt_map.insert(make_pair(IntervalLtT(1),1));
+ lt_map.insert(make_pair(IntervalLtT(2),1));
+
+ gt_map.insert(make_pair(IntervalGtT(2,1),1));
+ gt_map.insert(make_pair(IntervalGtT(3,2),1));
+ gt_map.insert(make_pair(IntervalGtT(5,4),1));
+ gt_map.add(make_pair(IntervalGtT(8,2),1));
+
+ cout << "-----------------------------\n";
+ cout << "lt_map.iterative_size() = " << lt_map.iterative_size() << endl;
+ cout << "gt_map.iterative_size() = " << gt_map.iterative_size() << endl;
+ cout << "gt_map : " << gt_map << endl;
+
 
- BOOST_CHECK((has_rep_type<chrono::duration<int> >::value));
- BOOST_CHECK((represents<int, chrono::duration<int> >::value));
-
- BOOST_CHECK((!is_discrete<chrono::duration<double> >::value));
+ BOOST_CHECK_EQUAL(true, true);
+}
 
- //BOOST_CHECK((!is_discrete<Now_time_rational>::value));
- BOOST_CHECK(( is_continuous<boost::rational<int> >::value));
- BOOST_CHECK(( !is_discrete<boost::rational<int> >::value));
 
- BOOST_CHECK(( has_rep_type<Now_time_rational>::value));
- BOOST_CHECK(( is_continuous<Now_time_rational>::value));
- BOOST_CHECK(( !is_discrete<Now_time_rational>::value));
- BOOST_CHECK(( is_continuous<typename rep_type_of<Now_time_rational>::type>::value));
+BOOST_AUTO_TEST_CASE(ticket_5482)
+{
+ typedef interval_map<int,int,partial_absorber,std::less> m1_t;
+ typedef interval_map<int,int,partial_absorber,std::greater> m2_t;
+ m1_t m1;
+ m2_t m2;
+ m1.insert(make_pair(m1_t::interval_type(1), 20));
+ m1.insert(make_pair(m1_t::interval_type(2), 20));
+ m1.insert(make_pair(m1_t::interval_type(3), 20));
+
+ m2.insert(make_pair(m2_t::interval_type(1), 20));
+ m2.insert(make_pair(m2_t::interval_type(2), 20));
+ m2.insert(make_pair(m2_t::interval_type(3), 20));
+ BOOST_CHECK_EQUAL(m1.iterative_size(), m2.iterative_size());
+}
 
+BOOST_AUTO_TEST_CASE(casual)
+{
+ typedef int T;
+ typedef int U;
+ typedef interval_map<T,U, partial_absorber> IntervalMapT;
+ typedef interval_set<T> IntervalSetT;
+ typedef IntervalMapT::interval_type IntervalT;
 
     BOOST_CHECK_EQUAL(true, true);
 }

Modified: branches/release/libs/icl/test/vc9_icl_fast_tests.sln
==============================================================================
--- branches/release/libs/icl/test/vc9_icl_fast_tests.sln (original)
+++ branches/release/libs/icl/test/vc9_icl_fast_tests.sln 2011-04-17 17:46:06 EDT (Sun, 17 Apr 2011)
@@ -67,6 +67,8 @@
 EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vc9_fast_stat_interval_map", "fast_stat_interval_map_\vc9_fast_stat_interval_map.vcproj", "{EE61B7EF-EC45-4165-8B49-FD5B7D3A900D}"
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "vc9_fix_tickets", "fix_tickets_\vc9_fix_tickets.vcproj", "{EE61B7EF-EC45-4165-8B49-FD5B8D9A9FA1}"
+EndProject
 Global
         GlobalSection(SolutionConfigurationPlatforms) = preSolution
                 Debug|Win32 = Debug|Win32
@@ -205,6 +207,10 @@
                 {EE61B7EF-EC45-4165-8B49-FD5B7D3A900D}.Debug|Win32.Build.0 = Debug|Win32
                 {EE61B7EF-EC45-4165-8B49-FD5B7D3A900D}.Release|Win32.ActiveCfg = Release|Win32
                 {EE61B7EF-EC45-4165-8B49-FD5B7D3A900D}.Release|Win32.Build.0 = Release|Win32
+ {EE61B7EF-EC45-4165-8B49-FD5B8D9A9FA1}.Debug|Win32.ActiveCfg = Debug|Win32
+ {EE61B7EF-EC45-4165-8B49-FD5B8D9A9FA1}.Debug|Win32.Build.0 = Debug|Win32
+ {EE61B7EF-EC45-4165-8B49-FD5B8D9A9FA1}.Release|Win32.ActiveCfg = Release|Win32
+ {EE61B7EF-EC45-4165-8B49-FD5B8D9A9FA1}.Release|Win32.Build.0 = Release|Win32
         EndGlobalSection
         GlobalSection(SolutionProperties) = preSolution
                 HideSolutionNode = FALSE


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