qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From astitc...@apache.org
Subject svn commit: r1431493 - /qpid/trunk/qpid/cpp/src/tests/Variant.cpp
Date Thu, 10 Jan 2013 16:49:20 GMT
Author: astitcher
Date: Thu Jan 10 16:49:20 2013
New Revision: 1431493

URL: http://svn.apache.org/viewvc?rev=1431493&view=rev
Log:
NO-JIRA: Expand Variant tests to test previous Variant conversion checkin

Modified:
    qpid/trunk/qpid/cpp/src/tests/Variant.cpp

Modified: qpid/trunk/qpid/cpp/src/tests/Variant.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/Variant.cpp?rev=1431493&r1=1431492&r2=1431493&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/Variant.cpp (original)
+++ qpid/trunk/qpid/cpp/src/tests/Variant.cpp Thu Jan 10 16:49:20 2013
@@ -135,6 +135,16 @@ QPID_AUTO_TEST_CASE(testConversionsFromS
     BOOST_CHECK_EQUAL(0, value.asInt16());
     BOOST_CHECK_EQUAL(0u, value.asUint16());
 
+    value = "-Blah";
+    BOOST_CHECK_THROW(value.asUint16(), InvalidConversion);
+    BOOST_CHECK_THROW(value.asInt16(), InvalidConversion);
+    BOOST_CHECK_THROW(value.asUint32(), InvalidConversion);
+    BOOST_CHECK_THROW(value.asInt32(), InvalidConversion);
+    BOOST_CHECK_THROW(value.asUint64(), InvalidConversion);
+    BOOST_CHECK_THROW(value.asInt64(), InvalidConversion);
+    BOOST_CHECK_THROW(value.asFloat(), InvalidConversion);
+    BOOST_CHECK_THROW(value.asDouble(), InvalidConversion);
+
     value = "-000";
     BOOST_CHECK_EQUAL(0, value.asInt16());
     BOOST_CHECK_EQUAL(0u, value.asUint16());



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message