mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-07-03 17:05:54 +00:00
wayland support
This commit is contained in:
@ -50,11 +50,9 @@ char AWTestLibrary::randomChar()
|
||||
|
||||
QPair<QString, QString> AWTestLibrary::randomFilenames()
|
||||
{
|
||||
QString fileName
|
||||
= QString("%1/").arg(QStandardPaths::writableLocation(QStandardPaths::TempLocation));
|
||||
QString fileName = QString("%1/").arg(QStandardPaths::writableLocation(QStandardPaths::TempLocation));
|
||||
QString writeFileName
|
||||
= QString("%1/awesomewidgets/tmp/")
|
||||
.arg(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation));
|
||||
= QString("%1/awesomewidgets/tmp/").arg(QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation));
|
||||
|
||||
QString name = randomString(1, 20);
|
||||
fileName += name;
|
||||
|
@ -175,15 +175,15 @@ void TestAWKeys::test_dbus()
|
||||
QDBusConnection bus = QDBusConnection::sessionBus();
|
||||
|
||||
// check if there is active sessions first
|
||||
QDBusMessage sessions = QDBusMessage::createMethodCall(AWDBUS_SERVICE, AWDBUS_PATH,
|
||||
AWDBUS_SERVICE, "ActiveServices");
|
||||
QDBusMessage sessions
|
||||
= QDBusMessage::createMethodCall(AWDBUS_SERVICE, AWDBUS_PATH, AWDBUS_SERVICE, "ActiveServices");
|
||||
QDBusMessage sessionsResponse = bus.call(sessions, QDBus::BlockWithGui);
|
||||
if (sessionsResponse.arguments().isEmpty())
|
||||
QSKIP("No active sessions found, skip DBus tests");
|
||||
|
||||
// dbus checks
|
||||
QDBusMessage request = QDBusMessage::createMethodCall(
|
||||
QString("%1.i%2").arg(AWDBUS_SERVICE).arg(id), AWDBUS_PATH, AWDBUS_SERVICE, "WhoAmI");
|
||||
QDBusMessage request = QDBusMessage::createMethodCall(QString("%1.i%2").arg(AWDBUS_SERVICE).arg(id), AWDBUS_PATH,
|
||||
AWDBUS_SERVICE, "WhoAmI");
|
||||
// send message to dbus
|
||||
QDBusMessage response = bus.call(request, QDBus::BlockWithGui);
|
||||
|
||||
|
@ -42,8 +42,7 @@ void TestAWPatternFunctions::test_findFunctionCalls()
|
||||
|
||||
QString pattern = AWTestLibrary::randomString() + function + AWTestLibrary::randomString();
|
||||
|
||||
QList<AWPatternFunctions::AWFunction> found
|
||||
= AWPatternFunctions::findFunctionCalls(name, pattern);
|
||||
QList<AWPatternFunctions::AWFunction> found = AWPatternFunctions::findFunctionCalls(name, pattern);
|
||||
QCOMPARE(found.count(), 1);
|
||||
|
||||
QCOMPARE(found.at(0).args, args);
|
||||
@ -87,8 +86,8 @@ void TestAWPatternFunctions::test_findKeys()
|
||||
void TestAWPatternFunctions::test_findLambdas()
|
||||
{
|
||||
QStringList lambdas = AWTestLibrary::randomStringList(20);
|
||||
QString pattern = AWTestLibrary::randomString() + QString("${{%1}}").arg(lambdas.join("}}${{"))
|
||||
+ AWTestLibrary::randomString();
|
||||
QString pattern
|
||||
= AWTestLibrary::randomString() + QString("${{%1}}").arg(lambdas.join("}}${{")) + AWTestLibrary::randomString();
|
||||
|
||||
QCOMPARE(AWPatternFunctions::findLambdas(pattern), lambdas);
|
||||
}
|
||||
|
@ -64,8 +64,7 @@ void TestExtQuotes::test_run()
|
||||
|
||||
for (auto &type : types) {
|
||||
QCOMPARE(firstValue[extQuotes->tag(type)].toDouble(), 0.0);
|
||||
QVERIFY((cache[type].toDouble() >= price.first)
|
||||
&& (cache[type].toDouble() <= price.second));
|
||||
QVERIFY((cache[type].toDouble() >= price.first) && (cache[type].toDouble() <= price.second));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -65,8 +65,7 @@ void TestExtScript::test_run()
|
||||
QList<QVariant> arguments = spy.takeFirst();
|
||||
|
||||
QCOMPARE(firstValue[extScript->tag("custom")].toString(), QString());
|
||||
QCOMPARE(arguments.at(0).toHash()[extScript->tag("custom")].toString(),
|
||||
QString("\n%1").arg(randomString));
|
||||
QCOMPARE(arguments.at(0).toHash()[extScript->tag("custom")].toString(), QString("\n%1").arg(randomString));
|
||||
}
|
||||
|
||||
|
||||
@ -83,8 +82,7 @@ void TestExtScript::test_filters()
|
||||
// check values
|
||||
QVERIFY(spy.wait(5000));
|
||||
QList<QVariant> arguments = spy.takeFirst();
|
||||
QCOMPARE(arguments.at(0).toHash()[extScript->tag("custom")].toString(),
|
||||
QString("<br>%1").arg(randomString));
|
||||
QCOMPARE(arguments.at(0).toHash()[extScript->tag("custom")].toString(), QString("<br>%1").arg(randomString));
|
||||
}
|
||||
|
||||
|
||||
|
@ -78,8 +78,7 @@ void TestExtUpgrade::test_null()
|
||||
// check values
|
||||
QVERIFY(spy.wait(5000));
|
||||
QList<QVariant> arguments = spy.takeFirst();
|
||||
QCOMPARE(arguments.at(0).toHash()[extUpgrade->tag("pkgcount")].toInt(),
|
||||
randomStrings.count() - null);
|
||||
QCOMPARE(arguments.at(0).toHash()[extUpgrade->tag("pkgcount")].toInt(), randomStrings.count() - null);
|
||||
}
|
||||
|
||||
|
||||
|
@ -29,10 +29,8 @@ void TestHDDTemperatureSource::initTestCase()
|
||||
AWTestLibrary::init();
|
||||
devices = HDDTemperatureSource::allHdd();
|
||||
|
||||
hddtempSource
|
||||
= new HDDTemperatureSource(this, QStringList() << devices.join(',') << hddtempCmd);
|
||||
smartctlSource
|
||||
= new HDDTemperatureSource(this, QStringList() << devices.join(',') << smartctlCmd);
|
||||
hddtempSource = new HDDTemperatureSource(this, QStringList() << devices.join(',') << hddtempCmd);
|
||||
smartctlSource = new HDDTemperatureSource(this, QStringList() << devices.join(',') << smartctlCmd);
|
||||
}
|
||||
|
||||
|
||||
@ -48,8 +46,7 @@ void TestHDDTemperatureSource::test_sources()
|
||||
if (devices.isEmpty())
|
||||
QSKIP("No hdd devices found, test will be skipped");
|
||||
|
||||
std::for_each(devices.begin(), devices.end(),
|
||||
[](QString &device) { device.prepend("hdd/temperature"); });
|
||||
std::for_each(devices.begin(), devices.end(), [](QString &device) { device.prepend("hdd/temperature"); });
|
||||
|
||||
QCOMPARE(hddtempSource->sources(), devices);
|
||||
QCOMPARE(smartctlSource->sources(), devices);
|
||||
|
@ -79,8 +79,7 @@ void TestPlayerSource::test_autoMpris()
|
||||
|
||||
void TestPlayerSource::test_mpd()
|
||||
{
|
||||
QStringList args(QStringList() << "mpd" << mpdAddress << QString::number(mpdPort) << "auto"
|
||||
<< QString::number(10));
|
||||
QStringList args(QStringList() << "mpd" << mpdAddress << QString::number(mpdPort) << "auto" << QString::number(10));
|
||||
PlayerSource *source = new PlayerSource(this, args);
|
||||
_test_sources(source);
|
||||
|
||||
|
Reference in New Issue
Block a user