/* * 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. */ #include "TestMissionStateMock.h" #include "AppMonitorMock.h" #include "ILog.h" StatusCode TestMissionStateTest::GetProductInfo(AppGetProductInfo ¶m) { LogInfo("TestMissionStateTest::GetProductInfo\n"); StatusCode code = GetProductInfoTrace(param); if (StatusCodeEqual(code, "STATUS_CODE_VIRTUAL_FUNCTION")) { return AppMonitor::GetProductInfo(param); } return code; } StatusCode TestMissionStateTest::GetDeviceAttr(AppGetDeviceAttr ¶m) { LogInfo("TestMissionStateTest::GetDeviceAttr\n"); StatusCode code = GetDeviceAttrTrace(param); if (StatusCodeEqual(code, "STATUS_CODE_VIRTUAL_FUNCTION")) { return AppMonitor::GetDeviceAttr(param); } return code; } StatusCode TestMissionStateTest::GetMediaInfo(AppGetMeidaInfo ¶m) { LogInfo("TestMissionStateTest::GetMediaInfo\n"); StatusCode code = GetMediaInfoTrace(param); if (StatusCodeEqual(code, "STATUS_CODE_VIRTUAL_FUNCTION")) { return AppMonitor::GetMediaInfo(param); } return code; } StatusCode TestMissionStateTest::GetSdCardInfo(AppGetSdCardInfo ¶m) { LogInfo("TestMissionStateTest::GetSdCardInfo\n"); StatusCode code = GetSdCardInfoTrace(param); if (StatusCodeEqual(code, "STATUS_CODE_VIRTUAL_FUNCTION")) { return AppMonitor::GetSdCardInfo(param); } return code; } StatusCode TestMissionStateTest::GetBatteryInfo(AppGetBatteryInfo ¶m) { LogInfo("TestMissionStateTest::GetBatteryInfo\n"); StatusCode code = GetBatteryInfoTrace(param); if (StatusCodeEqual(code, "STATUS_CODE_VIRTUAL_FUNCTION")) { return AppMonitor::GetBatteryInfo(param); } return code; } StatusCode TestMissionStateTest::SetDateTime(AppSetDateTime ¶m) { LogInfo("TestMissionStateTest::SetDateTime\n"); LogInfo("mYear = %u\n", param.mYear); LogInfo("mMonth = %02u\n", param.mMonth); LogInfo("mDay = %02u\n", param.mDay); LogInfo("mHour = %02u\n", param.mHour); LogInfo("mMinute = %02u\n", param.mMinute); LogInfo("mSecond = %02u\n", param.mSecond); StatusCode code = SetDateTimeTrace(param); if (StatusCodeEqual(code, "STATUS_CODE_VIRTUAL_FUNCTION")) { return AppMonitor::SetDateTime(param); } return code; } StatusCode TestMissionStateTest::SetTimeZone(const unsigned int &zone) { LogInfo("TestMissionStateTest::SetTimeZone = %u\n", zone); StatusCode code = SetTimeZoneTrace(zone); if (StatusCodeEqual(code, "STATUS_CODE_VIRTUAL_FUNCTION")) { return AppMonitor::SetTimeZone(zone); } return code; } StatusCode TestMissionStateTest::UploadFile(AppUploadFile ¶m) { LogInfo("TestMissionStateTest::UploadFile\n"); StatusCode code = UploadFileTrace(param); if (StatusCodeEqual(code, "STATUS_CODE_VIRTUAL_FUNCTION")) { return AppMonitor::UploadFile(param); } return code; }