summaryrefslogtreecommitdiff
path: root/qpid/cpp/src/tests/Variant.cpp
diff options
context:
space:
mode:
authorAidan Skinner <aidan@apache.org>2009-09-17 16:21:13 +0000
committerAidan Skinner <aidan@apache.org>2009-09-17 16:21:13 +0000
commit7d6a028be9f6c47418e98a6fa74a359864428150 (patch)
tree78083427e88c48edb3b23605309e57f1301cba19 /qpid/cpp/src/tests/Variant.cpp
parent31bbc100ac6b3a31eb25d29f407d60ff23334d1f (diff)
downloadqpid-python-7d6a028be9f6c47418e98a6fa74a359864428150.tar.gz
Merge from trunk
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/java-network-refactor@816261 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests/Variant.cpp')
-rw-r--r--qpid/cpp/src/tests/Variant.cpp21
1 files changed, 13 insertions, 8 deletions
diff --git a/qpid/cpp/src/tests/Variant.cpp b/qpid/cpp/src/tests/Variant.cpp
index b7ce776827..2d68bb842c 100644
--- a/qpid/cpp/src/tests/Variant.cpp
+++ b/qpid/cpp/src/tests/Variant.cpp
@@ -7,9 +7,9 @@
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
- *
+ *
* http://www.apache.org/licenses/LICENSE-2.0
- *
+ *
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
@@ -25,6 +25,9 @@
using namespace qpid::messaging;
+namespace qpid {
+namespace tests {
+
QPID_AUTO_TEST_SUITE(VariantSuite)
QPID_AUTO_TEST_CASE(testConversions)
@@ -94,11 +97,11 @@ QPID_AUTO_TEST_CASE(testAssignment)
const uint32_t i(1000);
value = i;
BOOST_CHECK_EQUAL(VAR_UINT32, value.getType());
- BOOST_CHECK_EQUAL(VAR_STRING, other.getType());
+ BOOST_CHECK_EQUAL(VAR_STRING, other.getType());
}
QPID_AUTO_TEST_CASE(testList)
-{
+{
const std::string s("abc");
const float f(9.876f);
const int16_t x(1000);
@@ -108,7 +111,7 @@ QPID_AUTO_TEST_CASE(testList)
value.asList().push_back(Variant(f));
value.asList().push_back(Variant(x));
BOOST_CHECK_EQUAL(3u, value.asList().size());
- Variant::List::const_iterator i = value.asList().begin();
+ Variant::List::const_iterator i = value.asList().begin();
BOOST_CHECK(i != value.asList().end());
BOOST_CHECK_EQUAL(VAR_STRING, i->getType());
@@ -129,7 +132,7 @@ QPID_AUTO_TEST_CASE(testList)
}
QPID_AUTO_TEST_CASE(testMap)
-{
+{
const std::string red("red");
const float pi(3.14f);
const int16_t x(1000);
@@ -145,7 +148,7 @@ QPID_AUTO_TEST_CASE(testMap)
BOOST_CHECK_EQUAL(VAR_FLOAT, value.asMap()["pi"].getType());
BOOST_CHECK_EQUAL(pi, value.asMap()["pi"].asFloat());
-
+
BOOST_CHECK_EQUAL(VAR_INT16, value.asMap()["my-key"].getType());
BOOST_CHECK_EQUAL(x, value.asMap()["my-key"].asInt16());
@@ -153,5 +156,7 @@ QPID_AUTO_TEST_CASE(testMap)
BOOST_CHECK_EQUAL(VAR_STRING, value.asMap()["my-key"].getType());
BOOST_CHECK_EQUAL(std::string("now it's a string"), value.asMap()["my-key"].asString());
}
-
+
QPID_AUTO_TEST_SUITE_END()
+
+}} // namespace qpid::tests