1 /*
2  * Copyright (C) 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 
17 #ifndef CPP_EVS_MANAGER_1_1_TEST_UNIT_MOCKENUMERATORMANAGER_H_
18 #define CPP_EVS_MANAGER_1_1_TEST_UNIT_MOCKENUMERATORMANAGER_H_
19 
20 #include "IEnumeratorManager.h"
21 
22 #include <android/hardware/automotive/evs/1.1/IEvsEnumerator.h>
23 #include <gmock/gmock.h>
24 #include <gtest/gtest.h>
25 
26 #include <cstdint>
27 #include <memory>
28 #include <string_view>
29 #include <vector>
30 
31 namespace android::automotive::evs::V1_1::implementation {
32 
33 class MockEnumeratorManager : public IEnumeratorManager {
34 public:
35     MockEnumeratorManager() = default;
36     virtual ~MockEnumeratorManager() = default;
37 
38     MOCK_METHOD(std::vector<::android::hardware::automotive::evs::V1_0::CameraDesc>, getCameraList,
39                 (), (override));
40     MOCK_METHOD(std::unique_ptr<::android::hardware::automotive::evs::V1_0::IEvsCamera>, openCamera,
41                 (std::string_view), (override));
42     MOCK_METHOD(void, closeCamera, (const ::android::hardware::automotive::evs::V1_0::IEvsCamera&),
43                 (override));
44     MOCK_METHOD(std::unique_ptr<::android::hardware::automotive::evs::V1_0::IEvsDisplay>,
45                 openDisplay, (), (override));
46 
47     MOCK_METHOD(void, closeDisplay, (::android::hardware::automotive::evs::V1_0::IEvsDisplay*),
48                 (override));
49     MOCK_METHOD(::android::hardware::automotive::evs::V1_0::DisplayState, getDisplayState, (),
50                 (override));
51     MOCK_METHOD(std::vector<::android::hardware::automotive::evs::V1_1::CameraDesc>,
52                 getCameraList_1_1, (), (override));
53     MOCK_METHOD(std::unique_ptr<::android::hardware::automotive::evs::V1_1::IEvsCamera>,
54                 openCamera_1_1, (std::string, const hardware::camera::device::V3_2::Stream&),
55                 (override));
56     MOCK_METHOD(bool, isHardware, (), (override));
57     MOCK_METHOD(std::vector<std::uint8_t>, getDisplayIdList, (), (override));
58     MOCK_METHOD(std::unique_ptr<::android::hardware::automotive::evs::V1_1::IEvsDisplay>,
59                 openDisplay_1_1, (std::uint8_t), (override));
60     MOCK_METHOD(std::vector<::android::hardware::automotive::evs::V1_1::UltrasonicsArrayDesc>,
61                 getUltrasonicsArrayList, (), (override));
62     MOCK_METHOD(std::unique_ptr<::android::hardware::automotive::evs::V1_1::IEvsUltrasonicsArray>,
63                 openUltrasonicsArray, (std::string), (override));
64     MOCK_METHOD(void, closeUltrasonicsArray,
65                 (const ::android::hardware::automotive::evs::V1_1::IEvsUltrasonicsArray&),
66                 (override));
67     MOCK_METHOD(std::string, debug, (::android::hardware::hidl_handle, std::vector<std::string>),
68                 (override));
69 };
70 
71 using NiceMockEnumeratorManager = ::testing::NiceMock<MockEnumeratorManager>;
72 
73 }  // namespace android::automotive::evs::V1_1::implementation
74 
75 #endif  // CPP_EVS_MANAGER_1_1_TEST_UNIT_MOCKENUMERATORMANAGER_H_
76