From ce30d90a23a5e51256514ba0f6fea4e383ef342f Mon Sep 17 00:00:00 2001 From: Evgeniy Alekseev Date: Sun, 17 Dec 2017 05:07:50 +0300 Subject: [PATCH] fix hddtemp tests --- sources/test/testhddtempsource.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/sources/test/testhddtempsource.cpp b/sources/test/testhddtempsource.cpp index bc51f58..225ba14 100644 --- a/sources/test/testhddtempsource.cpp +++ b/sources/test/testhddtempsource.cpp @@ -28,7 +28,6 @@ void TestHDDTemperatureSource::initTestCase() { AWTestLibrary::init(); devices = HDDTemperatureSource::allHdd(); - QVERIFY(devices.count() > 0); hddtempSource = new HDDTemperatureSource(this, QStringList() << devices.join(',') << hddtempCmd); @@ -46,6 +45,9 @@ void TestHDDTemperatureSource::cleanupTestCase() 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"); }); @@ -56,6 +58,9 @@ void TestHDDTemperatureSource::test_sources() void TestHDDTemperatureSource::test_hddtemp() { + if (devices.isEmpty()) + QSKIP("No hdd devices found, test will be skipped"); + std::for_each(devices.begin(), devices.end(), [this](QString device) { QSignalSpy spy(hddtempSource, SIGNAL(dataReceived(const QVariantHash &))); float firstValue = hddtempSource->data(device).toFloat(); @@ -73,6 +78,9 @@ void TestHDDTemperatureSource::test_hddtemp() void TestHDDTemperatureSource::test_smartctl() { + if (devices.isEmpty()) + QSKIP("No hdd devices found, test will be skipped"); + std::for_each(devices.begin(), devices.end(), [this](QString &device) { QSignalSpy spy(smartctlSource, SIGNAL(dataReceived(const QVariantHash &))); float firstValue = smartctlSource->data(device).toFloat();