hunting/test/middleware/McuManager/src_mock/McuManagerMockTest.cpp
2024-06-15 08:39:16 +08:00

48 lines
1.4 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.
*/
#include "McuManagerMockTest.h"
McuManagerMockTest::McuManagerMockTest()
{
}
McuManagerMockTest::~McuManagerMockTest()
{
}
void McuManagerMockTest::SetUpTestCase()
{
CreateLogModule();
ILogInit(LOG_INSTANCE_TYPE_END);
}
void McuManagerMockTest::TearDownTestCase()
{
ILogUnInit();
}
void McuManagerMockTest::SetUp()
{
mLinuxTest = LinuxTest::CreateLinuxTest();
std::shared_ptr<LinuxApiMock> test = mLinuxTest;
LinuxApiMock::GetInstance(&test);
LinuxApiMock::GetInstance()->Init();
McuManagerTestTool::Init(mLinuxTest);
CreateMcuManager();
}
void McuManagerMockTest::TearDown()
{
LinuxApiMock::GetInstance()->UnInit();
mLinuxTest = std::make_shared<LinuxTest>();
std::shared_ptr<LinuxApiMock> test = std::make_shared<LinuxApiMock>();
LinuxApiMock::GetInstance(&test);
McuManagerTestTool::UnInit();
DestroyMcuManager();
}