class StackBtmTest : public Test {
public:
protected:
- void SetUp() override {}
+ void SetUp() override { mock_function_count_map.clear(); }
void TearDown() override {}
};
delete btm;
}
-TEST_F(StackBtmTest, InformBtmOnConnection) {
+TEST_F(StackBtmTest, InformClientOnConnectionSuccess) {
MOCK_bluetooth_shim_is_gd_acl_enabled_ = true;
get_btm_client_interface().lifecycle.btm_init();
get_btm_client_interface().lifecycle.btm_free();
}
+TEST_F(StackBtmTest, NoInformClientOnConnectionFail) {
+ MOCK_bluetooth_shim_is_gd_acl_enabled_ = true;
+
+ get_btm_client_interface().lifecycle.btm_init();
+
+ RawAddress bda({0x11, 0x22, 0x33, 0x44, 0x55, 0x66});
+
+ btm_acl_connected(bda, 2, HCI_ERR_NO_CONNECTION, false);
+ ASSERT_EQ(static_cast<size_t>(0),
+ mock_function_count_map.count("BTA_dm_acl_up"));
+
+ get_btm_client_interface().lifecycle.btm_free();
+}
+
} // namespace