aboutsummaryrefslogtreecommitdiff
path: root/client/i2c_unittest.cc
diff options
context:
space:
mode:
Diffstat (limited to 'client/i2c_unittest.cc')
-rw-r--r--client/i2c_unittest.cc10
1 files changed, 7 insertions, 3 deletions
diff --git a/client/i2c_unittest.cc b/client/i2c_unittest.cc
index fd04563..c1f6a97 100644
--- a/client/i2c_unittest.cc
+++ b/client/i2c_unittest.cc
@@ -16,6 +16,8 @@
#include <memory>
+#include <binderwrapper/binder_test_base.h>
+#include <binderwrapper/stub_binder_wrapper.h>
#include <gtest/gtest.h>
#include "fake_devices.h"
@@ -32,10 +34,13 @@ using android::I2cDriverInfoBase;
using android::I2cManager;
using android::PeripheralManager;
-class I2cTest : public ::testing::Test {
+class I2cTest : public android::BinderTestBase {
public:
void SetUp() {
- pman_.InitForTest();
+ android::sp<PeripheralManager> pman(new PeripheralManager);
+ android::String8 interface_desc(pman->getInterfaceDescriptor());
+ binder_wrapper()->SetBinderForService(interface_desc.string(), pman);
+
I2cManager* man = I2cManager::GetI2cManager();
man->RegisterDriver(std::unique_ptr<I2cDriverInfoBase>(
new I2cDriverInfo<I2cDriverI2cDev, CharDeviceFactory*>(
@@ -48,7 +53,6 @@ class I2cTest : public ::testing::Test {
void TearDown() { I2cManager::ResetI2cManager(); }
private:
- PeripheralManager pman_;
FakeDeviceFactory char_device_factory_;
};