Browse Source

addressed review comments: describe the intent of Base32HexTest.decodeMap
in more detail.


git-svn-id: svn://bind10.isc.org/svn/bind10/branches/trac256@2528 e5f2f494-b856-4b98-b285-d166d9295462

JINMEI Tatuya 14 years ago
parent
commit
039843d530
2 changed files with 14 additions and 0 deletions
  1. 13 0
      src/lib/dns/tests/base32hex_unittest.cc
  2. 1 0
      src/lib/dns/tests/hex_unittest.cc

+ 13 - 0
src/lib/dns/tests/base32hex_unittest.cc

@@ -118,6 +118,19 @@ TEST_F(Base32HexTest, encode) {
 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;
 

+ 1 - 0
src/lib/dns/tests/hex_unittest.cc

@@ -95,6 +95,7 @@ TEST_F(HexTest, decodeHex) {
 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;