1 /*
2 * Copyright 2022 The Android Open Source Project
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16
17 #include <gmock/gmock.h>
18 #include <gtest/gtest.h>
19
20 #include "bta/dm/bta_dm_disc_int.h"
21 #include "bta/test/bta_test_fixtures.h"
22
23 void BTA_dm_on_hw_on();
24 void BTA_dm_on_hw_off();
25
26 namespace {
27 const char kName[] = "Hello";
28 }
29
30 namespace bluetooth {
31 namespace legacy {
32 namespace testing {
33
34 tBTA_DM_SERVICE_DISCOVERY_CB& bta_dm_discovery_cb();
35 void bta_dm_sdp_result(tSDP_STATUS sdp_status, tBTA_DM_SDP_STATE* state);
36
37 } // namespace testing
38 } // namespace legacy
39 } // namespace bluetooth
40
41 class BtaSdpTest : public BtaWithHwOnTest {
42 protected:
SetUp()43 void SetUp() override { BtaWithHwOnTest::SetUp(); }
44
TearDown()45 void TearDown() override { BtaWithHwOnTest::TearDown(); }
46 };
47
48 class BtaSdpRegisteredTest : public BtaSdpTest {
49 protected:
SetUp()50 void SetUp() override { BtaSdpTest::SetUp(); }
51
TearDown()52 void TearDown() override { BtaSdpTest::TearDown(); }
53 };
54
TEST_F(BtaSdpTest,nop)55 TEST_F(BtaSdpTest, nop) {}
56
TEST_F(BtaSdpRegisteredTest,bta_dm_sdp_result_SDP_SUCCESS)57 TEST_F(BtaSdpRegisteredTest, bta_dm_sdp_result_SDP_SUCCESS) {
58 std::unique_ptr<tBTA_DM_SDP_STATE> state =
59 std::make_unique<tBTA_DM_SDP_STATE>(
60 tBTA_DM_SDP_STATE{.service_index = BTA_MAX_SERVICE_ID});
61 bluetooth::legacy::testing::bta_dm_sdp_result(SDP_SUCCESS, state.get());
62 }
63