|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r61299 - trunk/libs/spirit/example/scheme/test/utree
From: joel_at_[hidden]
Date: 2010-04-15 11:54:50
Author: djowel
Date: 2010-04-15 11:54:49 EDT (Thu, 15 Apr 2010)
New Revision: 61299
URL: http://svn.boost.org/trac/boost/changeset/61299
Log:
Using lightweight_test facility
Text files modified:
trunk/libs/spirit/example/scheme/test/utree/utree_test.cpp | 118 ++++++++++++++++++++--------------------
1 files changed, 59 insertions(+), 59 deletions(-)
Modified: trunk/libs/spirit/example/scheme/test/utree/utree_test.cpp
==============================================================================
--- trunk/libs/spirit/example/scheme/test/utree/utree_test.cpp (original)
+++ trunk/libs/spirit/example/scheme/test/utree/utree_test.cpp 2010-04-15 11:54:49 EDT (Thu, 15 Apr 2010)
@@ -4,7 +4,7 @@
Distributed under the Boost Software License, Version 1.0. (See accompanying
file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
=============================================================================*/
-
+#include <boost/detail/lightweight_test.hpp>
#include <boost/config/warning_disable.hpp>
#include <utree/utree.hpp>
@@ -17,7 +17,7 @@
{
std::stringstream s;
s << val;
- BOOST_ASSERT(s.str() == expected + " ");
+ BOOST_TEST(s.str() == expected + " ");
}
int main()
@@ -62,52 +62,52 @@
utree val4("Apple");
utree val5("Apple");
- BOOST_ASSERT(val4 == val5);
+ BOOST_TEST(val4 == val5);
utree val6("ApplePie");
- BOOST_ASSERT(val4 < val6);
+ BOOST_TEST(val4 < val6);
}
{
utree val;
val.push_back(123);
val.push_back("Chuckie");
- BOOST_ASSERT(val.size() == 2);
+ BOOST_TEST(val.size() == 2);
utree val2;
val2.push_back(123.456);
val2.push_back("Mah Doggie");
val.push_back(val2);
- BOOST_ASSERT(val.size() == 3);
+ BOOST_TEST(val.size() == 3);
check(val, "( 123 \"Chuckie\" ( 123.456 \"Mah Doggie\" ) )");
check(val.front(), "123");
utree val3;
val3.swap(val);
- BOOST_ASSERT(val3.size() == 3);
+ BOOST_TEST(val3.size() == 3);
check(val, "<nil>");
val3.swap(val);
check(val, "( 123 \"Chuckie\" ( 123.456 \"Mah Doggie\" ) )");
val.push_back("another string");
- BOOST_ASSERT(val.size() == 4);
+ BOOST_TEST(val.size() == 4);
check(val, "( 123 \"Chuckie\" ( 123.456 \"Mah Doggie\" ) \"another string\" )");
val.pop_front();
check(val, "( \"Chuckie\" ( 123.456 \"Mah Doggie\" ) \"another string\" )");
utree::iterator i = val.begin();
++++i;
val.insert(i, "Right in the middle");
- BOOST_ASSERT(val.size() == 4);
+ BOOST_TEST(val.size() == 4);
check(val, "( \"Chuckie\" ( 123.456 \"Mah Doggie\" ) \"Right in the middle\" \"another string\" )");
val.pop_back();
check(val, "( \"Chuckie\" ( 123.456 \"Mah Doggie\" ) \"Right in the middle\" )");
- BOOST_ASSERT(val.size() == 3);
+ BOOST_TEST(val.size() == 3);
utree::iterator it = val.end(); --it;
val.erase(it);
check(val, "( \"Chuckie\" ( 123.456 \"Mah Doggie\" ) )");
- BOOST_ASSERT(val.size() == 2);
+ BOOST_TEST(val.size() == 2);
val.insert(val.begin(), val2.begin(), val2.end());
check(val, "( 123.456 \"Mah Doggie\" \"Chuckie\" ( 123.456 \"Mah Doggie\" ) )");
- BOOST_ASSERT(val.size() == 4);
+ BOOST_TEST(val.size() == 4);
}
{
@@ -122,26 +122,26 @@
{
utree a, b;
- BOOST_ASSERT(a == b);
+ BOOST_TEST(a == b);
a = 123;
- BOOST_ASSERT(a != b);
+ BOOST_TEST(a != b);
b = 123;
- BOOST_ASSERT(a == b);
+ BOOST_TEST(a == b);
a = 100.00;
- BOOST_ASSERT(a < b);
+ BOOST_TEST(a < b);
b = a = utree();
- BOOST_ASSERT(a == b);
+ BOOST_TEST(a == b);
a.push_back(1);
a.push_back("two");
a.push_back(3.0);
b.push_back(1);
b.push_back("two");
b.push_back(3.0);
- BOOST_ASSERT(a == b);
+ BOOST_TEST(a == b);
b.push_back(4);
- BOOST_ASSERT(a != b);
- BOOST_ASSERT(a < b);
+ BOOST_TEST(a != b);
+ BOOST_TEST(a < b);
}
{
@@ -159,25 +159,25 @@
a.push_back(11);
a.push_back(12);
- BOOST_ASSERT(a[0] == utree(1));
- BOOST_ASSERT(a[1] == utree(2));
- BOOST_ASSERT(a[2] == utree(3));
- BOOST_ASSERT(a[3] == utree(4));
- BOOST_ASSERT(a[4] == utree(5));
- BOOST_ASSERT(a[5] == utree(6));
- BOOST_ASSERT(a[6] == utree(7));
- BOOST_ASSERT(a[7] == utree(8));
- BOOST_ASSERT(a[8] == utree(9));
- BOOST_ASSERT(a[9] == utree(10));
- BOOST_ASSERT(a[10] == utree(11));
- BOOST_ASSERT(a[11] == utree(12));
+ BOOST_TEST(a[0] == utree(1));
+ BOOST_TEST(a[1] == utree(2));
+ BOOST_TEST(a[2] == utree(3));
+ BOOST_TEST(a[3] == utree(4));
+ BOOST_TEST(a[4] == utree(5));
+ BOOST_TEST(a[5] == utree(6));
+ BOOST_TEST(a[6] == utree(7));
+ BOOST_TEST(a[7] == utree(8));
+ BOOST_TEST(a[8] == utree(9));
+ BOOST_TEST(a[9] == utree(10));
+ BOOST_TEST(a[10] == utree(11));
+ BOOST_TEST(a[11] == utree(12));
}
{ // test references
utree val(123);
utree ref(boost::ref(val));
check(ref, "123");
- BOOST_ASSERT(ref == utree(123));
+ BOOST_TEST(ref == utree(123));
val.clear();
val.push_back(1);
@@ -185,10 +185,10 @@
val.push_back(3);
val.push_back(4);
check(ref, "( 1 2 3 4 )");
- BOOST_ASSERT(ref[0] == utree(1));
- BOOST_ASSERT(ref[1] == utree(2));
- BOOST_ASSERT(ref[2] == utree(3));
- BOOST_ASSERT(ref[3] == utree(4));
+ BOOST_TEST(ref[0] == utree(1));
+ BOOST_TEST(ref[1] == utree(2));
+ BOOST_TEST(ref[2] == utree(3));
+ BOOST_TEST(ref[3] == utree(4));
}
{ // put it in an array
@@ -206,28 +206,28 @@
{ // operators
- BOOST_ASSERT((utree(true) && utree(true)) == utree(true));
- BOOST_ASSERT((utree(true) || utree(false)) == utree(true));
- BOOST_ASSERT(!utree(true) == utree(false));
-
- BOOST_ASSERT((utree(456) + utree(123)) == utree(456 + 123));
- BOOST_ASSERT((utree(456) + utree(123.456)) == utree(456 + 123.456));
- BOOST_ASSERT((utree(456) - utree(123)) == utree(456 - 123));
- BOOST_ASSERT((utree(456) - utree(123.456)) == utree(456 - 123.456));
- BOOST_ASSERT((utree(456) * utree(123)) == utree(456 * 123));
- BOOST_ASSERT((utree(456) * utree(123.456)) == utree(456 * 123.456));
- BOOST_ASSERT((utree(456) / utree(123)) == utree(456 / 123));
- BOOST_ASSERT((utree(456) / utree(123.456)) == utree(456 / 123.456));
- BOOST_ASSERT((utree(456) % utree(123)) == utree(456 % 123));
- BOOST_ASSERT(-utree(456) == utree(-456));
-
- BOOST_ASSERT((utree(456) & utree(123)) == utree(456 & 123));
- BOOST_ASSERT((utree(456) | utree(123)) == utree(456 | 123));
- BOOST_ASSERT((utree(456) ^ utree(123)) == utree(456 ^ 123));
- BOOST_ASSERT((utree(456) << utree(3)) == utree(456 << 3));
- BOOST_ASSERT((utree(456) >> utree(2)) == utree(456 >> 2));
- BOOST_ASSERT(~utree(456) == utree(~456));
+ BOOST_TEST((utree(true) && utree(true)) == utree(true));
+ BOOST_TEST((utree(true) || utree(false)) == utree(true));
+ BOOST_TEST(!utree(true) == utree(false));
+
+ BOOST_TEST((utree(456) + utree(123)) == utree(456 + 123));
+ BOOST_TEST((utree(456) + utree(123.456)) == utree(456 + 123.456));
+ BOOST_TEST((utree(456) - utree(123)) == utree(456 - 123));
+ BOOST_TEST((utree(456) - utree(123.456)) == utree(456 - 123.456));
+ BOOST_TEST((utree(456) * utree(123)) == utree(456 * 123));
+ BOOST_TEST((utree(456) * utree(123.456)) == utree(456 * 123.456));
+ BOOST_TEST((utree(456) / utree(123)) == utree(456 / 123));
+ BOOST_TEST((utree(456) / utree(123.456)) == utree(456 / 123.456));
+ BOOST_TEST((utree(456) % utree(123)) == utree(456 % 123));
+ BOOST_TEST(-utree(456) == utree(-456));
+
+ BOOST_TEST((utree(456) & utree(123)) == utree(456 & 123));
+ BOOST_TEST((utree(456) | utree(123)) == utree(456 | 123));
+ BOOST_TEST((utree(456) ^ utree(123)) == utree(456 ^ 123));
+ BOOST_TEST((utree(456) << utree(3)) == utree(456 << 3));
+ BOOST_TEST((utree(456) >> utree(2)) == utree(456 >> 2));
+ BOOST_TEST(~utree(456) == utree(~456));
}
- return 0;
+ return boost::report_errors();
}
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