Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r51638 - trunk/libs/signals2/test
From: fmhess_at_[hidden]
Date: 2009-03-07 09:42:57


Author: fmhess
Date: 2009-03-07 09:42:57 EST (Sat, 07 Mar 2009)
New Revision: 51638
URL: http://svn.boost.org/trac/boost/changeset/51638

Log:
Trying to work around msvc 7.1 bugs in some tests.

Text files modified:
   trunk/libs/signals2/test/signal_n_test.cpp | 14 ++++++++++----
   trunk/libs/signals2/test/signal_test.cpp | 14 ++++++++++----
   2 files changed, 20 insertions(+), 8 deletions(-)

Modified: trunk/libs/signals2/test/signal_n_test.cpp
==============================================================================
--- trunk/libs/signals2/test/signal_n_test.cpp (original)
+++ trunk/libs/signals2/test/signal_n_test.cpp 2009-03-07 09:42:57 EST (Sat, 07 Mar 2009)
@@ -243,7 +243,9 @@
     typedef boost::signals2::signal1<ResultType, int> signal_type;
     typedef typename signal_type::extended_slot_type slot_type;
     signal_type sig;
- slot_type myslot(&disconnecting_slot<ResultType>);
+ // attempting to work around msvc 7.1 bug by explicitly assigning to a function pointer
+ ResultType (*fp)(const boost::signals2::connection &conn, int) = &disconnecting_slot<ResultType>;
+ slot_type myslot(fp);
     sig.connect_extended(myslot);
     BOOST_CHECK(sig.num_slots() == 1);
     sig(0);
@@ -253,7 +255,9 @@
     typedef boost::signals2::signal0<ResultType> signal_type;
     typedef typename signal_type::extended_slot_type slot_type;
     signal_type sig;
- slot_type myslot(&disconnecting_slot<ResultType>, _1, 0);
+ // attempting to work around msvc 7.1 bug by explicitly assigning to a function pointer
+ ResultType (*fp)(const boost::signals2::connection &conn, int) = &disconnecting_slot<ResultType>;
+ slot_type myslot(fp, _1, 0);
     sig.connect_extended(myslot);
     BOOST_CHECK(sig.num_slots() == 1);
     sig();
@@ -264,10 +268,12 @@
     typedef boost::signals2::signal1<ResultType, int> signal_type;
     typedef typename signal_type::extended_slot_type slot_type;
     signal_type sig;
- slot_type myslot(&disconnecting_slot<ResultType>);
+ // attempting to work around msvc 7.1 bug by explicitly assigning to a function pointer
+ ResultType (*fp)(const boost::signals2::connection &conn, int) = &disconnecting_slot<ResultType>;
+ slot_type myslot(fp);
     sig.connect_extended(myslot);
     BOOST_CHECK(sig.num_slots() == 1);
- sig.disconnect(&disconnecting_slot<ResultType>);
+ sig.disconnect(fp);
     BOOST_CHECK(sig.num_slots() == 0);
   }
 }

Modified: trunk/libs/signals2/test/signal_test.cpp
==============================================================================
--- trunk/libs/signals2/test/signal_test.cpp (original)
+++ trunk/libs/signals2/test/signal_test.cpp 2009-03-07 09:42:57 EST (Sat, 07 Mar 2009)
@@ -180,7 +180,9 @@
     typedef boost::signals2::signal<ResultType (int)> signal_type;
     typedef typename signal_type::extended_slot_type slot_type;
     signal_type sig;
- slot_type myslot(&disconnecting_slot<ResultType>);
+ // attempting to work around msvc 7.1 bug by explicitly assigning to a function pointer
+ ResultType (*fp)(const boost::signals2::connection &conn, int) = &disconnecting_slot<ResultType>;
+ slot_type myslot(fp);
     sig.connect_extended(myslot);
     BOOST_CHECK(sig.num_slots() == 1);
     sig(0);
@@ -190,7 +192,9 @@
     typedef boost::signals2::signal<ResultType ()> signal_type;
     typedef typename signal_type::extended_slot_type slot_type;
     signal_type sig;
- slot_type myslot(&disconnecting_slot<ResultType>, _1, 0);
+ // attempting to work around msvc 7.1 bug by explicitly assigning to a function pointer
+ ResultType (*fp)(const boost::signals2::connection &conn, int) = &disconnecting_slot<ResultType>;
+ slot_type myslot(fp, _1, 0);
     sig.connect_extended(myslot);
     BOOST_CHECK(sig.num_slots() == 1);
     sig();
@@ -201,10 +205,12 @@
     typedef boost::signals2::signal<ResultType (int)> signal_type;
     typedef typename signal_type::extended_slot_type slot_type;
     signal_type sig;
- slot_type myslot(&disconnecting_slot<ResultType>);
+ // attempting to work around msvc 7.1 bug by explicitly assigning to a function pointer
+ ResultType (*fp)(const boost::signals2::connection &conn, int) = &disconnecting_slot<ResultType>;
+ slot_type myslot(fp);
     sig.connect_extended(myslot);
     BOOST_CHECK(sig.num_slots() == 1);
- sig.disconnect(&disconnecting_slot<ResultType>);
+ sig.disconnect(fp);
     BOOST_CHECK(sig.num_slots() == 0);
   }
 }


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