Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Kea
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Adam Osuchowski
Kea
Commits
89151107
Commit
89151107
authored
Dec 24, 2016
by
Francis Dupont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[5039] spelling (and a ~ file)
parent
9ebc3c7e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
5 additions
and
84 deletions
+5
-84
src/bin/dhcp4/simple_parser4.cc
src/bin/dhcp4/simple_parser4.cc
+2
-2
src/bin/dhcp4/tests/simple_parser4_unittest.cc
src/bin/dhcp4/tests/simple_parser4_unittest.cc
+1
-1
src/bin/dhcp6/simple_parser6.cc
src/bin/dhcp6/simple_parser6.cc
+1
-1
src/bin/dhcp6/tests/simple_parser6_unittest.cc
src/bin/dhcp6/tests/simple_parser6_unittest.cc
+1
-1
src/bin/dhcp6/tests/simple_parser6_unittest.cc~
src/bin/dhcp6/tests/simple_parser6_unittest.cc~
+0
-79
No files found.
src/bin/dhcp4/simple_parser4.cc
View file @
89151107
...
...
@@ -21,7 +21,7 @@ namespace dhcp {
/// is expected to be one centralized place to look at for
/// the default values. This is expected to be looked at also by
/// people who are not skilled in C or C++, so they may be
/// confused with the differences between declaration and defintion.
/// confused with the differences between declaration and defin
i
tion.
/// As such, there's one file to look at that hopefully is readable
/// without any C or C++ skills.
///
...
...
@@ -83,7 +83,7 @@ size_t SimpleParser4::setAllDefaults(isc::data::ElementPtr global) {
// Set global defaults first.
cnt
=
setDefaults
(
global
,
GLOBAL4_DEFAULTS
);
// Now set option defintion defaults for each specified option definition
// Now set option defin
i
tion defaults for each specified option definition
ConstElementPtr
option_defs
=
global
->
get
(
"option-def"
);
if
(
option_defs
)
{
BOOST_FOREACH
(
ElementPtr
option_def
,
option_defs
->
listValue
())
{
...
...
src/bin/dhcp4/tests/simple_parser4_unittest.cc
View file @
89151107
...
...
@@ -79,7 +79,7 @@ TEST_F(SimpleParser4Test, inheritGlobalToSubnet4) {
SimpleParser4
::
INHERIT_GLOBAL_TO_SUBNET4
));
EXPECT_EQ
(
2
,
num
);
// Check the values. 2 of them are in
t
erited, while the third one
// Check the values. 2 of them are in
h
erited, while the third one
// was already defined in the subnet, so should not be inherited.
checkIntegerValue
(
subnet
,
"renew-timer"
,
100
);
checkIntegerValue
(
subnet
,
"rebind-timer"
,
2
);
...
...
src/bin/dhcp6/simple_parser6.cc
View file @
89151107
...
...
@@ -21,7 +21,7 @@ namespace dhcp {
/// is expected to be one centralized place to look at for
/// the default values. This is expected to be looked at also by
/// people who are not skilled in C or C++, so they may be
/// confused with the differences between declaration and defintion.
/// confused with the differences between declaration and defin
i
tion.
/// As such, there's one file to look at that hopefully is readable
/// without any C or C++ skills.
///
...
...
src/bin/dhcp6/tests/simple_parser6_unittest.cc
View file @
89151107
...
...
@@ -75,7 +75,7 @@ TEST_F(SimpleParser6Test, inheritGlobalToSubnet6) {
SimpleParser6
::
INHERIT_GLOBAL_TO_SUBNET6
));
EXPECT_EQ
(
3
,
num
);
// Check the values. 3 of them are in
t
erited, while the fourth one
// Check the values. 3 of them are in
h
erited, while the fourth one
// was already defined in the subnet, so should not be inherited.
checkIntegerValue
(
subnet
,
"renew-timer"
,
100
);
checkIntegerValue
(
subnet
,
"rebind-timer"
,
2
);
...
...
src/bin/dhcp6/tests/simple_parser6_unittest.cc~
deleted
100644 → 0
View file @
9ebc3c7e
#include <config.h>
#include <cc/data.h>
#include <gtest/gtest.h>
using namespace isc;
using namespace isc::data;
namespace {
/// @brief DHCP Parser test fixture class
class SimpleParser6Test : public ::testing::Test {
/// @brief Checks if specified map has an integer parameter with expected value
///
/// @param map map to be checked
/// @param param_name name of the parameter to be checked
/// @param exp_value expected value of the parameter.
void checkIntegerValue(const ConstElementPtr& map, const std::string& param_name,
int64_t exp_value) {
// First check if the passed element is a map.
ASSERT_EQ(Element::map, map->getType());
// Now try to get the element being checked
ConstElementPtr elem = map->get(param_name);
ASSERT_TRUE(elem);
// Now check if it's indeed integer
ASSERT_EQ(Element::integer, elem->getType());
// Finally, check if its value meets expectation.
EXPECT_EQ(exp_value, elem->intValue());
}
};
// This test checks if global defaults are properly set for DHCPv6.
TEST_F(SimpleParser6Test, globalDefaults6) {
ElementPtr empty = Element::fromJSON("{ }");
size_t num;
EXPECT_NO_THROW(num = SimpleParser6::setDefaults(empty));
// We expect at least 4 parameters to be inserted.
EXPECT_TRUE(num >= 4);
checkIntegerValue(empty, "valid-lifetime", 7200);
checkIntegerValue(empty, "preferred-lifetime", 3600);
checkIntegerValue(empty, "rebind-timer", 1800);
checkIntegerValue(empty, "renew-timer", 900);
}
// This test checks if the parameters can be inherited from the global
// scope to the subnet scope.
TEST_F(SimpleParser6Test, inheritGlobalToSubnet6) {
ElementPtr global = Element::fromJSON("{ \"renew-timer\": 1,"
" \"rebind-timer\": 2,"
" \"preferred-lifetime\": 3,"
" \"valid-lifetime\": 4"
"}");
ElementPtr subnet = Element::fromJSON("{ \"renew-timer\": 100 }");
// we should inherit 3 parameters. Renew-timer should remain intact,
// as it was already defined in the subnet scope.
size_t num;
EXPECT_NO_THROW(num = SimpleParser::deriveParams(global, subnet,
SimpleParser6::INHERIT_GLOBAL_TO_SUBNET6));
EXPECT_EQ(3, num);
// Check the values. 3 of them are interited, while the fourth one
// was already defined in the subnet, so should not be inherited.
checkIntegerValue(subnet, "renew-timer", 100);
checkIntegerValue(subnet, "rebind-timer", 2);
checkIntegerValue(subnet, "preferred-lifetime", 3);
checkIntegerValue(subnet, "valid-lifetime", 4);
}
};
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment