|
Boost-Commit : |
From: jared_at_[hidden]
Date: 2007-05-24 23:34:38
Author: jared
Date: 2007-05-24 23:34:38 EDT (Thu, 24 May 2007)
New Revision: 4239
URL: http://svn.boost.org/trac/boost/changeset/4239
Log:
Added some new pointer based tests.
Text files modified:
sandbox/explore/libs/explore/test/simple_types.cpp | 27 ++++++++++++++++++++++-----
1 files changed, 22 insertions(+), 5 deletions(-)
Modified: sandbox/explore/libs/explore/test/simple_types.cpp
==============================================================================
--- sandbox/explore/libs/explore/test/simple_types.cpp (original)
+++ sandbox/explore/libs/explore/test/simple_types.cpp 2007-05-24 23:34:38 EDT (Thu, 24 May 2007)
@@ -25,8 +25,14 @@
BOOST_CHECK_EQUAL(str_out.str(), "123");
str_out.str("");
- int* pi = &i;
-
+
+ int* pi = NULL;
+ explore::print(pi, str_out);
+ BOOST_CHECK_EQUAL(str_out.str(), "null");
+
+ str_out.str("");
+
+ pi = &i;
explore::print(pi, str_out);
// technically, we should force this to be true, though
// it is highly unlikely to be false. Otherwise this test is only
@@ -36,7 +42,7 @@
// this is not a useful test. pointers should print out as pointers.
BOOST_CHECK_EQUAL(str_out.str(), "123");
}
-/*
+
BOOST_AUTO_TEST_CASE( int_stream_test )
{
std::stringstream str_out;
@@ -147,10 +153,22 @@
BOOST_CHECK_EQUAL(str_out.str(), "c");
str_out.str("");
- char* pc = "c";
+ char* pc = NULL;
+ explore::print(pc, str_out);
+ BOOST_CHECK_EQUAL(str_out.str(), "null");
+
+ str_out.str("");
+
+ pc = "c";
explore::print(pc, str_out);
BOOST_CHECK_EQUAL(str_out.str(), "c");
+
+ str_out.str("");
+
+ pc = "cat";
+ explore::print(pc, str_out);
+ BOOST_CHECK_EQUAL(str_out.str(), "cat");
}
BOOST_AUTO_TEST_CASE( char_stream_test )
@@ -187,4 +205,3 @@
BOOST_CHECK_EQUAL(str_out.str(), "some string");
}
-*/
\ No newline at end of file
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