]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[3112] Fix an uninit variable use warning
authorMukund Sivaraman <muks@isc.org>
Thu, 12 Sep 2013 14:04:20 +0000 (19:34 +0530)
committerMukund Sivaraman <muks@isc.org>
Thu, 12 Sep 2013 14:10:12 +0000 (19:40 +0530)
This apparently happens when gtest-1.5 is in use. Patch was reviewed by
Thomas Markwalder.

src/lib/dhcpsrv/tests/dhcp_parsers_unittest.cc

index 62f901c52f2cf66c3bb0cba1f0503d6902733b10..53e304d9bdd2e3a8a46884fca26113eba1c242a4 100644 (file)
@@ -714,9 +714,8 @@ public:
     template<typename ContainerType, typename ValueType>
     void checkValueEq(const boost::shared_ptr<ContainerType>& ref_values,
                       const boost::shared_ptr<ContainerType>& values) {
-        ValueType param;
-        ASSERT_NO_THROW(param = values->getParam("foo"));
-        EXPECT_EQ(ref_values->getParam("foo"), param);
+        ASSERT_NO_THROW(values->getParam("foo"));
+        EXPECT_EQ(ref_values->getParam("foo"), values->getParam("foo"));
     }
 
     /// @brief Check that the storages of the specific type hold different
@@ -734,9 +733,8 @@ public:
     template<typename ContainerType, typename ValueType>
     void checkValueNeq(const boost::shared_ptr<ContainerType>& ref_values,
                        const boost::shared_ptr<ContainerType>& values) {
-        ValueType param;
-        ASSERT_NO_THROW(param = values->getParam("foo"));
-        EXPECT_NE(ref_values->getParam("foo"), param);
+        ASSERT_NO_THROW(values->getParam("foo"));
+        EXPECT_NE(ref_values->getParam("foo"), values->getParam("foo"));
     }
 
     /// @brief Check that option definition storage in the context holds