summaryrefslogtreecommitdiffstats
path: root/src/lib/dhcp/tests/option_definition_unittest.cc
diff options
context:
space:
mode:
authorMarcin Siodelski <marcin@isc.org>2013-05-13 16:02:21 +0200
committerMarcin Siodelski <marcin@isc.org>2013-05-13 16:02:21 +0200
commit18a4180734c1896f12afadd40a2a658f3c5c795f (patch)
tree1f703614e7581850744d266743954856255cab3f /src/lib/dhcp/tests/option_definition_unittest.cc
parent[2786] Implemented unpack() function of OptionString class. (diff)
downloadkea-18a4180734c1896f12afadd40a2a658f3c5c795f.tar.xz
kea-18a4180734c1896f12afadd40a2a658f3c5c795f.zip
[2786] Use OptionString class to represent options with a string.
Diffstat (limited to 'src/lib/dhcp/tests/option_definition_unittest.cc')
-rw-r--r--src/lib/dhcp/tests/option_definition_unittest.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/lib/dhcp/tests/option_definition_unittest.cc b/src/lib/dhcp/tests/option_definition_unittest.cc
index 174bafbd22..f7602a6467 100644
--- a/src/lib/dhcp/tests/option_definition_unittest.cc
+++ b/src/lib/dhcp/tests/option_definition_unittest.cc
@@ -25,6 +25,7 @@
#include <dhcp/option_definition.h>
#include <dhcp/option_int.h>
#include <dhcp/option_int_array.h>
+#include <dhcp/option_string.h>
#include <exceptions/exceptions.h>
#include <boost/pointer_cast.hpp>
@@ -936,11 +937,10 @@ TEST_F(OptionDefinitionTest, utf8StringTokenized) {
option_v6 = opt_def.optionFactory(Option::V6, opt_code, values);
);
ASSERT_TRUE(option_v6);
- ASSERT_TRUE(typeid(*option_v6) == typeid(OptionCustom));
- std::vector<uint8_t> data = option_v6->getData();
- std::vector<uint8_t> ref_data(values[0].c_str(), values[0].c_str()
- + values[0].length());
- EXPECT_TRUE(std::equal(ref_data.begin(), ref_data.end(), data.begin()));
+ ASSERT_TRUE(typeid(*option_v6) == typeid(OptionString));
+ OptionStringPtr option_v6_string =
+ boost::static_pointer_cast<OptionString>(option_v6);
+ EXPECT_TRUE(values[0] == option_v6_string->getValue());
}
// The purpose of this test is to check that non-integer data type can't