Fixed:compile error.
This commit is contained in:
parent
402baf38f9
commit
1b22cd3f63
28
application/MissionManager/src/TestMissionState.cpp
Normal file
28
application/MissionManager/src/TestMissionState.cpp
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
/*
|
||||||
|
* 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 "TestMissionState.h"
|
||||||
|
#include "ILog.h"
|
||||||
|
TestMissionState::TestMissionState() : State("TestMissionState") {}
|
||||||
|
void TestMissionState::GoInState()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
LogInfo(" ========== TestMissionState::GoInState.\n");
|
||||||
|
}
|
||||||
|
void TestMissionState::GoOutState()
|
||||||
|
{
|
||||||
|
//
|
||||||
|
LogInfo(" ========== TestMissionState::GoOutState.\n");
|
||||||
|
}
|
||||||
|
bool TestMissionState::ExecuteStateMsg(VStateMachineData *msg) { return DataProcessing::EventHandle(msg); }
|
28
application/MissionManager/src/TestMissionState.h
Normal file
28
application/MissionManager/src/TestMissionState.h
Normal file
|
@ -0,0 +1,28 @@
|
||||||
|
/*
|
||||||
|
* 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 TEST_MISSION_STATE_H
|
||||||
|
#define TEST_MISSION_STATE_H
|
||||||
|
#include "DataProcessing.h"
|
||||||
|
#include "IStateMachine.h"
|
||||||
|
class TestMissionState : public State, public DataProcessing
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
TestMissionState();
|
||||||
|
virtual ~TestMissionState() = default;
|
||||||
|
void GoInState() override;
|
||||||
|
void GoOutState() override;
|
||||||
|
bool ExecuteStateMsg(VStateMachineData *msg) override;
|
||||||
|
};
|
||||||
|
#endif
|
|
@ -12,8 +12,8 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
#ifndef TOPSTATE_H
|
#ifndef TOP_STATE_H
|
||||||
#define TOPSTATE_H
|
#define TOP_STATE_H
|
||||||
#include "DataProcessing.h"
|
#include "DataProcessing.h"
|
||||||
#include "IStateMachine.h"
|
#include "IStateMachine.h"
|
||||||
class TopState : public State, public DataProcessing
|
class TopState : public State, public DataProcessing
|
||||||
|
|
|
@ -14,38 +14,26 @@
|
||||||
*/
|
*/
|
||||||
#include "IAppManager.h"
|
#include "IAppManager.h"
|
||||||
#include "ILog.h"
|
#include "ILog.h"
|
||||||
StatusCode inline VAppMonitor::GetProductInfo(AppGetProductInfo ¶m)
|
StatusCode VAppMonitor::GetProductInfo(AppGetProductInfo ¶m)
|
||||||
{
|
{
|
||||||
return CreateStatusCode(STATUS_CODE_VIRTUAL_FUNCTION);
|
return CreateStatusCode(STATUS_CODE_VIRTUAL_FUNCTION);
|
||||||
}
|
}
|
||||||
StatusCode inline VAppMonitor::GetDeviceAttr(AppGetDeviceAttr ¶m)
|
StatusCode VAppMonitor::GetDeviceAttr(AppGetDeviceAttr ¶m)
|
||||||
{
|
{
|
||||||
return CreateStatusCode(STATUS_CODE_VIRTUAL_FUNCTION);
|
return CreateStatusCode(STATUS_CODE_VIRTUAL_FUNCTION);
|
||||||
}
|
}
|
||||||
StatusCode inline VAppMonitor::GetMediaInfo(AppGetMeidaInfo ¶m)
|
StatusCode VAppMonitor::GetMediaInfo(AppGetMeidaInfo ¶m) { return CreateStatusCode(STATUS_CODE_VIRTUAL_FUNCTION); }
|
||||||
|
StatusCode VAppMonitor::GetSdCardInfo(AppGetSdCardInfo ¶m)
|
||||||
{
|
{
|
||||||
return CreateStatusCode(STATUS_CODE_VIRTUAL_FUNCTION);
|
return CreateStatusCode(STATUS_CODE_VIRTUAL_FUNCTION);
|
||||||
}
|
}
|
||||||
StatusCode inline VAppMonitor::GetSdCardInfo(AppGetSdCardInfo ¶m)
|
StatusCode VAppMonitor::GetBatteryInfo(AppGetBatteryInfo ¶m)
|
||||||
{
|
|
||||||
return CreateStatusCode(STATUS_CODE_VIRTUAL_FUNCTION);
|
|
||||||
}
|
|
||||||
StatusCode inline VAppMonitor::GetBatteryInfo(AppGetBatteryInfo ¶m)
|
|
||||||
{
|
|
||||||
return CreateStatusCode(STATUS_CODE_VIRTUAL_FUNCTION);
|
|
||||||
}
|
|
||||||
StatusCode inline VAppMonitor::SetDateTime(AppSetDateTime ¶m)
|
|
||||||
{
|
|
||||||
return CreateStatusCode(STATUS_CODE_VIRTUAL_FUNCTION);
|
|
||||||
}
|
|
||||||
StatusCode inline VAppMonitor::SetTimeZone(const unsigned int &zone)
|
|
||||||
{
|
|
||||||
return CreateStatusCode(STATUS_CODE_VIRTUAL_FUNCTION);
|
|
||||||
}
|
|
||||||
StatusCode inline VAppMonitor::UploadFile(AppUploadFile ¶m)
|
|
||||||
{
|
{
|
||||||
return CreateStatusCode(STATUS_CODE_VIRTUAL_FUNCTION);
|
return CreateStatusCode(STATUS_CODE_VIRTUAL_FUNCTION);
|
||||||
}
|
}
|
||||||
|
StatusCode VAppMonitor::SetDateTime(AppSetDateTime ¶m) { return CreateStatusCode(STATUS_CODE_VIRTUAL_FUNCTION); }
|
||||||
|
StatusCode VAppMonitor::SetTimeZone(const unsigned int &zone) { return CreateStatusCode(STATUS_CODE_VIRTUAL_FUNCTION); }
|
||||||
|
StatusCode VAppMonitor::UploadFile(AppUploadFile ¶m) { return CreateStatusCode(STATUS_CODE_VIRTUAL_FUNCTION); }
|
||||||
std::shared_ptr<IAppManager> &IAppManager::GetInstance(std::shared_ptr<IAppManager> *impl)
|
std::shared_ptr<IAppManager> &IAppManager::GetInstance(std::shared_ptr<IAppManager> *impl)
|
||||||
{
|
{
|
||||||
static auto instance = std::make_shared<IAppManager>();
|
static auto instance = std::make_shared<IAppManager>();
|
||||||
|
|
|
@ -20,54 +20,4 @@
|
||||||
#include <thread>
|
#include <thread>
|
||||||
namespace HunttingCameraTest
|
namespace HunttingCameraTest
|
||||||
{
|
{
|
||||||
class HunttingCameraTest : public testing::Test, public TestManager, public McuManagerTestTool
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
HunttingCameraTest() {}
|
|
||||||
virtual ~HunttingCameraTest() {}
|
|
||||||
static void SetUpTestCase()
|
|
||||||
{
|
|
||||||
CreateLogModule();
|
|
||||||
ILogInit(LOG_INSTANCE_TYPE_END);
|
|
||||||
}
|
|
||||||
static void TearDownTestCase() { ILogUnInit(); }
|
|
||||||
virtual void SetUp()
|
|
||||||
{
|
|
||||||
// CreateAllKeysMcok();
|
|
||||||
// HalTestTool::Init();
|
|
||||||
// HunttingCameraTestTool::Init();
|
|
||||||
// CreateHalCppModule();
|
|
||||||
// CreateDeviceManagerModule();
|
|
||||||
mLinuxTest = LinuxTest::CreateLinuxTest();
|
|
||||||
std::shared_ptr<LinuxApiMock> test = mLinuxTest;
|
|
||||||
LinuxApiMock::GetInstance(&test);
|
|
||||||
LinuxApiMock::GetInstance()->Init();
|
|
||||||
McuManagerTestTool::Init(mLinuxTest);
|
|
||||||
TestManager::Init();
|
|
||||||
}
|
|
||||||
virtual void TearDown()
|
|
||||||
{
|
|
||||||
// HalTestTool::UnInit();
|
|
||||||
// HunttingCameraTestTool::UnInit();
|
|
||||||
// DestroyDeviceManagerModule();
|
|
||||||
// DestroyAllKeysMock();
|
|
||||||
TestManager::UnInit();
|
|
||||||
LinuxApiMock::GetInstance()->UnInit();
|
|
||||||
mLinuxTest = std::make_shared<LinuxTest>();
|
|
||||||
std::shared_ptr<LinuxApiMock> test = std::make_shared<LinuxApiMock>();
|
|
||||||
LinuxApiMock::GetInstance(&test);
|
|
||||||
McuManagerTestTool::UnInit();
|
|
||||||
MainThread::GetInstance()->UnInit();
|
|
||||||
}
|
|
||||||
|
|
||||||
public:
|
|
||||||
std::shared_ptr<LinuxTest> mLinuxTest;
|
|
||||||
};
|
|
||||||
// ../output_files/test/bin/HunttingCameraTest --gtest_filter=HunttingCameraTest.INTEGRATION_DeviceManager_EXAMPLE_Demo
|
|
||||||
TEST_F(HunttingCameraTest, INTEGRATION_DeviceManager_EXAMPLE_Demo)
|
|
||||||
{
|
|
||||||
MainThread::GetInstance()->Init();
|
|
||||||
TestManager::ResetTimeOut(1000 * 3);
|
|
||||||
MainThread::GetInstance()->Runing();
|
|
||||||
}
|
|
||||||
} // namespace HunttingCameraTest
|
} // namespace HunttingCameraTest
|
|
@ -0,0 +1,73 @@
|
||||||
|
/*
|
||||||
|
* 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 "GtestUsing.h"
|
||||||
|
#include "ILog.h"
|
||||||
|
#include "MainThread.h"
|
||||||
|
#include "McuManagerTestTool.h"
|
||||||
|
#include "TestManager.h"
|
||||||
|
#include <thread>
|
||||||
|
namespace HunttingCameraTest
|
||||||
|
{
|
||||||
|
class HunttingCameraTest : public testing::Test, public TestManager, public McuManagerTestTool
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
HunttingCameraTest() {}
|
||||||
|
virtual ~HunttingCameraTest() {}
|
||||||
|
static void SetUpTestCase()
|
||||||
|
{
|
||||||
|
CreateLogModule();
|
||||||
|
ILogInit(LOG_INSTANCE_TYPE_END);
|
||||||
|
}
|
||||||
|
static void TearDownTestCase() { ILogUnInit(); }
|
||||||
|
virtual void SetUp()
|
||||||
|
{
|
||||||
|
// CreateAllKeysMcok();
|
||||||
|
// HalTestTool::Init();
|
||||||
|
// HunttingCameraTestTool::Init();
|
||||||
|
// CreateHalCppModule();
|
||||||
|
// CreateDeviceManagerModule();
|
||||||
|
mLinuxTest = LinuxTest::CreateLinuxTest();
|
||||||
|
std::shared_ptr<LinuxApiMock> test = mLinuxTest;
|
||||||
|
LinuxApiMock::GetInstance(&test);
|
||||||
|
LinuxApiMock::GetInstance()->Init();
|
||||||
|
McuManagerTestTool::Init(mLinuxTest);
|
||||||
|
TestManager::Init();
|
||||||
|
}
|
||||||
|
virtual void TearDown()
|
||||||
|
{
|
||||||
|
// HalTestTool::UnInit();
|
||||||
|
// HunttingCameraTestTool::UnInit();
|
||||||
|
// DestroyDeviceManagerModule();
|
||||||
|
// DestroyAllKeysMock();
|
||||||
|
TestManager::UnInit();
|
||||||
|
LinuxApiMock::GetInstance()->UnInit();
|
||||||
|
mLinuxTest = std::make_shared<LinuxTest>();
|
||||||
|
std::shared_ptr<LinuxApiMock> test = std::make_shared<LinuxApiMock>();
|
||||||
|
LinuxApiMock::GetInstance(&test);
|
||||||
|
McuManagerTestTool::UnInit();
|
||||||
|
MainThread::GetInstance()->UnInit();
|
||||||
|
}
|
||||||
|
|
||||||
|
public:
|
||||||
|
std::shared_ptr<LinuxTest> mLinuxTest;
|
||||||
|
};
|
||||||
|
// ../output_files/test/bin/HunttingCameraTest --gtest_filter=HunttingCameraTest.INTEGRATION_DeviceManager_EXAMPLE_Demo
|
||||||
|
TEST_F(HunttingCameraTest, INTEGRATION_DeviceManager_EXAMPLE_Demo)
|
||||||
|
{
|
||||||
|
MainThread::GetInstance()->Init();
|
||||||
|
TestManager::ResetTimeOut(1000 * 3);
|
||||||
|
MainThread::GetInstance()->Runing();
|
||||||
|
}
|
||||||
|
} // namespace HunttingCameraTest
|
Loading…
Reference in New Issue
Block a user