Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r60378 - branches/units/autoprefix/libs/units/test
From: pbristow_at_[hidden]
Date: 2010-03-09 05:59:47


Author: pbristow
Date: 2010-03-09 05:59:45 EST (Tue, 09 Mar 2010)
New Revision: 60378
URL: http://svn.boost.org/trac/boost/changeset/60378

Log:
added tests for scalars - not autoprefixed.
Text files modified:
   branches/units/autoprefix/libs/units/test/test_output.cpp | 13 +++++++++++++
   1 files changed, 13 insertions(+), 0 deletions(-)

Modified: branches/units/autoprefix/libs/units/test/test_output.cpp
==============================================================================
--- branches/units/autoprefix/libs/units/test/test_output.cpp (original)
+++ branches/units/autoprefix/libs/units/test/test_output.cpp 2010-03-09 05:59:45 EST (Tue, 09 Mar 2010)
@@ -307,6 +307,13 @@
     BOOST_UNITS_TEST_OUTPUT(1.5*scaled_custom1(), "1.5 kilocustom1");
     BOOST_UNITS_TEST_OUTPUT(1.5*scaled_custom2(), "1.5 kilocustom2");
     BOOST_UNITS_TEST_OUTPUT(1.5*boost::units::absolute<meter_base_unit::unit_type>(), "1.5 absolute meter");
+
+ BOOST_UNITS_TEST_OUTPUT(1.5, "1.5"); // scalar.
+ BOOST_UNITS_TEST_OUTPUT(1567., "1567"); // scalars are *not* autoprefixed.
+ BOOST_UNITS_TEST_OUTPUT(0.00015, "0.00015"); // scalars are *not* autoprefixed.
+ BOOST_UNITS_TEST_OUTPUT(-1.5, "-1.5"); // scalar.
+ BOOST_UNITS_TEST_OUTPUT(-1567., "-1567"); // scalars are *not* autoprefixed.
+ BOOST_UNITS_TEST_OUTPUT(-0.00015, "-0.00015"); // scalars are *not* autoprefixed.
 #undef FORMATTERS
 }
 
@@ -359,6 +366,10 @@
     BOOST_UNITS_TEST_OUTPUT(pow(2., 40) * byte_base_unit::unit_type(), "1 Tib");
     BOOST_UNITS_TEST_OUTPUT(pow(2., 50) * byte_base_unit::unit_type(), "1 Pib");
     BOOST_UNITS_TEST_OUTPUT(pow(2., 60) * byte_base_unit::unit_type(), "1 Eib");
+ BOOST_UNITS_TEST_OUTPUT(42, "42"); // integer scalar.
+ BOOST_UNITS_TEST_OUTPUT(-42, "-42"); // integer scalar.
+ BOOST_UNITS_TEST_OUTPUT(1567, "1567"); // scalars are *not* autoprefixed.
+ BOOST_UNITS_TEST_OUTPUT(-1567, "-1567"); // scalars are *not* autoprefixed.
 #undef FORMATTERS
 }
 
@@ -374,6 +385,8 @@
     BOOST_UNITS_TEST_OUTPUT(pow(2., 41) *byte_base_unit::unit_type(), "2 tebibyte"); // http://en.wikipedia.org/wiki/Tebibyte
     BOOST_UNITS_TEST_OUTPUT(pow(2., 50) *byte_base_unit::unit_type(), "1 pebibyte");
     BOOST_UNITS_TEST_OUTPUT(pow(2., 60) *byte_base_unit::unit_type(), "1 exbibyte");
+ BOOST_UNITS_TEST_OUTPUT(2048, "2048"); // scalars are *not* autoprefixed.
+ BOOST_UNITS_TEST_OUTPUT(-4096, "-4096"); // scalars are *not* autoprefixed.
 #undef FORMATTERS
 }
 


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