[svn] commit: r2528 - in /branches/trac256/src/lib/dns/tests: base32hex_unittest.cc hex_unittest.cc
BIND 10 source code commits
bind10-changes at lists.isc.org
Sat Jul 17 00:52:25 UTC 2010
Author: jinmei
Date: Sat Jul 17 00:52:24 2010
New Revision: 2528
Log:
addressed review comments: describe the intent of Base32HexTest.decodeMap
in more detail.
Modified:
branches/trac256/src/lib/dns/tests/base32hex_unittest.cc
branches/trac256/src/lib/dns/tests/hex_unittest.cc
Modified: branches/trac256/src/lib/dns/tests/base32hex_unittest.cc
==============================================================================
--- branches/trac256/src/lib/dns/tests/base32hex_unittest.cc (original)
+++ branches/trac256/src/lib/dns/tests/base32hex_unittest.cc Sat Jul 17 00:52:24 2010
@@ -118,6 +118,19 @@
TEST_F(Base32HexTest, decodeMap) {
string input(8, '0'); // input placeholder
+ // We're going to populate an input string with only the last character
+ // not equal to the zero character ('0') for each valid base32hex encoding
+ // character. Decoding that input should result in a data stream with
+ // the last byte equal to the numeric value represented by the that
+ // character. For example, we'll generate and confirm the following:
+ // "00000000" => should be 0 (as a 40bit integer)
+ // "00000001" => should be 1 (as a 40bit integer)
+ // ...
+ // "0000000V" => should be 31 (as a 40bit integer)
+ // We also check the use of an invalid character for the last character
+ // surely fails. '=' should be accepted as a valid padding in this
+ // context; space characters shouldn't be allowed in this context.
+
for (int i = 0; i < 256; ++i) {
input[7] = i;
Modified: branches/trac256/src/lib/dns/tests/hex_unittest.cc
==============================================================================
--- branches/trac256/src/lib/dns/tests/hex_unittest.cc (original)
+++ branches/trac256/src/lib/dns/tests/hex_unittest.cc Sat Jul 17 00:52:24 2010
@@ -95,6 +95,7 @@
TEST_F(HexTest, decodeMap) {
string input("00"); // input placeholder
+ // See Base32HexTest.decodeMap for details of the following tests.
for (int i = 0; i < 256; ++i) {
input[1] = i;
More information about the bind10-changes
mailing list