1 /*
2  * Copyright 2021 HIMSA II K/S - www.himsa.dk.
3  * Represented by EHIMA - www.ehima.com
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *      http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17 
18 #include "mock_csis_client.h"
19 
20 static MockCsisClient* mock_csis_client;
21 
SetMockInstanceForTesting(MockCsisClient * mock)22 void MockCsisClient::SetMockInstanceForTesting(MockCsisClient* mock) { mock_csis_client = mock; }
23 
Initialize(bluetooth::csis::CsisClientCallbacks * callbacks,base::Closure initCb)24 void bluetooth::csis::CsisClient::Initialize(bluetooth::csis::CsisClientCallbacks* callbacks,
25                                              base::Closure initCb) {
26   log::assert_that(mock_csis_client, "Mock CsisClient interface not set!");
27   mock_csis_client->Initialize(callbacks, initCb);
28 }
29 
CleanUp()30 void bluetooth::csis::CsisClient::CleanUp() {
31   log::assert_that(mock_csis_client, "Mock CsisClient interface not set!");
32   mock_csis_client->CleanUp();
33 }
34 
Get()35 bluetooth::csis::CsisClient* bluetooth::csis::CsisClient::Get() {
36   log::assert_that(mock_csis_client, "Mock CsisClient interface not set!");
37   return mock_csis_client->Get();
38 }
39 
DebugDump(int fd)40 void bluetooth::csis::CsisClient::DebugDump(int fd) {
41   log::assert_that(mock_csis_client, "Mock CsisClient interface not set!");
42   mock_csis_client->DebugDump(fd);
43 }
44 
IsCsisClientRunning()45 bool bluetooth::csis::CsisClient::IsCsisClientRunning() {
46   log::assert_that(mock_csis_client, "Mock CsisClient interface not set!");
47   return mock_csis_client->IsCsisClientRunning();
48 }
49