|
Boost : |
From: Nicola Musatti (Nicola.Musatti_at_[hidden])
Date: 2006-05-03 03:44:33
Hallo, Doug.
The attached patch for signal_test.cpp enables the alternative syntax
for the Borland compilers as they still do not support the standard one.
I realize that this in itself could be considered a reason for the test
to fail. What do you think? Maybe this patch could be applied to the
RC_1_34_0 branch only and not to head.
In any case I'll wait for your approval before applying it.
Cheers,
Nicola Musatti
******Index: signal_test.cpp
===================================================================
RCS file: /cvsroot/boost/boost/libs/signals/test/signal_test.cpp,v
retrieving revision 1.9
diff -d -u -r1.9 signal_test.cpp
--- signal_test.cpp 3 Feb 2005 13:35:20 -0000 1.9
+++ signal_test.cpp 2 May 2006 21:34:59 -0000
@@ -9,6 +9,7 @@
#include <boost/test/minimal.hpp>
#include <boost/signal.hpp>
+#include <boost/detail/workaround.hpp>
#include <functional>
#include <iostream>
@@ -59,8 +60,11 @@
make_int i62(62, 61);
{
+#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582))
+ boost::signal0<int, max_or_default<int> > s0;
+#else
boost::signal<int (), max_or_default<int> > s0;
-
+#endif
std::cout << "sizeof(signal) = " << sizeof(s0) << std::endl;
boost::BOOST_SIGNALS_NAMESPACE::connection c2 = s0.connect(i2);
boost::BOOST_SIGNALS_NAMESPACE::connection c72 = s0.connect(72, i72);
@@ -94,13 +98,21 @@
}
{
+#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582))
+ boost::signal0<int, max_or_default<int> > s0;
+#else
boost::signal<int (), max_or_default<int> > s0;
+#endif
boost::BOOST_SIGNALS_NAMESPACE::connection c2 = s0.connect(i2);
boost::BOOST_SIGNALS_NAMESPACE::connection c72 = s0.connect(i72);
boost::BOOST_SIGNALS_NAMESPACE::connection c62 = s0.connect(i62);
boost::BOOST_SIGNALS_NAMESPACE::connection c42 = s0.connect(i42);
+#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582))
+ const boost::signal0<int, max_or_default<int> >& cs0 = s0;
+#else
const boost::signal<int (), max_or_default<int> >& cs0 = s0;
+#endif
BOOST_CHECK(cs0() == 72);
}
@@ -108,7 +120,11 @@
make_increasing_int<7> i7;
make_increasing_int<10> i10;
+#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582))
+ boost::signal0<int, max_or_default<int> > s0;
+#else
boost::signal<int (), max_or_default<int> > s0;
+#endif
boost::BOOST_SIGNALS_NAMESPACE::connection c7 = s0.connect(i7);
boost::BOOST_SIGNALS_NAMESPACE::connection c10 = s0.connect(i10);
@@ -120,7 +136,11 @@
static void
test_one_arg()
{
+#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582))
+ boost::signal1<int, int, max_or_default<int> > s1;
+#else
boost::signal<int (int value), max_or_default<int> > s1;
+#endif
s1.connect(std::negate<int>());
s1.connect(std::bind1st(std::multiplies<int>(), 2));
@@ -132,14 +152,22 @@
static void
test_signal_signal_connect()
{
+#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582))
+ boost::signal1<int, int, max_or_default<int> > s1;
+#else
boost::signal<int (int value), max_or_default<int> > s1;
+#endif
s1.connect(std::negate<int>());
BOOST_CHECK(s1(3) == -3);
{
+#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT(0x582))
+ boost::signal1<int, int, max_or_default<int> > s2;
+#else
boost::signal<int (int value), max_or_default<int> > s2;
+#endif
s1.connect(s2);
s2.connect(std::bind1st(std::multiplies<int>(), 2));
s2.connect(std::bind1st(std::multiplies<int>(), -3));
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk