summaryrefslogtreecommitdiff
path: root/cras/src/tests/bt_io_unittest.cc
diff options
context:
space:
mode:
authorHsin-Yu Chao <hychao@chromium.org>2014-08-20 11:58:09 +0800
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-12-16 20:29:58 +0000
commit0d17ce053a25f0c1bb7c15573a4253372d95c8e9 (patch)
tree0c7ff80b653953fdfb438f7d15d8d68df7b941ea /cras/src/tests/bt_io_unittest.cc
parent5f8889ab0bc94adba368f593232b0355744956d8 (diff)
downloadadhd-0d17ce053a25f0c1bb7c15573a4253372d95c8e9.tar.gz
CRAS: bt_io - Add bt_io to cras_bt_device
Make cras_bt_device holds a list of iodev of different stream direction and add functions to append or remove profile specific iodev to/from a cras_bt_device. In later changes, a2dp and hfp/hsp iodev will not add to iodev_list directly but instead append to the corresponding cras_bt_device and operates behind the bt_io wrapper. BUG=chromium:432434 TEST=unittest Change-Id: Iefe20a689f394f9d40849e82ff5410c04ae39232 Reviewed-on: https://chromium-review.googlesource.com/231868 Reviewed-by: Dylan Reid <dgreid@chromium.org> Commit-Queue: Hsinyu Chao <hychao@chromium.org> Tested-by: Hsinyu Chao <hychao@chromium.org>
Diffstat (limited to 'cras/src/tests/bt_io_unittest.cc')
-rw-r--r--cras/src/tests/bt_io_unittest.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/cras/src/tests/bt_io_unittest.cc b/cras/src/tests/bt_io_unittest.cc
index 94a30b09..626971d6 100644
--- a/cras/src/tests/bt_io_unittest.cc
+++ b/cras/src/tests/bt_io_unittest.cc
@@ -10,6 +10,8 @@ extern "C" {
#include "cras_bt_io.c"
}
+static struct cras_bt_device *fake_device =
+ reinterpret_cast<struct cras_bt_device*>(0x123);
static unsigned int cras_iodev_add_node_called;
static unsigned int cras_iodev_rm_node_called;
static unsigned int cras_iodev_free_format_called;
@@ -148,7 +150,8 @@ TEST_F(BtIoBasicSuite, CreateBtIo) {
struct cras_audio_area *fake_area;
struct cras_audio_format fake_fmt;
unsigned fr;
- bt_iodev = cras_bt_io_create(&iodev_, CRAS_BT_DEVICE_PROFILE_A2DP_SOURCE);
+ bt_iodev = cras_bt_io_create(fake_device, &iodev_,
+ CRAS_BT_DEVICE_PROFILE_A2DP_SOURCE);
EXPECT_NE((void *)NULL, bt_iodev);
EXPECT_EQ(&iodev_, active_profile_dev(bt_iodev));
EXPECT_EQ(1, cras_iodev_list_add_output_called);