]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[5664] Improved ScopedCalloutHandleState test.
authorMarcin Siodelski <marcin@isc.org>
Fri, 29 Jun 2018 19:10:13 +0000 (21:10 +0200)
committerMarcin Siodelski <marcin@isc.org>
Fri, 29 Jun 2018 19:10:13 +0000 (21:10 +0200)
Per review comments.

src/lib/hooks/tests/callout_handle_unittest.cc

index 71a04847a54e5d4474d4763b3a8c21089e25a76c..319b9392b58184b4c0ff115c5c6c35fe33d80636 100644 (file)
@@ -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