$include_dir="/home/hyper-archives/boost-commit/include"; include("$include_dir/msg-header.inc") ?>
Subject: [Boost-commit] svn:boost r69353 - in trunk/libs/icl/test: . fix_icl_after_thread_ fix_include_after_thread_ test_casual_
From: afojgo_at_[hidden]
Date: 2011-02-27 16:50:47
Author: jofaber
Date: 2011-02-27 16:50:41 EST (Sun, 27 Feb 2011)
New Revision: 69353
URL: http://svn.boost.org/trac/boost/changeset/69353
Log:
Removed test fix_include_after_thread from test suite.
Text files modified: 
   trunk/libs/icl/test/Jamfile.v2                                             |     9 +-                                      
   trunk/libs/icl/test/fix_icl_after_thread_/fix_icl_after_thread.cpp         |     5 +                                       
   trunk/libs/icl/test/fix_include_after_thread_/fix_include_after_thread.cpp |    13 +++-                                    
   trunk/libs/icl/test/test_casual_/test_casual.cpp                           |   112 ++++++++++++++++++++++++++++++++------- 
   trunk/libs/icl/test/test_icl_dynamic_interval.hpp                          |     2                                         
   trunk/libs/icl/test/test_type_lists.hpp                                    |    38 +++++++++++-                            
   6 files changed, 144 insertions(+), 35 deletions(-)
Modified: trunk/libs/icl/test/Jamfile.v2
==============================================================================
--- trunk/libs/icl/test/Jamfile.v2	(original)
+++ trunk/libs/icl/test/Jamfile.v2	2011-02-27 16:50:41 EST (Sun, 27 Feb 2011)
@@ -10,9 +10,7 @@
     : requirements
       <library>/boost/test//boost_unit_test_framework
       <library>/boost/date_time//boost_date_time
-      <library>/boost/thread//boost_thread
       <link>static
-      <threading>multi
       <include>../../..
     ;
 
@@ -63,12 +61,15 @@
       [ run test_changing_interval_defaults_/test_changing_interval_defaults.cpp ]   
       
       # Bug fixes --------------------------------------------------------------
-      [ run fix_include_after_thread_/fix_include_after_thread.cpp ]   
       [ run fix_icl_after_thread_/fix_icl_after_thread.cpp ] 
       
       # Check for compiler bugs ------------------------------------------------
       # compile-fail-tests  
       [ run cmp_msvc_value_born_error_/cmp_msvc_value_born_error.cpp ]   
       [ run cmp_clang_ttp_passing_/cmp_clang_ttp_passing.cpp ]   
-      [ run cmp_clang_ttp_passing2_/cmp_clang_ttp_passing2.cpp ]   
+      [ run cmp_clang_ttp_passing2_/cmp_clang_ttp_passing2.cpp ]
+      
+      # Ad hoc -----------------------------------------------------------------
+      #[ run test_casual_/test_casual.cpp ]
+         
     ;
Modified: trunk/libs/icl/test/fix_icl_after_thread_/fix_icl_after_thread.cpp
==============================================================================
--- trunk/libs/icl/test/fix_icl_after_thread_/fix_icl_after_thread.cpp	(original)
+++ trunk/libs/icl/test/fix_icl_after_thread_/fix_icl_after_thread.cpp	2011-02-27 16:50:41 EST (Sun, 27 Feb 2011)
@@ -9,7 +9,10 @@
 #include <libs/icl/test/disable_test_warnings.hpp>
 #include "../unit_test_unwarned.hpp"
 
-#include <boost/thread.hpp>
+// #include <boost/thread.hpp> MEMO: The problem occured when using thread.hpp
+#include <boost/bind.hpp>    // but is also triggered from bind.hpp alone
+    // while the cause of it is an error in the msvc-7.1 to 10.0 compilers.
+    // A minimal example is provided by test case 'cmp_msvc_value_born_error'
 #include <boost/icl/interval_map.hpp>
 #include <boost/icl/split_interval_map.hpp>
 #include <boost/icl/separate_interval_set.hpp>
Modified: trunk/libs/icl/test/fix_include_after_thread_/fix_include_after_thread.cpp
==============================================================================
--- trunk/libs/icl/test/fix_include_after_thread_/fix_include_after_thread.cpp	(original)
+++ trunk/libs/icl/test/fix_include_after_thread_/fix_include_after_thread.cpp	2011-02-27 16:50:41 EST (Sun, 27 Feb 2011)
@@ -5,6 +5,8 @@
       (See accompanying file LICENCE.txt or copy at
            http://www.boost.org/LICENSE_1_0.txt)
 +-----------------------------------------------------------------------------*/
+//JODO REMOVE THIS TESTCASE
+
 #define BOOST_TEST_MODULE icl::fix_include_after_thread unit test
 #include <boost/config.hpp>
 #include <boost/test/unit_test.hpp>
@@ -16,7 +18,12 @@
 //like some_attribute<Type>::value in parentheses
 //  ->(some_attribute<Type>::value)
 //The problem does not occur for gcc compilers.
-#include <boost/thread.hpp>
+
+// #include <boost/thread.hpp> MEMO: The problem occured when using thread.hpp
+#include <boost/bind.hpp>    // but is also triggered from bind.hpp alone
+    // while the cause of it is an error in the msvc-7.1 to 10.0 compilers.
+    // A minimal example is provided by test case 'cmp_msvc_value_born_error'
+
 //--- included code ---------------------------------------
 template <class Type> struct some_attribute
 { 
@@ -26,8 +33,8 @@
 template <class Type> struct some_predicate
 { 
     BOOST_STATIC_CONSTANT(bool, 
-    //  value = ((some_attribute<Type>::value) < 0) 
-        value = ( some_attribute<Type>::value  < 0) 
+        value = ((some_attribute<Type>::value) < 0) 
+    //  value = ( some_attribute<Type>::value  < 0) 
                 //error C2059: syntax error : ')' ONLY
                 //IF <boost/thread.hpp> is included before
         ); 
Modified: trunk/libs/icl/test/test_casual_/test_casual.cpp
==============================================================================
--- trunk/libs/icl/test/test_casual_/test_casual.cpp	(original)
+++ trunk/libs/icl/test/test_casual_/test_casual.cpp	2011-02-27 16:50:41 EST (Sun, 27 Feb 2011)
@@ -7,12 +7,14 @@
 +-----------------------------------------------------------------------------*/
 #define BOOST_TEST_MODULE icl::casual unit test
 #include <libs/icl/test/disable_test_warnings.hpp>
+
 #include <string>
 #include <vector>
 #include <boost/mpl/list.hpp>
 #include "../unit_test_unwarned.hpp"
 #include <boost/test/test_case_template.hpp>
 
+
 // interval instance types
 #include "../test_type_lists.hpp"
 #include "../test_value_maker.hpp"
@@ -22,6 +24,7 @@
 #include <boost/icl/gregorian.hpp>
 #include <boost/icl/ptime.hpp>
 
+#define BOOST_ICL_USE_STATIC_BOUNDED_INTERVALS
 #include <boost/icl/interval_map.hpp>
 #include <boost/icl/interval_set.hpp>
 #include <boost/icl/interval.hpp>
@@ -32,27 +35,6 @@
 using namespace boost::icl;
 
 
-BOOST_AUTO_TEST_CASE(float_infinity)
-{
-
-    typedef size_type_of<interval<float>::type>::type itv_float_size_type;
-
-    BOOST_CHECK( (boost::is_same<size_type_of<interval<float>::type>::type, std::size_t>::value) );
-    BOOST_CHECK( (boost::is_same<itv_float_size_type, std::size_t>::value) );
-    BOOST_CHECK( (boost::is_same<itv_float_size_type, unsigned int>::value) );
-
-    cout << cardinality(interval<float>::closed(1,5))  << endl;
-    cout << icl::infinity<size_type_of<interval<float>::type>::type>::value() << endl;
-    //cout << (std::size_t)(icl::infinity<itv_float_size_type>::value) << endl;
-    cout << (std::numeric_limits<unsigned int>::max)() << endl;
-
-    BOOST_CHECK_EQUAL(
-      cardinality(interval<float>::closed(1,5))
-    , icl::infinity<itv_float_size_type>::value()
-    );
-
-    BOOST_CHECK_EQUAL(true, true);
-}
 
 BOOST_AUTO_TEST_CASE(ticket_5207)
 {
@@ -78,6 +60,53 @@
     icl::intersects( int_map, int_element );
 }
 
+BOOST_AUTO_TEST_CASE(generalized_find)
+{
+  typedef icl::interval_set<int>::const_iterator int_set_iterator;
+  icl::interval_set<int> int_set;
+
+  icl::interval<int>::type to_be_found(1,5);
+  int_set += icl::interval<int>::type(0,2);
+  int_set += icl::interval<int>::type(4,7);
+  int_set += icl::interval<int>::type(8,9);
+
+  int_set_iterator found;
+  found = int_set.lower_bound(to_be_found); 
+  cout << *found << endl; // [0,2)
+  found = int_set.find(to_be_found); 
+  cout << *found << endl; // [0,2)
+  found = int_set.upper_bound(to_be_found); 
+  cout << *found << endl; // [8,9)
+  std::pair<int_set_iterator,int_set_iterator> exterior;
+  exterior = int_set.equal_range(to_be_found); 
+  cout << "[" << *exterior.first 
+    << "," << *exterior.second << ")" << endl;
+  // [[0,2),[8,9))
+}
+
+BOOST_AUTO_TEST_CASE(using_vaious_interval_types)
+{
+  interval_set<int, std::less, discrete_interval<int,std::less> > dyn_int_set;
+  interval_set<int, std::less, right_open_interval<int,std::less> > stat_int_set;
+  interval_set<float, std::less, continuous_interval<float,std::less> > dyn_float_set;
+
+  dyn_int_set += discrete_interval<int>(1);
+  BOOST_CHECK(( contains(dyn_int_set,1) ));
+
+  stat_int_set += right_open_interval<int>(1);
+  BOOST_CHECK(( contains(stat_int_set,1) ));
+
+  dyn_float_set += continuous_interval<float>(1.0);
+  BOOST_CHECK(( contains(dyn_float_set, 1.0) ));
+}
+
+    template <class IncrementableT>
+    inline static IncrementableT succ_(IncrementableT x) { return ++x; }
+
+    template <class DecrementableT>
+    inline static DecrementableT pred_(DecrementableT x) { return --x; }
+
+
 BOOST_AUTO_TEST_CASE(casual)
 {
     //typedef int T;
@@ -86,6 +115,47 @@
     //typedef interval_set<T>                   IntervalSetT;
     //typedef IntervalMapT::interval_type       IntervalT;
 
+	int i;
+	int j = int();
+	chrono::duration<int> cd1 = chrono::duration<int>();
+	chrono::duration<int> cd2(0);
+	chrono::duration<int> dur1(0);
+	chrono::duration<int> dur2, dur3, dur4;
+	dur2 = dur3 = dur4 = dur1;
+	int itg1(0);
+	int itg2, itg3, itg4;
+	itg2 = itg3 = itg4 = itg1;
+
+	cout << "uninitialized       i = " << i << endl;
+	cout << "default constructed j = " << j << endl;
+	cout << (cd1==cd2 ? "eq" : "!eq") << endl;
+	cout << "chrono::duration cd1()  = " << cd1 << endl;
+	cout << "chrono::duration cd2(0) = " << cd2 << endl;
+
+	(dur2++)--;
+	(dur3--)++;
+	dur4++;
+	dur4--;
+	cout << dur1 << ", " << dur2 << ", " << dur3 << ", " << dur4 << endl;
+	//---------
+	dur2 = dur3 = dur4 = dur1;
+	cout << icl::pred(icl::succ(dur2)) << endl;
+	//---------
+	//(itg2++)--;
+	//(itg3--)++;
+	//itg4++;
+	//itg4--;
+	//cout << itg1 << ", " << itg2 << ", " << itg3 << ", " << itg4 << endl;
+
+
+	dur2 = dur3 = dur4 = dur1;
+	--(++dur2);
+	++(--dur3);
+	--dur4;
+	++dur4;
+	cout << dur1 << ", " << dur2 << ", " << dur3 << ", " << dur4 << endl;
+
+
     BOOST_CHECK_EQUAL(true, true);
 }
 
Modified: trunk/libs/icl/test/test_icl_dynamic_interval.hpp
==============================================================================
--- trunk/libs/icl/test/test_icl_dynamic_interval.hpp	(original)
+++ trunk/libs/icl/test/test_icl_dynamic_interval.hpp	2011-02-27 16:50:41 EST (Sun, 27 Feb 2011)
@@ -28,7 +28,7 @@
 {
     typedef typename icl::interval<T>::type IntervalT;
 
-    BOOST_CHECK_EQUAL( T(), icl::pred(icl::succ(T())));
+    // BOOST_CHECK_EQUAL( T(), icl::pred(icl::succ(T())));
     BOOST_CHECK_EQUAL( icl::identity_element<T>::value(), icl::pred(icl::succ(icl::identity_element<T>::value())) );
     BOOST_CHECK_EQUAL( icl::unit_element<T>::value(),     icl::succ(icl::identity_element<T>::value())        );
     BOOST_CHECK_EQUAL( length(IntervalT()), icl::identity_element<typename difference_type_of<T>::type>::value() );
Modified: trunk/libs/icl/test/test_type_lists.hpp
==============================================================================
--- trunk/libs/icl/test/test_type_lists.hpp	(original)
+++ trunk/libs/icl/test/test_type_lists.hpp	2011-02-27 16:50:41 EST (Sun, 27 Feb 2011)
@@ -9,6 +9,7 @@
 #define BOOST_ICL_TEST_TYPE_LISTS_HPP_JOFA_080916
 
 //#define BOOST_ICL_TEST_XINT
+//#define BOOST_ICL_TEST_CHRONO
 
 #include <boost/mpl/list.hpp>
 
@@ -20,6 +21,11 @@
 #include <boost/icl/xint.hpp>
 #endif
 
+#ifdef BOOST_ICL_TEST_CHRONO
+//JODO not working: #define BOOST_CHRONO_INLINED
+#include <boost/icl/chrono.hpp>
+#endif
+
 #include <boost/icl/rational.hpp> 
 
 
@@ -31,10 +37,8 @@
 #else
 typedef boost::posix_time::ptime         boost_posix_time_ptime;
 typedef boost::posix_time::time_duration boost_posix_time_duration;
-typedef int                              boost_gregorian_date; 
-typedef int                              boost_gregorian_date_duration;
-//typedef boost::gregorian::date           boost_gregorian_date; //JODO URG REV
-//typedef boost::gregorian::date_duration  boost_gregorian_date_duration;
+typedef boost::gregorian::date           boost_gregorian_date;
+typedef boost::gregorian::date_duration  boost_gregorian_date_duration;
 #endif
 
 typedef ::boost::mpl::list<
@@ -46,6 +50,10 @@
     ,boost::xint::integer
     ,boost::rational<boost::xint::integer>
 #endif
+#ifdef BOOST_ICL_TEST_CHRONO
+	,boost::chrono::duration<int>
+	,boost::chrono::duration<double>
+#endif
     ,boost_posix_time_ptime
     ,boost_posix_time_duration
     ,boost_gregorian_date
@@ -71,6 +79,10 @@
     ,boost::xint::integer
     ,boost::rational<boost::xint::integer>
 #endif
+#ifdef BOOST_ICL_TEST_CHRONO
+	,boost::chrono::duration<int>
+	,boost::chrono::duration<float>
+#endif
 > signed_bicremental_types;
 
 typedef          int             signed_bicremental_type_1;
@@ -90,6 +102,9 @@
 #ifdef BOOST_ICL_TEST_XINT
     ,boost::rational<boost::xint::integer>
 #endif
+#ifdef BOOST_ICL_TEST_CHRONO
+	,boost::chrono::duration<double>
+#endif
 > bicremental_continuous_types;
 
 typedef float                bicremental_continuous_type_1;
@@ -118,6 +133,9 @@
 #ifdef BOOST_ICL_TEST_XINT
     ,boost::xint::integer
 #endif
+#ifdef BOOST_ICL_TEST_CHRONO
+	,boost::chrono::duration<unsigned short>
+#endif
     ,boost_posix_time_ptime
     ,boost_posix_time_ptime
     ,boost_posix_time_duration
@@ -146,6 +164,9 @@
 #ifdef BOOST_ICL_TEST_XINT
     ,boost::rational<boost::xint::integer>
 #endif
+#ifdef BOOST_ICL_TEST_CHRONO
+	,boost::chrono::duration<long double>
+#endif
 > numeric_continuous_types;
 
 typedef double               numeric_continuous_type_1;
@@ -159,6 +180,9 @@
 #ifdef BOOST_ICL_TEST_XINT
     ,boost::rational<boost::xint::integer>
 #endif
+#ifdef BOOST_ICL_TEST_CHRONO
+	,boost::chrono::duration<double>
+#endif
     ,std::string
 > continuous_types;
 
@@ -176,12 +200,16 @@
 #ifdef BOOST_ICL_TEST_XINT
     ,boost::xint::integer
 #endif
-    ,std::string
+#ifdef BOOST_ICL_TEST_CHRONO
+	,boost::chrono::duration<short>
+	,boost::chrono::duration<long double>
+#endif
     ,boost_posix_time_ptime
     ,boost_posix_time_duration
     ,boost_gregorian_date
     ,boost_gregorian_date_duration
     ,int*
+    ,std::string
 > ordered_types;
 
 typedef int                      ordered_type_1;