summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMarcin Siodelski <marcin@isc.org>2018-06-29 21:10:13 +0200
committerMarcin Siodelski <marcin@isc.org>2018-06-29 21:10:13 +0200
commit9633a2544aba30fd6ca9b0f6f5b6a6a5db68d8cf (patch)
treef2b55cd7292a4accd1d88aa10b0ddf2f62241733 /src
parent[5664] Addressed review comments. (diff)
downloadkea-9633a2544aba30fd6ca9b0f6f5b6a6a5db68d8cf.tar.xz
kea-9633a2544aba30fd6ca9b0f6f5b6a6a5db68d8cf.zip
[5664] Improved ScopedCalloutHandleState test.
Per review comments.
Diffstat (limited to 'src')
-rw-r--r--src/lib/hooks/tests/callout_handle_unittest.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/lib/hooks/tests/callout_handle_unittest.cc b/src/lib/hooks/tests/callout_handle_unittest.cc
index 71a04847a5..319b9392b5 100644
--- a/src/lib/hooks/tests/callout_handle_unittest.cc
+++ b/src/lib/hooks/tests/callout_handle_unittest.cc
@@ -1,4 +1,4 @@
-// Copyright (C) 2013-2015 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2013-2018 Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -333,7 +333,12 @@ TEST_F(CalloutHandleTest, scopedState) {
handle->setContext("three", three);
handle->setStatus(CalloutHandle::NEXT_STEP_DROP);
+
int value = 0;
+ EXPECT_NO_THROW(handle->getArgument("one", value));
+ EXPECT_NO_THROW(handle->getArgument("two", value));
+ EXPECT_NO_THROW(handle->getContext("three", value));
+ EXPECT_EQ(CalloutHandle::NEXT_STEP_DROP, handle->getStatus());
{
// Wrap the callout handle with the scoped state object, which should
@@ -355,6 +360,10 @@ TEST_F(CalloutHandleTest, scopedState) {
handle->setArgument("one", one);
handle->setArgument("two", two);
handle->setStatus(CalloutHandle::NEXT_STEP_DROP);
+
+ EXPECT_NO_THROW(handle->getArgument("one", value));
+ EXPECT_NO_THROW(handle->getArgument("two", value));
+ EXPECT_EQ(CalloutHandle::NEXT_STEP_DROP, handle->getStatus());
}
// Arguments should be gone again and the status should be set to