/* * 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 "HalTestTool.h" #include "IDeviceManager.h" #include "ILog.h" #include #include #include namespace DeviceManagerTest { class DeviceManagerTest : public testing::Test, public HalTestTool { public: DeviceManagerTest() {} virtual ~DeviceManagerTest() {} static void SetUpTestCase() { CreateLogModule(); ILogInit(LOG_INSTANCE_TYPE_END); } static void TearDownTestCase() { ILogUnInit(); } virtual void SetUp() { // mLinuxTest = LinuxTest::CreateLinuxTest(); // std::shared_ptr test = mLinuxTest; // LinuxApiMock::GetInstance(&test); // LinuxApiMock::GetInstance()->Init(); HalTestTool::Init(); CreateHalCppModule(); CreateDeviceManagerModule(); // CreateMcuManager(); } virtual void TearDown() { // LinuxApiMock::GetInstance()->UnInit(); // mLinuxTest = std::make_shared(); // std::shared_ptr test = std::make_shared(); // LinuxApiMock::GetInstance(&test); HalTestTool::UnInit(); // DestroyMcuManager(); DestroyDeviceManagerModule(); } public: // std::shared_ptr mLinuxTest; }; // ../output_files/test/bin/DeviceManagerTest --gtest_filter=DeviceManagerTest.INTEGRATION_DeviceManager_EXAMPLE_Demo TEST_F(DeviceManagerTest, INTEGRATION_DeviceManager_EXAMPLE_Demo) { IDeviceManager::GetInstance()->Init(); std::this_thread::sleep_for(std::chrono::milliseconds(1000)); IDeviceManager::GetInstance()->UnInit(); } } // namespace DeviceManagerTest