1 /*
2  * Copyright 2019 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 <gtest/gtest.h>
18 
19 #include <chrono>
20 #include <future>
21 
22 #include "hal/hci_hal.h"
23 #include "os/thread.h"
24 
25 using ::bluetooth::os::Thread;
26 
27 namespace bluetooth {
28 namespace hal {
29 namespace {
30 
31 class HciHalHidlTest : public ::testing::Test {
32  protected:
SetUp()33   void SetUp() override {
34     thread_ = new Thread("test_thread", Thread::Priority::NORMAL);
35   }
36 
TearDown()37   void TearDown() override {
38     delete thread_;
39   }
40 
41   ModuleRegistry fake_registry_;
42   Thread* thread_;
43 };
44 
TEST_F(HciHalHidlTest,init_and_close)45 TEST_F(HciHalHidlTest, init_and_close) {
46   fake_registry_.Start<HciHal>(thread_);
47   fake_registry_.StopAll();
48 }
49 }  // namespace
50 }  // namespace hal
51 }  // namespace bluetooth
52