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