| 1 | // SPDX-FileCopyrightText: 2022 UnionTech Software Technology Co., Ltd. |
| 2 | // |
| 3 | // SPDX-License-Identifier: GPL-3.0-only |
| 4 | |
| 5 | #include "bootmakerservicetest.h" |
| 6 | #include "../service/bootmakerservice_p.h" |
| 7 | #include <QDebug> |
| 8 | |
| 9 | // Sets up the test fixture. |
| 10 | void BootMakerServiceTest::SetUp() |
| 11 | { |
| 12 | m_bootMakerService = new BootMakerService; |
| 13 | m_bootMakerService->d_ptr->disableCheck = true; |
| 14 | } |
| 15 | |
| 16 | // Tears down the test fixture. |
| 17 | void BootMakerServiceTest::TearDown() |
| 18 | { |
| 19 | delete m_bootMakerService; |
| 20 | m_bootMakerService = nullptr; |
| 21 | } |
| 22 | |
| 23 | TEST_F(BootMakerServiceTest, Signal) |
| 24 | { |
| 25 | // QString add = "add"; |
| 26 | // QString del = "del"; |
| 27 | |
| 28 | // m_bootMakerService->DeviceListChanged(add,del); |
| 29 | |
| 30 | // int errcode = 0; |
| 31 | // QString description; |
| 32 | // m_bootMakerService->Finished(errcode,description); |
| 33 | |
| 34 | |
| 35 | // int current = 0; |
| 36 | // int error = -1; |
| 37 | // QString title = ""; |
| 38 | // QString descript = ""; |
| 39 | // m_bootMakerService->ReportProgress(current, error, title, descript); |
| 40 | |
| 41 | // m_bootMakerService->ReportProgress1(current, error, title, descript); |
| 42 | } |
| 43 | |
| 44 | TEST_F(BootMakerServiceTest, Slots) |
| 45 | { |
| 46 | m_bootMakerService->Reboot(); |
| 47 | m_bootMakerService->Start(); |
| 48 | m_bootMakerService->Stop(); |
| 49 | |
| 50 | QString ret = m_bootMakerService->DeviceList(); |
| 51 | qInfo() << "ret = " << ret; |
| 52 | |
| 53 | EXPECT_TRUE(m_bootMakerService->Install("~/Downloads/uniontechos-desktop-21.0-home-beta6-amd64.iso","/dev/sdb","/dev/sdb1",false)); |
| 54 | |
| 55 | EXPECT_TRUE(m_bootMakerService->CheckFile("/dev/sdb1")); |
| 56 | } |