[shill] Use composition instead of inheritance with PropertyStore
Instead of having Device, Manager, etc all inherit from PropertyStore
and have it be difficult to follow the getting/setting property code,
have each include a PropertyStore as a data member. Provide an
accessor so that RPC adaptor classes can get and set properties
directly and continue to handle any necessary type conversion
themselves.
BUG=None
TEST=unit tests
Change-Id: I34781bde4de0e152550ca636e28d472abde756af
Reviewed-on: http://gerrit.chromium.org/gerrit/3616
Tested-by: Chris Masone <cmasone@chromium.org>
Reviewed-by: Darin Petkov <petkov@chromium.org>
diff --git a/dhcp_config_unittest.cc b/dhcp_config_unittest.cc
index 4d736f6..24b1cee 100644
--- a/dhcp_config_unittest.cc
+++ b/dhcp_config_unittest.cc
@@ -286,13 +286,13 @@
}
TEST_F(DHCPConfigTest, Dispatch) {
- EXPECT_TRUE(DBusAdaptor::DispatchOnType(config_.get(),
+ EXPECT_TRUE(DBusAdaptor::DispatchOnType(config_->store(),
flimflam::kMtuProperty,
PropertyStoreTest::kInt32V,
NULL));
::DBus::Error error;
// Ensure that an attempt to write a R/O property returns InvalidArgs error.
- EXPECT_FALSE(DBusAdaptor::DispatchOnType(config_.get(),
+ EXPECT_FALSE(DBusAdaptor::DispatchOnType(config_->store(),
flimflam::kAddressProperty,
PropertyStoreTest::kStringV,
&error));