• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2017 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 "utils-fake.h"
18 
19 namespace android {
20 namespace vintf {
21 namespace details {
22 
23 // Do not create the mock objects here as InitGoogleMock must be called
24 // first.
25 FileFetcher* gFetcher = nullptr;
26 
27 PartitionMounter* gPartitionMounter = nullptr;
28 
29 ObjectFactory<RuntimeInfo>* gRuntimeInfoFactory = nullptr;
30 
MockPropertyFetcher()31 MockPropertyFetcher::MockPropertyFetcher() {
32     using namespace ::testing;
33     using namespace std::placeholders;
34     ON_CALL(*this, getProperty(_, _))
35         .WillByDefault(Invoke(std::bind(&PropertyFetcher::getProperty, real_, _1, _2)));
36 }
37 
38 MockPropertyFetcher* gPropertyFetcher = nullptr;
getPropertyFetcher()39 const PropertyFetcher& getPropertyFetcher() {
40     return *gPropertyFetcher;
41 }
42 
43 }  // namespace details
44 }  // namespace vintf
45 }  // namespace android
46