Browse Source

[3112] Fix an uninit variable use warning

This apparently happens when gtest-1.5 is in use. Patch was reviewed by
Thomas Markwalder.
Mukund Sivaraman 11 years ago
parent
commit
384b365bc6
1 changed files with 4 additions and 6 deletions
  1. 4 6
      src/lib/dhcpsrv/tests/dhcp_parsers_unittest.cc

+ 4 - 6
src/lib/dhcpsrv/tests/dhcp_parsers_unittest.cc

@@ -714,9 +714,8 @@ public:
     template<typename ContainerType, typename ValueType>
     template<typename ContainerType, typename ValueType>
     void checkValueEq(const boost::shared_ptr<ContainerType>& ref_values,
     void checkValueEq(const boost::shared_ptr<ContainerType>& ref_values,
                       const boost::shared_ptr<ContainerType>& 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
     /// @brief Check that the storages of the specific type hold different
@@ -734,9 +733,8 @@ public:
     template<typename ContainerType, typename ValueType>
     template<typename ContainerType, typename ValueType>
     void checkValueNeq(const boost::shared_ptr<ContainerType>& ref_values,
     void checkValueNeq(const boost::shared_ptr<ContainerType>& ref_values,
                        const boost::shared_ptr<ContainerType>& 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
     /// @brief Check that option definition storage in the context holds