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 #pragma once 17 18 #include <gmock/gmock.h> 19 20 #include <memory> 21 22 #include "hci/address.h" 23 #include "hci/distance_measurement_manager.h" 24 25 // Unit test interfaces 26 namespace bluetooth { 27 namespace hci { 28 29 struct DistanceMeasurementManager::impl : public bluetooth::hci::LeAddressManagerCallback {}; 30 31 namespace testing { 32 33 class MockDistanceMeasurementCallbacks : public DistanceMeasurementCallbacks { 34 MOCK_METHOD(void, OnDistanceMeasurementStarted, (Address, DistanceMeasurementMethod)); 35 MOCK_METHOD( 36 void, 37 OnDistanceMeasurementStartFail, 38 (Address, DistanceMeasurementErrorCode, DistanceMeasurementMethod)); 39 MOCK_METHOD( 40 void, 41 OnDistanceMeasurementStopped, 42 (Address, DistanceMeasurementErrorCode, DistanceMeasurementMethod)); 43 MOCK_METHOD( 44 void, 45 OnDistanceMeasurementResult, 46 (Address, uint32_t, uint32_t, int, int, int, int, DistanceMeasurementMethod)); 47 }; 48 49 class MockDistanceMeasurementManager : public DistanceMeasurementManager { 50 public: 51 MOCK_METHOD(void, RegisterDistanceMeasurementCallbacks, (DistanceMeasurementCallbacks*)); 52 MOCK_METHOD(void, StartDistanceMeasurement, (Address, uint16_t, DistanceMeasurementMethod)); 53 }; 54 55 } // namespace testing 56 } // namespace hci 57 } // namespace bluetooth 58