hunting/test/hal/tool/src/HalCppMock.h
2024-04-25 22:51:38 +08:00

45 lines
2.0 KiB
C++

/*
* Copyright (c) 2023 Fancy Code.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#ifndef HAL_CPP_MOCK_H
#define HAL_CPP_MOCK_H
#include "HalCpp.h"
#include "HalTestTool.h"
class HalCppTest : public HalCpp
{
public:
HalCppTest() = default;
virtual ~HalCppTest() = default;
StatusCode GetAllLeds(std::map<std::string, std::shared_ptr<VLedHal>> &allLeds) override;
StatusCode GetAllKeys(std::map<std::string, std::shared_ptr<VKeyHal>> &allKeys) override;
StatusCode GetWifiHal(std::shared_ptr<VWifiHal> &wifi) override;
StatusCode GetCameraHal(std::map<CameraType, std::shared_ptr<VCameraHal>> &allCameras) override;
protected:
virtual StatusCode GetAllLedsTrace(std::map<std::string, std::shared_ptr<VLedHal>> &allLeds);
virtual StatusCode GetAllKeysTrace(std::map<std::string, std::shared_ptr<VKeyHal>> &allKeys);
virtual StatusCode GetWifiHalTrace(std::shared_ptr<VWifiHal> &wifi);
virtual StatusCode GetCameraHalTrace(std::map<CameraType, std::shared_ptr<VCameraHal>> &allCameras);
};
class HalCppMock : public HalCppTest
{
public:
HalCppMock() = default;
virtual ~HalCppMock() = default;
MOCK_METHOD1(GetAllLedsTrace, StatusCode(std::map<std::string, std::shared_ptr<VLedHal>> &));
MOCK_METHOD1(GetAllKeysTrace, StatusCode(std::map<std::string, std::shared_ptr<VKeyHal>> &));
MOCK_METHOD1(GetWifiHalTrace, StatusCode(std::shared_ptr<VWifiHal> &));
MOCK_METHOD1(GetCameraHalTrace, StatusCode(std::map<CameraType, std::shared_ptr<VCameraHal>> &));
};
#endif