• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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) {
23   mock_csis_client = mock;
24 }
25 
Initialize(bluetooth::csis::CsisClientCallbacks * callbacks,base::Closure initCb)26 void bluetooth::csis::CsisClient::Initialize(
27     bluetooth::csis::CsisClientCallbacks* callbacks, base::Closure initCb) {
28   log::assert_that(mock_csis_client, "Mock CsisClient interface not set!");
29   mock_csis_client->Initialize(callbacks, initCb);
30 }
31 
CleanUp()32 void bluetooth::csis::CsisClient::CleanUp() {
33   log::assert_that(mock_csis_client, "Mock CsisClient interface not set!");
34   mock_csis_client->CleanUp();
35 }
36 
Get()37 bluetooth::csis::CsisClient* bluetooth::csis::CsisClient::Get() {
38   log::assert_that(mock_csis_client, "Mock CsisClient interface not set!");
39   return mock_csis_client->Get();
40 }
41 
DebugDump(int fd)42 void bluetooth::csis::CsisClient::DebugDump(int fd) {
43   log::assert_that(mock_csis_client, "Mock CsisClient interface not set!");
44   mock_csis_client->DebugDump(fd);
45 }
46 
IsCsisClientRunning()47 bool bluetooth::csis::CsisClient::IsCsisClientRunning() {
48   log::assert_that(mock_csis_client, "Mock CsisClient interface not set!");
49   return mock_csis_client->IsCsisClientRunning();
50 }
51