Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r71894 - in sandbox/property: boost/property libs/property/test
From: eldiener_at_[hidden]
Date: 2011-05-12 11:17:04


Author: eldiener
Date: 2011-05-12 11:17:02 EDT (Thu, 12 May 2011)
New Revision: 71894
URL: http://svn.boost.org/trac/boost/changeset/71894

Log:
Updated tests.
Added:
   sandbox/property/boost/property/property_notification_boost_function.hpp (contents, props changed)
   sandbox/property/boost/property/property_notification_boost_signal2.hpp (contents, props changed)
   sandbox/property/libs/property/test/test_auto_predicate.hpp (contents, props changed)
Text files modified:
   sandbox/property/boost/property/property_auto_value.hpp | 12 +++++-----
   sandbox/property/boost/property/property_data_value.hpp | 14 ++++++-----
   sandbox/property/boost/property/property_member_data_value.hpp | 16 ++++++------
   sandbox/property/boost/property/property_predicate_failure_runtime_exception.hpp | 2
   sandbox/property/libs/property/test/Jamfile.v2 | 12 +++------
   sandbox/property/libs/property/test/test_auto_predicate_character.cpp | 2
   sandbox/property/libs/property/test/test_auto_predicate_enum.cpp | 2
   sandbox/property/libs/property/test/test_auto_predicate_floating_point.cpp | 2
   sandbox/property/libs/property/test/test_auto_predicate_integer.cpp | 2
   sandbox/property/libs/property/test/test_auto_value.hpp | 48 ++++++++++++++++++++--------------------
   10 files changed, 55 insertions(+), 57 deletions(-)

Modified: sandbox/property/boost/property/property_auto_value.hpp
==============================================================================
--- sandbox/property/boost/property/property_auto_value.hpp (original)
+++ sandbox/property/boost/property/property_auto_value.hpp 2011-05-12 11:17:02 EDT (Thu, 12 May 2011)
@@ -35,6 +35,10 @@
     public virtual i_property_read<T>
   {
   
+ protected:
+
+ boost::initialized<T> data;
+
     public:
 
     prop_auto()
@@ -62,10 +66,6 @@
       return(boost::get(data));
       }
     
- protected:
-
- boost::initialized<T> data;
-
     private:
     
     prop_auto & operator = (const prop_auto & arg);
@@ -118,7 +118,7 @@
       
     void set(T arg)
       {
- boost::get((static_cast<prop_auto<T,default_policy_tag,read_tag> &>(*this)).data) = arg;
+ boost::get(prop_auto<T,default_policy_tag,read_tag>::data) = arg;
       }
     
   };
@@ -173,7 +173,7 @@
       
       T t(*this);
       
- boost::get((static_cast<prop_auto<T,default_policy_tag,read_tag> &>(*this)).data) = arg;
+ boost::get(prop_auto<T,default_policy_tag,read_tag>::data) = arg;
       property_changed(*this,boost::optional<T>(t),arg);
       }
     

Modified: sandbox/property/boost/property/property_data_value.hpp
==============================================================================
--- sandbox/property/boost/property/property_data_value.hpp (original)
+++ sandbox/property/boost/property/property_data_value.hpp 2011-05-12 11:17:02 EDT (Thu, 12 May 2011)
@@ -103,6 +103,12 @@
     NotificationPolicy<T>
   {
   
+ protected:
+
+ boost::optional<T> oldT;
+
+ public:
+
     prop_data()
       {
       }
@@ -137,10 +143,6 @@
       property_changed(*this,oldT,arg);
       }
       
- protected:
-
- boost::optional<T> oldT;
-
     private:
     
     prop_data & operator = (const prop_data &);
@@ -230,7 +232,7 @@
       
     prop_data & operator = (T arg)
       {
- (static_cast<prop_data<T,d,NotificationPolicy,write_tag> & >(*this)).oldT = *this;
+ prop_data<T,d,NotificationPolicy,write_tag>::oldT = *this;
       (static_cast<prop_data<T,d,NotificationPolicy,write_tag> & >(*this)) = arg;
       return(*this);
       }
@@ -238,7 +240,7 @@
     template<class U>
     prop_data & operator = (U arg)
       {
- (static_cast<prop_data<T,d,NotificationPolicy,write_tag> & >(*this)).oldT = *this;
+ prop_data<T,d,NotificationPolicy,write_tag>::oldT = *this;
       (static_cast<prop_data<T,d,NotificationPolicy,write_tag> & >(*this)) = arg;
       return(*this);
       }

Modified: sandbox/property/boost/property/property_member_data_value.hpp
==============================================================================
--- sandbox/property/boost/property/property_member_data_value.hpp (original)
+++ sandbox/property/boost/property/property_member_data_value.hpp 2011-05-12 11:17:02 EDT (Thu, 12 May 2011)
@@ -115,6 +115,12 @@
     public virtual i_property_write<T>,
     public NotificationPolicy<T>
   {
+ protected:
+
+ boost::optional<T> oldT;
+
+ prop_member_data & operator = (const prop_member_data &);
+
     public:
     
     explicit prop_member_data(C & c) :
@@ -158,12 +164,6 @@
     
     C & cf;
     
- protected:
-
- boost::optional<T> oldT;
-
- prop_member_data & operator = (const prop_member_data &);
-
   };
 
   template <class T, class C, T C::*d>
@@ -259,7 +259,7 @@
       
     prop_member_data & operator = (T arg)
       {
- (static_cast<prop_member_data<T,C,d,NotificationPolicy,write_tag> &>(*this)).oldT = *this;
+ prop_member_data<T,C,d,NotificationPolicy,write_tag>::oldT = *this;
       (static_cast<prop_member_data<T,C,d,NotificationPolicy,write_tag> &>(*this)) = arg;
       return(*this);
       }
@@ -267,7 +267,7 @@
     template<class U>
     prop_member_data & operator = (U arg)
       {
- (static_cast<prop_member_data<T,C,d,NotificationPolicy,write_tag> &>(*this)).oldT = *this;
+ prop_member_data<T,C,d,NotificationPolicy,write_tag>::oldT = *this;
       (static_cast<prop_member_data<T,C,d,NotificationPolicy,write_tag> &>(*this)) = arg;
       return(*this);
       }

Added: sandbox/property/boost/property/property_notification_boost_function.hpp
==============================================================================
--- (empty file)
+++ sandbox/property/boost/property/property_notification_boost_function.hpp 2011-05-12 11:17:02 EDT (Thu, 12 May 2011)
@@ -0,0 +1,29 @@
+#if !defined(PROPERTY_NOTIFICATION_BOOST_FUNCTION_HPP)
+#define PROPERTY_NOTIFICATION_BOOST_FUNCTION_HPP
+
+#include <boost/function.hpp>
+#include <boost/optional.hpp>
+#include "property_interface.hpp"
+
+namespace properties
+{
+
+ template <class T> class notification_boost_function
+ {
+
+ public:
+
+ boost::function<void (const i_property_write<T> &,boost::optional<T>,T)> fun;
+
+ protected:
+
+ void property_changed(const i_property_write<T> & signaller,boost::optional<T> oldValue,T newValue)
+ {
+ fun(signaller,oldValue,newValue);
+ }
+
+ };
+
+}
+
+#endif

Added: sandbox/property/boost/property/property_notification_boost_signal2.hpp
==============================================================================
--- (empty file)
+++ sandbox/property/boost/property/property_notification_boost_signal2.hpp 2011-05-12 11:17:02 EDT (Thu, 12 May 2011)
@@ -0,0 +1,29 @@
+#if !defined(PROPERTY_NOTIFICATION_BOOST_SIGNAL2_HPP)
+#define PROPERTY_NOTIFICATION_BOOST_SIGNAL2_HPP
+
+#include <boost/signals2/signal.hpp>
+#include <boost/optional.hpp>
+#include "property_interface.hpp"
+
+namespace properties
+{
+
+ template <class T> class notification_boost_signal2
+ {
+
+ public:
+
+ boost::signals2::signal<void (const i_property_write<T> &,boost::optional<T>,T)> sig;
+
+ protected:
+
+ void property_changed(const i_property_write<T> & signaller,boost::optional<T> oldValue,T newValue)
+ {
+ sig(signaller,oldValue,newValue);
+ }
+
+ };
+
+}
+
+#endif

Modified: sandbox/property/boost/property/property_predicate_failure_runtime_exception.hpp
==============================================================================
--- sandbox/property/boost/property/property_predicate_failure_runtime_exception.hpp (original)
+++ sandbox/property/boost/property/property_predicate_failure_runtime_exception.hpp 2011-05-12 11:17:02 EDT (Thu, 12 May 2011)
@@ -15,7 +15,7 @@
     
     protected:
       
- void PredicateFailure(const i_property_write<T> & prop,const boost::function<bool (T)> & f,boost::optional<T> oldValue,T newValue)
+ void PredicateFailure(const i_property_write<T> & ,const boost::function<bool (T)> & ,boost::optional<T> ,T newValue)
       {
       
       std::ostringstream oss;

Modified: sandbox/property/libs/property/test/Jamfile.v2
==============================================================================
--- sandbox/property/libs/property/test/Jamfile.v2 (original)
+++ sandbox/property/libs/property/test/Jamfile.v2 2011-05-12 11:17:02 EDT (Thu, 12 May 2011)
@@ -7,16 +7,12 @@
 import testing ;
 
 project property_tests : requirements <warnings>on
- <toolset>gcc-4.3.0:<warnings>all
-# <toolset>gcc-4.3.0:<cxxflags>-Wno-variadic-macros
- <toolset>gcc-4.4.0:<warnings>all
-# <toolset>gcc-4.4.0:<cxxflags>-Wno-variadic-macros
- <toolset>gcc-4.5.0:<warnings>all
-# <toolset>gcc-4.5.0:<cxxflags>-Wno-variadic-macros
+ <toolset>gcc:<warnings>all
                                       <toolset>gcc-4.5.0:<linkflags>"-Wl,--enable-auto-import"
- <toolset>gcc-4.5.2:<warnings>all
-# <toolset>gcc-4.5.2:<cxxflags>-Wno-variadic-macros
                                       <toolset>msvc:<warnings>all
+ <toolset>msvc:<cxxflags>"-wd4512"
+ <toolset>msvc-9.0:<define>"_SCL_SECURE_NO_WARNINGS"
+ <toolset>msvc-10.0:<define>"_SCL_SECURE_NO_WARNINGS"
                                       ;
 
 test-suite property

Added: sandbox/property/libs/property/test/test_auto_predicate.hpp
==============================================================================
--- (empty file)
+++ sandbox/property/libs/property/test/test_auto_predicate.hpp 2011-05-12 11:17:02 EDT (Thu, 12 May 2011)
@@ -0,0 +1,75 @@
+#if !defined(TEST_AUTO_PREDICATE_HPP)
+#define TEST_AUTO_PREDICATE_HPP
+
+#include "test_enum.hpp"
+#include <boost/property/property_auto_predicate.hpp>
+#include <boost/property/property_notification_boost_function.hpp>
+#include <boost/property/property_predicate_failure_runtime_exception.hpp>
+
+using namespace properties;
+
+extern prop_auto_predicate<char> p_gl_char_pred;
+extern prop_auto_predicate<int> p_gl_int_pred;
+extern prop_auto_predicate<double> p_gl_double_pred;
+extern prop_auto_predicate<test_enum> p_gl_enum_pred;
+
+extern prop_auto_predicate<char,notification_boost_function> p_gl_char_pred_ntf;
+extern prop_auto_predicate<int,notification_boost_function> p_gl_int_pred_ntf;
+extern prop_auto_predicate<double,notification_boost_function> p_gl_double_pred_ntf;
+extern prop_auto_predicate<test_enum,notification_boost_function> p_gl_enum_pred_ntf;
+
+extern prop_auto_predicate<char,default_policy_tag,predicate_failure_runtime_exception> p_gl_char_pred_err;
+extern prop_auto_predicate<int,default_policy_tag,predicate_failure_runtime_exception> p_gl_int_pred_err;
+extern prop_auto_predicate<double,default_policy_tag,predicate_failure_runtime_exception> p_gl_double_pred_err;
+extern prop_auto_predicate<test_enum,default_policy_tag,predicate_failure_runtime_exception> p_gl_enum_pred_err;
+
+extern prop_auto_predicate<char,notification_boost_function,predicate_failure_runtime_exception> p_gl_char_pred_ntf_err;
+extern prop_auto_predicate<int,notification_boost_function,predicate_failure_runtime_exception> p_gl_int_pred_ntf_err;
+extern prop_auto_predicate<double,notification_boost_function,predicate_failure_runtime_exception> p_gl_double_pred_ntf_err;
+extern prop_auto_predicate<test_enum,notification_boost_function,predicate_failure_runtime_exception> p_gl_enum_pred_ntf_err;
+
+class p_auto_class
+ {
+
+ public:
+
+ p_auto_class();
+
+ prop_auto_predicate<char> p_char_pred;
+ prop_auto_predicate<int> p_int_pred;
+ prop_auto_predicate<double> p_double_pred;
+ prop_auto_predicate<test_enum> p_enum_pred;
+
+ prop_auto_predicate<char,notification_boost_function> p_char_pred_ntf;
+ prop_auto_predicate<int,notification_boost_function> p_int_pred_ntf;
+ prop_auto_predicate<double,notification_boost_function> p_double_pred_ntf;
+ prop_auto_predicate<test_enum,notification_boost_function> p_enum_pred_ntf;
+
+ prop_auto_predicate<char,default_policy_tag,predicate_failure_runtime_exception> p_char_pred_err;
+ prop_auto_predicate<int,default_policy_tag,predicate_failure_runtime_exception> p_int_pred_err;
+ prop_auto_predicate<double,default_policy_tag,predicate_failure_runtime_exception> p_double_pred_err;
+ prop_auto_predicate<test_enum,default_policy_tag,predicate_failure_runtime_exception> p_enum_pred_err;
+
+ prop_auto_predicate<char,notification_boost_function,predicate_failure_runtime_exception> p_char_pred_ntf_err;
+ prop_auto_predicate<int,notification_boost_function,predicate_failure_runtime_exception> p_int_pred_ntf_err;
+ prop_auto_predicate<double,notification_boost_function,predicate_failure_runtime_exception> p_double_pred_ntf_err;
+ prop_auto_predicate<test_enum,notification_boost_function,predicate_failure_runtime_exception> p_enum_pred_ntf_err;
+
+ static prop_auto_predicate<char,notification_boost_function> p_st_char_pred_ntf;
+ static prop_auto_predicate<int,notification_boost_function> p_st_int_pred_ntf;
+ static prop_auto_predicate<double,notification_boost_function> p_st_double_pred_ntf;
+ static prop_auto_predicate<test_enum,notification_boost_function> p_st_enum_pred_ntf;
+
+ static prop_auto_predicate<char,default_policy_tag,predicate_failure_runtime_exception> p_st_char_pred_err;
+ static prop_auto_predicate<int,default_policy_tag,predicate_failure_runtime_exception> p_st_int_pred_err;
+ static prop_auto_predicate<double,default_policy_tag,predicate_failure_runtime_exception> p_st_double_pred_err;
+ static prop_auto_predicate<test_enum,default_policy_tag,predicate_failure_runtime_exception> p_st_enum_pred_err;
+
+ static prop_auto_predicate<char,notification_boost_function,predicate_failure_runtime_exception> p_st_char_pred_ntf_err;
+ static prop_auto_predicate<int,notification_boost_function,predicate_failure_runtime_exception> p_st_int_pred_ntf_err;
+ static prop_auto_predicate<double,notification_boost_function,predicate_failure_runtime_exception> p_st_double_pred_ntf_err;
+ static prop_auto_predicate<test_enum,notification_boost_function,predicate_failure_runtime_exception> p_st_enum_pred_ntf_err;
+
+ };
+
+#endif

Modified: sandbox/property/libs/property/test/test_auto_predicate_character.cpp
==============================================================================
--- sandbox/property/libs/property/test/test_auto_predicate_character.cpp (original)
+++ sandbox/property/libs/property/test/test_auto_predicate_character.cpp 2011-05-12 11:17:02 EDT (Thu, 12 May 2011)
@@ -1,5 +1,5 @@
 #include <boost/detail/lightweight_test.hpp>
-#include <boost/property/property_auto_predicate.hpp>
+#include "test_auto_predicate.hpp"
 
 int main()
   {

Modified: sandbox/property/libs/property/test/test_auto_predicate_enum.cpp
==============================================================================
--- sandbox/property/libs/property/test/test_auto_predicate_enum.cpp (original)
+++ sandbox/property/libs/property/test/test_auto_predicate_enum.cpp 2011-05-12 11:17:02 EDT (Thu, 12 May 2011)
@@ -1,5 +1,5 @@
 #include <boost/detail/lightweight_test.hpp>
-#include <boost/property/property_auto_predicate.hpp>
+#include "test_auto_predicate.hpp"
 
 int main()
   {

Modified: sandbox/property/libs/property/test/test_auto_predicate_floating_point.cpp
==============================================================================
--- sandbox/property/libs/property/test/test_auto_predicate_floating_point.cpp (original)
+++ sandbox/property/libs/property/test/test_auto_predicate_floating_point.cpp 2011-05-12 11:17:02 EDT (Thu, 12 May 2011)
@@ -1,5 +1,5 @@
 #include <boost/detail/lightweight_test.hpp>
-#include <boost/property/property_auto_predicate.hpp>
+#include "test_auto_predicate.hpp"
 
 int main()
   {

Modified: sandbox/property/libs/property/test/test_auto_predicate_integer.cpp
==============================================================================
--- sandbox/property/libs/property/test/test_auto_predicate_integer.cpp (original)
+++ sandbox/property/libs/property/test/test_auto_predicate_integer.cpp 2011-05-12 11:17:02 EDT (Thu, 12 May 2011)
@@ -1,5 +1,5 @@
 #include <boost/detail/lightweight_test.hpp>
-#include <boost/property/property_auto_predicate.hpp>
+#include "test_auto_predicate.hpp"
 
 int main()
   {

Modified: sandbox/property/libs/property/test/test_auto_value.hpp
==============================================================================
--- sandbox/property/libs/property/test/test_auto_value.hpp (original)
+++ sandbox/property/libs/property/test/test_auto_value.hpp 2011-05-12 11:17:02 EDT (Thu, 12 May 2011)
@@ -5,7 +5,7 @@
 #include "test_pod.hpp"
 #include "test_global_data.hpp"
 #include <boost/property/property_auto_value.hpp>
-#include <boost/property/property_notification_boost_signal.hpp>
+#include <boost/property/property_notification_boost_function.hpp>
 
 using namespace properties;
 
@@ -25,20 +25,20 @@
 extern prop_auto<test_enum,default_policy_tag,read_tag> p_gl_enum_const;
 extern prop_auto<test_pod const> p_gl_class_const;
 
-extern prop_auto<char,notification_boost_signal> p_gl_char_ntf;
-extern prop_auto<int,notification_boost_signal> p_gl_int_ntf;
-extern prop_auto<double,notification_boost_signal> p_gl_double_ntf;
-extern prop_auto<bool,notification_boost_signal> p_gl_bool_ntf;
-extern prop_auto<int *,notification_boost_signal> p_gl_pointer_ntf;
-extern prop_auto<test_enum,notification_boost_signal> p_gl_enum_ntf;
-extern prop_auto<test_pod,notification_boost_signal> p_gl_class_ntf;
+extern prop_auto<char,notification_boost_function> p_gl_char_ntf;
+extern prop_auto<int,notification_boost_function> p_gl_int_ntf;
+extern prop_auto<double,notification_boost_function> p_gl_double_ntf;
+extern prop_auto<bool,notification_boost_function> p_gl_bool_ntf;
+extern prop_auto<int *,notification_boost_function> p_gl_pointer_ntf;
+extern prop_auto<test_enum,notification_boost_function> p_gl_enum_ntf;
+extern prop_auto<test_pod,notification_boost_function> p_gl_class_ntf;
 
-class PAuto_class
+class p_auto_class
   {
   
   public:
   
- PAuto_class();
+ p_auto_class();
   
   prop_auto<char> p_char;
   prop_auto<int> p_int;
@@ -56,13 +56,13 @@
   prop_auto<test_enum,default_policy_tag,read_tag> p_enum_const;
   prop_auto<test_pod const> p_class_const;
 
- prop_auto<char,notification_boost_signal> p_char_ntf;
- prop_auto<int,notification_boost_signal> p_int_ntf;
- prop_auto<double,notification_boost_signal> p_double_ntf;
- prop_auto<bool,notification_boost_signal> p_bool_ntf;
- prop_auto<int *,notification_boost_signal> p_pointer_ntf;
- prop_auto<test_enum,notification_boost_signal> p_enum_ntf;
- prop_auto<test_pod,notification_boost_signal> p_class_ntf;
+ prop_auto<char,notification_boost_function> p_char_ntf;
+ prop_auto<int,notification_boost_function> p_int_ntf;
+ prop_auto<double,notification_boost_function> p_double_ntf;
+ prop_auto<bool,notification_boost_function> p_bool_ntf;
+ prop_auto<int *,notification_boost_function> p_pointer_ntf;
+ prop_auto<test_enum,notification_boost_function> p_enum_ntf;
+ prop_auto<test_pod,notification_boost_function> p_class_ntf;
   
   static prop_auto<char> p_st_char;
   static prop_auto<int> p_st_int;
@@ -80,13 +80,13 @@
   static prop_auto<test_enum,default_policy_tag,read_tag> p_st_enum_const;
   static prop_auto<test_pod const> p_st_class_const;
 
- static prop_auto<char,notification_boost_signal> p_st_char_ntf;
- static prop_auto<int,notification_boost_signal> p_st_int_ntf;
- static prop_auto<double,notification_boost_signal> p_st_double_ntf;
- static prop_auto<bool,notification_boost_signal> p_st_bool_ntf;
- static prop_auto<int *,notification_boost_signal> p_st_pointer_ntf;
- static prop_auto<test_enum,notification_boost_signal> p_st_enum_ntf;
- static prop_auto<test_pod,notification_boost_signal> p_st_class_ntf;
+ static prop_auto<char,notification_boost_function> p_st_char_ntf;
+ static prop_auto<int,notification_boost_function> p_st_int_ntf;
+ static prop_auto<double,notification_boost_function> p_st_double_ntf;
+ static prop_auto<bool,notification_boost_function> p_st_bool_ntf;
+ static prop_auto<int *,notification_boost_function> p_st_pointer_ntf;
+ static prop_auto<test_enum,notification_boost_function> p_st_enum_ntf;
+ static prop_auto<test_pod,notification_boost_function> p_st_class_ntf;
   
   private:
   


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