BIND 10 trac1959, updated. f6ef8ec398f1711245c25eeb30887fe4de18641f [1959] Fixed bug in TestControlTest.Options6.
BIND 10 source code commits
bind10-changes at lists.isc.org
Wed Sep 5 17:04:22 UTC 2012
The branch, trac1959 has been updated
via f6ef8ec398f1711245c25eeb30887fe4de18641f (commit)
from fe103d1a3845a08dbf3d0af2bb3c17f10f78a6d7 (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 f6ef8ec398f1711245c25eeb30887fe4de18641f
Author: Marcin Siodelski <marcin at isc.org>
Date: Wed Sep 5 19:04:12 2012 +0200
[1959] Fixed bug in TestControlTest.Options6.
-----------------------------------------------------------------------
Summary of changes:
tests/tools/perfdhcp/test_control.cc | 6 +++---
.../tools/perfdhcp/tests/test_control_unittest.cc | 12 +++++-------
2 files changed, 8 insertions(+), 10 deletions(-)
-----------------------------------------------------------------------
diff --git a/tests/tools/perfdhcp/test_control.cc b/tests/tools/perfdhcp/test_control.cc
index ba8bf25..de7579d 100644
--- a/tests/tools/perfdhcp/test_control.cc
+++ b/tests/tools/perfdhcp/test_control.cc
@@ -298,9 +298,9 @@ OptionPtr
TestControl::factoryOptionRequestOption6(Option::Universe,
uint16_t,
const OptionBuffer&) {
- const uint16_t buf_array[] = {
- htons(D6O_NAME_SERVERS),
- htons(D6O_DOMAIN_SEARCH)
+ const uint8_t buf_array[] = {
+ D6O_NAME_SERVERS, 0,
+ D6O_DOMAIN_SEARCH, 0,
};
OptionBuffer buf_with_options(buf_array, buf_array + sizeof(buf_array));
return (OptionPtr(new Option(Option::V6, D6O_ORO, buf_with_options)));
diff --git a/tests/tools/perfdhcp/tests/test_control_unittest.cc b/tests/tools/perfdhcp/tests/test_control_unittest.cc
index f94f6f7..06dc3e5 100644
--- a/tests/tools/perfdhcp/tests/test_control_unittest.cc
+++ b/tests/tools/perfdhcp/tests/test_control_unittest.cc
@@ -178,7 +178,6 @@ public:
if (requested_options[j] == buf[i]) {
// Requested option has been found.
++matched_num;
- break;
}
}
}
@@ -205,12 +204,11 @@ public:
size_t matched_num = 0;
for (size_t i = 0; i < buf.size(); i += 2) {
for (int j = 0; j < requested_options.size(); j += 2) {
- uint16_t opt_i = buf[i + 1] << 8 + buf[i];
- uint16_t opt_j = buf[j + 1] << 8 + buf[j];
+ uint16_t opt_i = buf[i + 1] << 8 + buf[i] & 0xFF;
+ uint16_t opt_j = requested_options[j + 1] << 8 + requested_options[j] & 0xFF;
if (opt_i == opt_j) {
// Requested option has been found.
++matched_num;
- break;
}
}
}
@@ -771,9 +769,9 @@ TEST_F(TestControlTest, Options6) {
// Validate the D6O_ORO (Option Request Option).
OptionPtr opt_oro(Option::factory(Option::V6, D6O_ORO));
// Prepare the reference buffer with requested options.
- const uint16_t requested_options[] = {
- htons(D6O_NAME_SERVERS),
- htons(D6O_DOMAIN_SEARCH)
+ const uint8_t requested_options[] = {
+ D6O_NAME_SERVERS, 0,
+ D6O_DOMAIN_SEARCH, 0,
};
int requested_options_num =
sizeof(requested_options) / sizeof(requested_options[0]);
More information about the bind10-changes
mailing list