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