hunting/test/middleware/McuManager/src_mock/McuManager_AbnormalData_Test.cpp
2024-05-21 14:50:31 +08:00

40 lines
1.9 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 "McuAskBase.h"
#include "McuAskBaseTestTool.h"
#include "McuManagerMockTest.h"
#include <thread>
const unsigned char McuRecvData[] = {
0xFA, 0xC1, 0x00, 0x00, 0x00, 0x08, 0x41, 0x01, 0x00, 0x0A, 0x03, 0x08, 0xEC, 0xFA, 0xC1, 0x00, 0x00, 0x00,
0x0A, 0x41, 0x03, 0x08, 0xEC, 0xFA, 0xC1, 0x00, 0x00, 0x00, 0x0A, 0x41, 0x07, 0x00, 0x0C, 0x35, 0x88, 0xFA,
0xC1, 0x00, 0x03, 0x08, 0xEC, 0xFA, 0xC1, 0x00, 0x00, 0x00, 0x0A, 0x41, 0x07, 0x00, 0x0C, 0x35, 0x88, 0xFA,
0xC1, 0x00, 0x00, 0xFA, 0xC1, 0x00, 0x00, 0x00, 0x0A, 0x03, 0x08, 0xEC, 0xFA, 0xC1, 0x00, 0x00, 0x00, 0x0A,
0x41, 0x07, 0x00, 0x0C, 0x35, 0x88, 0xFA, 0xC1, 0x00, 0x00, 0xFA, 0xC1, 0x00, 0x00, 0x00, 0x0A};
namespace McuManager_AbnormalData_Test
{
/**
* @brief Construct a new test f object
* ../output_files/test/bin/McuManagerTest
* --gtest_filter=McuManagerMockTest.HS_INTEGRATION_McuManager_AUTO_ProtocolLengthIsWrong
*/
TEST_F(McuManagerMockTest, HS_INTEGRATION_McuManager_AUTO_ProtocolLengthIsWrong)
{
IMcuManager::GetInstance()->Init();
std::this_thread::sleep_for(std::chrono::milliseconds(100));
McuManagerTestTool::MockOtherSideSendData(mLinuxTest, McuRecvData, sizeof(McuRecvData));
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
IMcuManager::GetInstance()->UnInit();
}
} // namespace McuManager_AbnormalData_Test