Boost logo

Boost :

From: AlisdairM (alisdair.meredith_at_[hidden])
Date: 2006-11-19 04:22:31


A patch for the failing Borland tests for the JustSoftwareSolutions
test runner follows.

The patch is for the test, but I believe it is appropriate in this case:

  The problem only occurs when function inlining is available
  The problem comes from obscure use of is_same template as a function
argument
  The problem only occurs if this is the first/only use of that is_same
specialization
  There are additional factors required to trigger problem, such as use
of iostream vs C-based io

The problem only occurs when ALL of the above are true, and is
essentially a consquence of the test being stripped down to test
nothing but this specific test case. Most user programs are not
stripped down test cases, and will never hit the problem.

THe patch simply takes a typedef to the tested types, and then tests
that, so the test is not materially changed.

-- 
AlisdairM
cvs diff -u -wb -- test\integral_wrapper_test.hpp (in directory
E:\sourceforge\rc_1_34_0\boost\libs\mpl\)
Index: test/integral_wrapper_test.hpp
===================================================================
RCS file: /cvsroot/boost/boost/libs/mpl/test/integral_wrapper_test.hpp,v
retrieving revision 1.4
diff -u -w -b -r1.4 integral_wrapper_test.hpp
--- test/integral_wrapper_test.hpp	20 Feb 2006 15:45:07 -0000	1.4
+++ test/integral_wrapper_test.hpp	19 Nov 2006 08:58:14 -0000
@@ -28,6 +28,20 @@
     /**/
 #endif
 
+#if BOOST_WORKAROUND(__BORLANDC__, BOOST_TESTED_AT( 0x582) )
+#define INTEGRAL_WRAPPER_TEST(unused1, i, T) \
+    { \
+      typedef WRAPPER(T,i) borland_tested_type; \
+    { typedef is_same< borland_tested_type::value_type, T >
borland_test_type; \
+      MPL_ASSERT(( borland_test_type )); } \
+    { MPL_ASSERT(( is_same< borland_tested_type::type, WRAPPER(T,i) >
)); } \
+    { MPL_ASSERT(( is_same< next< borland_tested_type >::type,
WRAPPER(T,i+1) > )); } \
+    { MPL_ASSERT(( is_same< prior< borland_tested_type >::type,
WRAPPER(T,i-1) > )); } \
+    { MPL_ASSERT_RELATION( (borland_tested_type::value), ==, i ); } \
+    INTEGRAL_WRAPPER_RUNTIME_TEST(i, T) \
+    } \
+/**/
+#else
 #define INTEGRAL_WRAPPER_TEST(unused1, i, T) \
     { MPL_ASSERT(( is_same< WRAPPER(T,i)::value_type, T > )); } \
     { MPL_ASSERT(( is_same< WRAPPER(T,i)::type, WRAPPER(T,i) > )); } \
@@ -36,3 +50,5 @@
     { MPL_ASSERT_RELATION( (WRAPPER(T,i)::value), ==, i ); } \
     INTEGRAL_WRAPPER_RUNTIME_TEST(i, T) \
 /**/
+#endif
+

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk