File indexing completed on 2024-11-03 06:52:31

0001 /*
0002     SPDX-FileCopyrightText: 2014 Alejandro Fiestas Olivares <afiestas@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 
0007 #include "../src/solid/power/backends/freedesktop/logindinhibitionargument.h"
0008 #include <QTest>
0009 
0010 using namespace Solid;
0011 class LoginInhibitionArgumentTest : public QObject
0012 {
0013     Q_OBJECT
0014 private Q_SLOTS:
0015     void testFromPowerStates();
0016 };
0017 
0018 void LoginInhibitionArgumentTest::testFromPowerStates()
0019 {
0020     QString arg = LogindInhibitionArgument::fromPowerState(Power::InhibitionTypes(Power::Shutdown & Power::Sleep));
0021     QCOMPARE(arg, QStringLiteral("sleep:shutdown"));
0022 }
0023 
0024 QTEST_GUILESS_MAIN(LoginInhibitionArgumentTest)
0025 
0026 #include "logindinhibitionargumenttest.moc"