BIND 10 master, updated. 937b5a6f47d4506193de9a3ed77adcef2cb1fd35 clang compilation fix (now using C++ cast in option.cc, also added test)
BIND 10 source code commits
bind10-changes at lists.isc.org
Mon Oct 17 12:24:20 UTC 2011
The branch, master has been updated
via 937b5a6f47d4506193de9a3ed77adcef2cb1fd35 (commit)
from c110fcc95f61b07871fd6fe7e24a495a3f49b89c (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 937b5a6f47d4506193de9a3ed77adcef2cb1fd35
Author: Tomek Mrugalski <tomasz at isc.org>
Date: Mon Oct 17 14:24:06 2011 +0200
clang compilation fix (now using C++ cast in option.cc, also added test)
-----------------------------------------------------------------------
Summary of changes:
src/lib/dhcp/option.cc | 4 ++--
src/lib/dhcp/tests/option_unittest.cc | 12 ++++++++++++
2 files changed, 14 insertions(+), 2 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/dhcp/option.cc b/src/lib/dhcp/option.cc
index 20eaf34..1ff2c85 100644
--- a/src/lib/dhcp/option.cc
+++ b/src/lib/dhcp/option.cc
@@ -213,14 +213,14 @@ std::string Option::toText(int indent /* =0 */ ) {
for (int i=0; i<indent; i++)
tmp << " ";
- tmp << "type=" << type_ << ", len=" << data_len_ << ":";
+ tmp << "type=" << type_ << ", len=" << data_len_ << ": ";
for (unsigned int i=0; i<data_len_; i++) {
if (i) {
tmp << ":";
}
tmp << setfill('0') << setw(2) << hex
- << (unsigned short)(unsigned uint8_t)data_[offset_+i];
+ << static_cast<unsigned short>(data_[offset_+i]);
}
// print suboptions
diff --git a/src/lib/dhcp/tests/option_unittest.cc b/src/lib/dhcp/tests/option_unittest.cc
index 2bfe781..296022a 100644
--- a/src/lib/dhcp/tests/option_unittest.cc
+++ b/src/lib/dhcp/tests/option_unittest.cc
@@ -265,3 +265,15 @@ TEST_F(OptionTest, addgetdel) {
}
}
+
+TEST_F(OptionTest, toText) {
+ boost::shared_array<uint8_t> buf(new uint8_t[3]);
+ buf[0] = 0;
+ buf[1] = 0xf;
+ buf[2] = 0xff;
+
+ boost::shared_ptr<Option> opt(new Option(Option::V6, 258,
+ buf, 0, 3));
+
+ EXPECT_EQ("type=258, len=3: 00:0f:ff", opt->toText());
+}
More information about the bind10-changes
mailing list