shill: Remove IPConfig/DHCPConfig's dependency on Device.
They care about the device name only so use that instead. This eliminates the
need for some circular dependencies.
BUG=chromium-os:16796
TEST=unit tests
Change-Id: Ibfa4eacac2b04b9311abfb76972aaf032c6013aa
Reviewed-on: http://gerrit.chromium.org/gerrit/2943
Reviewed-by: Darin Petkov <petkov@chromium.org>
Tested-by: Darin Petkov <petkov@chromium.org>
diff --git a/ipconfig_unittest.cc b/ipconfig_unittest.cc
index efb565f..b20cfc1 100644
--- a/ipconfig_unittest.cc
+++ b/ipconfig_unittest.cc
@@ -3,29 +3,28 @@
// found in the LICENSE file.
#include <base/callback_old.h>
+#include <gtest/gtest.h>
#include "shill/ipconfig.h"
-#include "shill/mock_control.h"
-#include "shill/mock_device.h"
using testing::Test;
namespace shill {
+namespace {
+const char kDeviceName[] = "testdevice";
+} // namespace {}
+
class IPConfigTest : public Test {
public:
- IPConfigTest()
- : device_(new MockDevice(&control_interface_, NULL, NULL, "testname", 0)),
- ipconfig_(new IPConfig(device_)) {}
+ IPConfigTest() : ipconfig_(new IPConfig(kDeviceName)) {}
protected:
- MockControl control_interface_;
- scoped_refptr<const MockDevice> device_;
IPConfigRefPtr ipconfig_;
};
-TEST_F(IPConfigTest, GetDeviceName) {
- EXPECT_EQ("testname", ipconfig_->GetDeviceName());
+TEST_F(IPConfigTest, DeviceName) {
+ EXPECT_EQ(kDeviceName, ipconfig_->device_name());
}
TEST_F(IPConfigTest, RequestIP) {