Browse Source

[4204fd] Reverted hex->bin change (missed

Francis Dupont 9 years ago
parent
commit
47a7eae640
2 changed files with 13 additions and 13 deletions
  1. 1 1
      src/lib/dhcp/option.cc
  2. 12 12
      src/lib/dhcpsrv/tests/client_class_def_parser_unittest.cc

+ 1 - 1
src/lib/dhcp/option.cc

@@ -229,7 +229,7 @@ Option::toBinary(const bool include_header) {
         pack(buf);
 
     } catch (const std::exception &ex) {
-        isc_throw(OutOfRange, "unable to obtain binary representation"
+        isc_throw(OutOfRange, "unable to obtain hexadecimal representation"
                   " of option " << getType() << ": " << ex.what());
     }
     const uint8_t* option_data = static_cast<const uint8_t*>(buf.getData());

+ 12 - 12
src/lib/dhcpsrv/tests/client_class_def_parser_unittest.cc

@@ -182,19 +182,19 @@ TEST_F(ExpressionParserTest, validExpressionWithOptionName4) {
                               "hundred4");
 }
 
-// Verifies that given a valid expression using .bin operator for option, the
+// Verifies that given a valid expression using .hex operator for option, the
 // ExpressionParser produces an Expression which can be evaluated against
 // a v4 packet.
-TEST_F(ExpressionParserTest, validExpressionWithBin4) {
-    testValidExpression<Pkt4>(Option::V4, "\"option[12].bin == 0x68756E6472656434\"",
+TEST_F(ExpressionParserTest, validExpressionWithHex4) {
+    testValidExpression<Pkt4>(Option::V4, "\"option[12].hex == 0x68756E6472656434\"",
                               "hundred4");
 }
 
-// Verifies that the option name can be used together with .bin operator in
+// Verifies that the option name can be used together with .hex operator in
 // the evaluated expression.
-TEST_F(ExpressionParserTest, validExpressionWithOptionNameAndBin4) {
+TEST_F(ExpressionParserTest, validExpressionWithOptionNameAndHex4) {
     testValidExpression<Pkt6>(Option::V4,
-                              "\"option[host-name].bin == 0x68756E6472656434\"",
+                              "\"option[host-name].text == 0x68756E6472656434\"",
                               "hundred4");
 }
 
@@ -212,19 +212,19 @@ TEST_F(ExpressionParserTest, validExpressionWithOptionName6) {
                               "hundred6");
 }
 
-// Verifies that given a valid expression using .bin operator for option, the
+// Verifies that given a valid expression using .hex operator for option, the
 // ExpressionParser produces an Expression which can be evaluated against
 // a v6 packet.
-TEST_F(ExpressionParserTest, validExpressionWithBin6) {
-    testValidExpression<Pkt6>(Option::V6, "\"option[59].bin == 0x68756E6472656436\"",
+TEST_F(ExpressionParserTest, validExpressionWithHex6) {
+    testValidExpression<Pkt6>(Option::V6, "\"option[59].hex == 0x68756E6472656436\"",
                               "hundred6");
 }
 
-// Verifies that the option name can be used together with .bin operator in
+// Verifies that the option name can be used together with .hex operator in
 // the evaluated expression.
-TEST_F(ExpressionParserTest, validExpressionWithOptionNameAndBin6) {
+TEST_F(ExpressionParserTest, validExpressionWithOptionNameAndHex6) {
     testValidExpression<Pkt6>(Option::V6,
-                              "\"option[bootfile-url].bin == 0x68756E6472656436\"",
+                              "\"option[bootfile-url].text == 0x68756E6472656436\"",
                               "hundred6");
 }