From: Marcin Siodelski Date: Fri, 29 Jun 2018 19:10:13 +0000 (+0200) Subject: [5664] Improved ScopedCalloutHandleState test. X-Git-Tag: trac5555_base~1^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9633a2544aba30fd6ca9b0f6f5b6a6a5db68d8cf;p=thirdparty%2Fkea.git [5664] Improved ScopedCalloutHandleState test. Per review comments. --- 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