|
Boost-Commit : |
From: eric_at_[hidden]
Date: 2007-11-08 13:53:21
Author: eric_niebler
Date: 2007-11-08 13:53:21 EST (Thu, 08 Nov 2007)
New Revision: 40940
URL: http://svn.boost.org/trac/boost/changeset/40940
Log:
fix tests to work on cygwin
Text files modified:
branches/proto/v3/libs/xpressive/proto3/test/Jamfile.v2 | 4 ++--
branches/proto/v3/libs/xpressive/proto3/test/examples2.cpp | 39 +++++++++++++++++++++------------------
branches/proto/v3/libs/xpressive/proto3/test/main.cpp | 13 +++++--------
branches/proto/v3/libs/xpressive/proto3/test/matches.cpp | 4 ++--
4 files changed, 30 insertions(+), 30 deletions(-)
Modified: branches/proto/v3/libs/xpressive/proto3/test/Jamfile.v2
==============================================================================
--- branches/proto/v3/libs/xpressive/proto3/test/Jamfile.v2 (original)
+++ branches/proto/v3/libs/xpressive/proto3/test/Jamfile.v2 2007-11-08 13:53:21 EST (Thu, 08 Nov 2007)
@@ -12,8 +12,8 @@
<toolset>msvc-8.0:<define>_SCL_SECURE_NO_DEPRECATE
<toolset>msvc-8.0:<define>_CRT_SECURE_NO_DEPRECATE
<toolset>gcc:<cxxflags>-ftemplate-depth-1024
- <library>/boost/test//boost_unit_test_framework
- <link>static
+ #<library>/boost/test//boost_unit_test_framework
+ #<link>static
;
test-suite "proto"
Modified: branches/proto/v3/libs/xpressive/proto3/test/examples2.cpp
==============================================================================
--- branches/proto/v3/libs/xpressive/proto3/test/examples2.cpp (original)
+++ branches/proto/v3/libs/xpressive/proto3/test/examples2.cpp 2007-11-08 13:53:21 EST (Thu, 08 Nov 2007)
@@ -5,6 +5,9 @@
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
+// for cygwin
+#undef __STRICT_ANSI__
+
#include <iostream>
#include <boost/config.hpp>
#include <boost/mpl/min_max.hpp>
@@ -16,7 +19,7 @@
#include <boost/utility/result_of.hpp>
#include <boost/fusion/include/cons.hpp>
#include <boost/fusion/include/pop_front.hpp>
-#include <boost/test/unit_test.hpp>
+#include <boost/test/included/unit_test.hpp>
using namespace boost::proto;
using namespace transform;
@@ -132,8 +135,8 @@
struct one : mpl::int_<1> {};
struct two : mpl::int_<2> {};
-terminal< placeholder1 >::type const _1 = {{}};
-terminal< placeholder2 >::type const _2 = {{}};
+terminal< placeholder1 >::type const _1_ = {{}};
+terminal< placeholder2 >::type const _2_ = {{}};
//[ CalculatorArityGrammar
struct CalculatorArity
@@ -150,11 +153,11 @@
//[ CalculatorArityGrammar2
struct CalcArity2
: or_<
- case_< terminal< placeholder1 >, one() >
- , case_< terminal< placeholder2 >, two() >
- , case_< terminal<_>, zero() >
- , case_< unary_expr<_, CalcArity2>, CalcArity2(_arg) >
- , case_< binary_expr<_, CalcArity2, CalcArity2>, mpl::max<typeof_<CalcArity2(_left)>, typeof_<CalcArity2(_right)> >() >
+ case_< terminal< placeholder1 >, one() >
+ , case_< terminal< placeholder2 >, two() >
+ , case_< terminal<_>, zero() >
+ , case_< unary_expr<_, CalcArity2>, CalcArity2(_arg) >
+ , case_< binary_expr<_, CalcArity2, CalcArity2>, mpl::max<CalcArity2(_left), CalcArity2(_right)>() >
>
{};
//]
@@ -203,14 +206,14 @@
//]
//[ FoldTreeToList
-// This transform matches expressions of the form (_1=1,'a',"b")
+// This transform matches expressions of the form (_1_=1,'a',"b")
// (note the use of the comma operator) and transforms it into a
// Fusion cons list of their arguments. In this case, the result
// would be cons(1, cons('a', cons("b", nil()))).
struct FoldTreeToList
: or_<
// This grammar describes what counts as the terminals in expressions
- // of the form (_1=1,'a',"b"), which will be flattened using
+ // of the form (_1_=1,'a',"b"), which will be flattened using
// reverse_fold_tree<> below.
case_<assign<_, terminal<_> >
, _arg(_right)
@@ -290,27 +293,27 @@
int i = 0; // not used, dummy state and visitor parameter
std::cout << CalculatorArity::call( lit(100) * 200, i, i) << '\n';
- std::cout << CalculatorArity::call( (_1 - _1) / _1 * 100, i, i) << '\n';
- std::cout << CalculatorArity::call( (_2 - _1) / _2 * 100, i, i) << '\n';
+ std::cout << CalculatorArity::call( (_1_ - _1_) / _1_ * 100, i, i) << '\n';
+ std::cout << CalculatorArity::call( (_2_ - _1_) / _2_ * 100, i, i) << '\n';
//]
BOOST_CHECK_EQUAL(0, CalculatorArity::call( lit(100) * 200, i, i));
- BOOST_CHECK_EQUAL(1, CalculatorArity::call( (_1 - _1) / _1 * 100, i, i));
- BOOST_CHECK_EQUAL(2, CalculatorArity::call( (_2 - _1) / _2 * 100, i, i));
+ BOOST_CHECK_EQUAL(1, CalculatorArity::call( (_1_ - _1_) / _1_ * 100, i, i));
+ BOOST_CHECK_EQUAL(2, CalculatorArity::call( (_2_ - _1_) / _2_ * 100, i, i));
BOOST_CHECK_EQUAL(0, CalcArity2::call( lit(100) * 200, i, i));
- BOOST_CHECK_EQUAL(1, CalcArity2::call( (_1 - _1) / _1 * 100, i, i));
- BOOST_CHECK_EQUAL(2, CalcArity2::call( (_2 - _1) / _2 * 100, i, i));
+ BOOST_CHECK_EQUAL(1, CalcArity2::call( (_1_ - _1_) / _1_ * 100, i, i));
+ BOOST_CHECK_EQUAL(2, CalcArity2::call( (_2_ - _1_) / _2_ * 100, i, i));
using boost::fusion::cons;
using boost::fusion::nil;
// TODO
- //cons<int, cons<char, cons<char const (&)[2]> > > args(ArgsAsList::call( _1(1, 'a', "b"), i, i ));
+ //cons<int, cons<char, cons<char const (&)[2]> > > args(ArgsAsList::call( _1_(1, 'a', "b"), i, i ));
//BOOST_CHECK_EQUAL(args.car, 1);
//BOOST_CHECK_EQUAL(args.cdr.car, 'a');
//BOOST_CHECK_EQUAL(args.cdr.cdr.car, std::string("b"));
- //cons<int, cons<char, cons<char const (&)[2]> > > lst(FoldTreeToList::call( (_1 = 1, 'a', "b"), i, i ));
+ //cons<int, cons<char, cons<char const (&)[2]> > > lst(FoldTreeToList::call( (_1_ = 1, 'a', "b"), i, i ));
//BOOST_CHECK_EQUAL(lst.car, 1);
//BOOST_CHECK_EQUAL(lst.cdr.car, 'a');
//BOOST_CHECK_EQUAL(lst.cdr.cdr.car, std::string("b"));
Modified: branches/proto/v3/libs/xpressive/proto3/test/main.cpp
==============================================================================
--- branches/proto/v3/libs/xpressive/proto3/test/main.cpp (original)
+++ branches/proto/v3/libs/xpressive/proto3/test/main.cpp 2007-11-08 13:53:21 EST (Thu, 08 Nov 2007)
@@ -1,7 +1,6 @@
+#undef __STRICT_ANSI__
//#define BOOST_STRICT_CONFIG
-extern "C" int isblank(int) throw();
-
#include <cstdio>
#include <iostream>
#include <typeinfo>
@@ -165,7 +164,7 @@
: case_<
function<terminal<_>, vararg<terminal<_> > >
, reverse_fold<
- pop_front(_) // make (_) optional
+ pop_front(_)
, fusion::nil()
, fusion::cons<_arg, _state>(_arg, _state)
>
@@ -318,11 +317,9 @@
(FoldTreeToList::call( (_1 = 1, 'a', str), dummy, non_ ));
std::cout << mylist2.car << ' ' << mylist2.cdr.car << ' ' << mylist2.cdr.cdr.car << std::endl;
-
- //default_context ctx;
- //int r1 = eval(as_expr(1) + as_expr(2), ctx);
- //std::cout << r1 << std::endl;
-
+ default_context ctx;
+ int r1 = eval(as_expr(1) + as_expr(2), ctx);
+ std::cout << r1 << std::endl;
return 0;
}
Modified: branches/proto/v3/libs/xpressive/proto3/test/matches.cpp
==============================================================================
--- branches/proto/v3/libs/xpressive/proto3/test/matches.cpp (original)
+++ branches/proto/v3/libs/xpressive/proto3/test/matches.cpp 2007-11-08 13:53:21 EST (Thu, 08 Nov 2007)
@@ -5,7 +5,7 @@
// Software License, Version 1.0. (See accompanying file
// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
-extern "C" int isblank(int) throw();
+#undef __STRICT_ANSI__
#include <string>
#include <iostream>
@@ -13,7 +13,7 @@
#include <boost/mpl/placeholders.hpp>
#include <boost/type_traits/is_same.hpp>
#include <boost/xpressive/proto3/proto.hpp>
-#include <boost/test/unit_test.hpp>
+#include <boost/test/included/unit_test.hpp>
using namespace boost;
using namespace proto;
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