2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-09-05 16:35:23 +00:00

[4204fd] Applied my proposed changes

This commit is contained in:
Francis Dupont
2015-11-26 15:20:12 +01:00
parent 83a7bf9094
commit c4cd450f03
17 changed files with 349 additions and 242 deletions

View File

@@ -325,14 +325,14 @@ TEST_F(TokenTest, optionWithNameString4) {
// This test checks if a token representing option value is able to extract
// the option from an IPv4 packet and properly store its value in a
// hexadecimal format.
TEST_F(TokenTest, optionHexString4) {
// binary format.
TEST_F(TokenTest, optionBinString4) {
TokenPtr found;
TokenPtr not_found;
// The packets we use have option 100 with a string in them.
ASSERT_NO_THROW(found.reset(new TokenOption(100, TokenOption::HEXADECIMAL)));
ASSERT_NO_THROW(not_found.reset(new TokenOption(101, TokenOption::HEXADECIMAL)));
ASSERT_NO_THROW(found.reset(new TokenOption(100, TokenOption::BINARY)));
ASSERT_NO_THROW(not_found.reset(new TokenOption(101, TokenOption::BINARY)));
// This should evaluate to the content of the option 100 (i.e. "hundred4")
ASSERT_NO_THROW(found->evaluate(*pkt4_, values_));
@@ -354,8 +354,8 @@ TEST_F(TokenTest, optionHexString4) {
// This test checks if a token representing an option identified by name is
// able to extract this option from an IPv4 packet and properly store its
// value in the hexadecimal format.
TEST_F(TokenTest, optionWithNameHexString4) {
// value in the binary format.
TEST_F(TokenTest, optionWithNameBinString4) {
// Create definition of option 100 to provide a mapping between option
// code and option name.
ASSERT_NO_THROW(createOptionDefinitions4());
@@ -364,7 +364,7 @@ TEST_F(TokenTest, optionWithNameHexString4) {
// map the option name to its code.
TokenPtr token;
ASSERT_NO_THROW(token.reset(new TokenOption("name-hundred4", Option::V4,
TokenOption::HEXADECIMAL)));
TokenOption::BINARY)));
// Evaluate option in the packet.
ASSERT_NO_THROW(token->evaluate(*pkt4_, values_));
@@ -426,15 +426,15 @@ TEST_F(TokenTest, optionWithNameString6) {
// This test checks if a token representing an option value is able to extract
// the option from an IPv6 packet and properly store its value in hexadecimal
// the option from an IPv6 packet and properly store its value in binary
// format.
TEST_F(TokenTest, optionHexString6) {
TEST_F(TokenTest, optionBinString6) {
TokenPtr found;
TokenPtr not_found;
// The packets we use have option 100 with a string in them.
ASSERT_NO_THROW(found.reset(new TokenOption(100, TokenOption::HEXADECIMAL)));
ASSERT_NO_THROW(not_found.reset(new TokenOption(101, TokenOption::HEXADECIMAL)));
ASSERT_NO_THROW(found.reset(new TokenOption(100, TokenOption::BINARY)));
ASSERT_NO_THROW(not_found.reset(new TokenOption(101, TokenOption::BINARY)));
// This should evaluate to the content of the option 100 (i.e. "hundred6")
ASSERT_NO_THROW(found->evaluate(*pkt6_, values_));
@@ -456,8 +456,8 @@ TEST_F(TokenTest, optionHexString6) {
// This test checks if a token representing an option identified by name is
// able to extract this option from an IPv6 packet and properly store its
// value in the hexadecimal format.
TEST_F(TokenTest, optionWithNameHexString6) {
// value in the binary format.
TEST_F(TokenTest, optionWithNameBinString6) {
// Create definition of option 100 to provide a mapping between option
// code and option name.
ASSERT_NO_THROW(createOptionDefinitions6());
@@ -466,7 +466,7 @@ TEST_F(TokenTest, optionWithNameHexString6) {
// map the option name to its code.
TokenPtr token;
ASSERT_NO_THROW(token.reset(new TokenOption("name-hundred6", Option::V6,
TokenOption::HEXADECIMAL)));
TokenOption::BINARY)));
// Evaluate option in the packet.
ASSERT_NO_THROW(token->evaluate(*pkt6_, values_));