Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
Kea
Commits
3f3bc96b
Commit
3f3bc96b
authored
Apr 04, 2013
by
Thomas Markwalder
Browse files
[2634] Replaced ASSERTs with EXPECTs per review comments in storage
unit tests.
parent
3b6cd417
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/lib/dhcpsrv/tests/cfgmgr_unittest.cc
View file @
3f3bc96b
...
...
@@ -57,7 +57,7 @@ TEST(ValueStorageTest, BooleanTesting) {
// Verify that we can delete a parameter and it will no longer be found.
testStore
.
delParam
(
"firstBool"
);
ASSER
T_THROW
(
testStore
.
getParam
(
"firstBool"
),
isc
::
dhcp
::
DhcpConfigError
);
EXPEC
T_THROW
(
testStore
.
getParam
(
"firstBool"
),
isc
::
dhcp
::
DhcpConfigError
);
// Verify that the delete was safe and the store still operates.
EXPECT_FALSE
(
testStore
.
getParam
(
"secondBool"
));
...
...
@@ -66,11 +66,11 @@ TEST(ValueStorageTest, BooleanTesting) {
ASSERT_THROW
(
testStore
.
getParam
(
"bogusBool"
),
isc
::
dhcp
::
DhcpConfigError
);
// Verify that attempting to delete a parameter that never existed does not throw.
ASSER
T_NO_THROW
(
testStore
.
delParam
(
"bogusBool"
));
EXPEC
T_NO_THROW
(
testStore
.
delParam
(
"bogusBool"
));
// Verify that we can empty the list.
testStore
.
clear
();
ASSER
T_THROW
(
testStore
.
getParam
(
"secondBool"
),
isc
::
dhcp
::
DhcpConfigError
);
EXPEC
T_THROW
(
testStore
.
getParam
(
"secondBool"
),
isc
::
dhcp
::
DhcpConfigError
);
}
...
...
@@ -97,7 +97,7 @@ TEST(ValueStorageTest, Uint32Testing) {
// Verify that we can delete a parameter and it will no longer be found.
testStore
.
delParam
(
"firstInt"
);
ASSER
T_THROW
(
testStore
.
getParam
(
"firstInt"
),
isc
::
dhcp
::
DhcpConfigError
);
EXPEC
T_THROW
(
testStore
.
getParam
(
"firstInt"
),
isc
::
dhcp
::
DhcpConfigError
);
// Verify that the delete was safe and the store still operates.
EXPECT_EQ
(
testStore
.
getParam
(
"secondInt"
),
intTwo
);
...
...
@@ -106,11 +106,11 @@ TEST(ValueStorageTest, Uint32Testing) {
ASSERT_THROW
(
testStore
.
getParam
(
"bogusInt"
),
isc
::
dhcp
::
DhcpConfigError
);
// Verify that attempting to delete a parameter that never existed does not throw.
ASSER
T_NO_THROW
(
testStore
.
delParam
(
"bogusInt"
));
EXPEC
T_NO_THROW
(
testStore
.
delParam
(
"bogusInt"
));
// Verify that we can empty the list.
testStore
.
clear
();
ASSER
T_THROW
(
testStore
.
getParam
(
"secondInt"
),
isc
::
dhcp
::
DhcpConfigError
);
EXPEC
T_THROW
(
testStore
.
getParam
(
"secondInt"
),
isc
::
dhcp
::
DhcpConfigError
);
}
// This test verifies that StringStorage functions properly.
...
...
@@ -139,7 +139,7 @@ TEST(ValueStorageTest, StringTesting) {
// Verify that we can delete a parameter and it will no longer be found.
testStore
.
delParam
(
"firstString"
);
ASSER
T_THROW
(
testStore
.
getParam
(
"firstString"
),
isc
::
dhcp
::
DhcpConfigError
);
EXPEC
T_THROW
(
testStore
.
getParam
(
"firstString"
),
isc
::
dhcp
::
DhcpConfigError
);
// Verify that the delete was safe and the store still operates.
EXPECT_EQ
(
testStore
.
getParam
(
"secondString"
),
stringTwo
);
...
...
@@ -148,11 +148,11 @@ TEST(ValueStorageTest, StringTesting) {
ASSERT_THROW
(
testStore
.
getParam
(
"bogusString"
),
isc
::
dhcp
::
DhcpConfigError
);
// Verify that attempting to delete a parameter that never existed does not throw.
ASSER
T_NO_THROW
(
testStore
.
delParam
(
"bogusString"
));
EXPEC
T_NO_THROW
(
testStore
.
delParam
(
"bogusString"
));
// Verify that we can empty the list.
testStore
.
clear
();
ASSER
T_THROW
(
testStore
.
getParam
(
"secondString"
),
isc
::
dhcp
::
DhcpConfigError
);
EXPEC
T_THROW
(
testStore
.
getParam
(
"secondString"
),
isc
::
dhcp
::
DhcpConfigError
);
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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