Backup:test code.
This commit is contained in:
parent
2b4130595b
commit
b28b337f36
|
@ -50,6 +50,7 @@ std::shared_ptr<AppManagerMakePtr> &AppManagerMakePtr::GetInstance(std::shared_p
|
|||
}
|
||||
const StatusCode AppManagerMakePtr::CreateAppManager(std::shared_ptr<IAppManager> &impl)
|
||||
{
|
||||
LogInfo("AppManagerMakePtr::CreateAppManager.\n");
|
||||
auto tmp = std::make_shared<AppManager>();
|
||||
impl = tmp;
|
||||
return CreateStatusCode(STATUS_CODE_OK);
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
#include "SixFrameMakePtr.h"
|
||||
#include "ILog.h"
|
||||
#include "SixFrameHandle.h"
|
||||
bool CreateProtocolHandleImpl(void)
|
||||
{
|
||||
LogInfo("CreateProtocolHandleImpl SixFrameMakePtr.\n");
|
||||
std::shared_ptr<AppManagerMakePtr> instance = std::make_shared<SixFrameMakePtr>();
|
||||
AppManagerMakePtr::GetInstance(&instance);
|
||||
return true;
|
||||
|
|
|
@ -22,6 +22,16 @@
|
|||
#include <thread>
|
||||
namespace HunttingCameraTest
|
||||
{
|
||||
class MainThreadTest : public MainThread
|
||||
{
|
||||
public:
|
||||
MainThreadTest() = default;
|
||||
virtual ~MainThreadTest() = default;
|
||||
void CustomizationInit(void) override
|
||||
{
|
||||
// Do nothing here to make sure test tool work.
|
||||
}
|
||||
};
|
||||
class HunttingCameraTest : public testing::Test,
|
||||
public TestManager,
|
||||
public McuManagerTestTool,
|
||||
|
@ -40,8 +50,11 @@ public:
|
|||
static void TearDownTestCase() { ILogUnInit(); }
|
||||
virtual void SetUp()
|
||||
{
|
||||
std::shared_ptr<MainThread> mainThread = std::make_shared<MainThreadTest>();
|
||||
MainThread::GetInstance(&mainThread);
|
||||
// CreateAllKeysMcok();
|
||||
HalTestTool::Init();
|
||||
AppManagerTestTool::Init();
|
||||
// HunttingCameraTestTool::Init();
|
||||
// CreateHalCppModule();
|
||||
// CreateDeviceManagerModule();
|
||||
|
@ -58,6 +71,7 @@ public:
|
|||
// DestroyDeviceManagerModule();
|
||||
// DestroyAllKeysMock();
|
||||
TestManager::UnInit();
|
||||
AppManagerTestTool::UnInit();
|
||||
HalTestTool::UnInit();
|
||||
LinuxApiMock::GetInstance()->UnInit();
|
||||
mLinuxTest = std::make_shared<LinuxTest>();
|
||||
|
@ -65,13 +79,15 @@ public:
|
|||
LinuxApiMock::GetInstance(&test);
|
||||
McuManagerTestTool::UnInit();
|
||||
MainThread::GetInstance()->UnInit();
|
||||
std::shared_ptr<MainThread> mainThread = std::make_shared<MainThread>();
|
||||
MainThread::GetInstance(&mainThread);
|
||||
}
|
||||
|
||||
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)
|
||||
// ../output_files/test/bin/HunttingCameraTest --gtest_filter=HunttingCameraTest.INTEGRATION_HunttingCamera_EXAMPLE_Demo
|
||||
TEST_F(HunttingCameraTest, INTEGRATION_HunttingCamera_EXAMPLE_Demo)
|
||||
{
|
||||
MainThread::GetInstance()->Init();
|
||||
TestManager::ResetTimeOut(1000 * 3);
|
||||
|
|
Loading…
Reference in New Issue
Block a user