Android: Fix QStandardPaths test

QStandardPaths::writableLocation() is documented to return the
empty string if no matching writable location can be determined.
This is the case for e.g. FontsLocation and ApplicationsLocation on
Android. We need to still accept this as a valid response.

Change-Id: I2824e9dcfd41b1c24dbf3896b7ae9b5260e9accd
Reviewed-by: David Faure <david.faure@kdab.com>
Reviewed-by: BogDan Vatra <bogdan@kde.org>
This commit is contained in:
Eskil Abrahamsen Blomfeldt 2014-12-19 10:51:13 +01:00
parent 0fb839ac62
commit 678a283498

View File

@ -472,7 +472,7 @@ void tst_qstandardpaths::testAllWritableLocations()
QString loc = QStandardPaths::writableLocation(location); QString loc = QStandardPaths::writableLocation(location);
if (loc.size() > 1) // workaround for unlikely case of locations that return '/' if (loc.size() > 1) // workaround for unlikely case of locations that return '/'
QCOMPARE(loc.endsWith(QLatin1Char('/')), false); QCOMPARE(loc.endsWith(QLatin1Char('/')), false);
QVERIFY(loc.contains(QLatin1Char('/'))); QVERIFY(loc.isEmpty() || loc.contains(QLatin1Char('/')));
QVERIFY(!loc.contains(QLatin1Char('\\'))); QVERIFY(!loc.contains(QLatin1Char('\\')));
} }