kdecore: minor karchive test cleanup, test still hangs

for some reason the group is not what the test expects, it may
not fail if the tests are run as root user but I doubt someone
will do that (I do not for one)
This commit is contained in:
Ivailo Monev 2015-09-23 04:11:05 +00:00
parent 21fd141901
commit d6d3906a71
2 changed files with 9 additions and 6 deletions

View file

@ -18,7 +18,7 @@ ENDMACRO(KDECORE_EXECUTABLE_TESTS)
########### next target ###############
KDECORE_UNIT_TESTS(
# FIXME: due to issues with kbzip2filter the test bellow is disabled as it
# FIXME: due to issues with kgzipfilter the test bellow is disabled as it
# causes a hang
# karchivetest
kdirwatch_unittest

View file

@ -371,20 +371,23 @@ void KArchiveTest::testReadTar() // testCreateTarGz must have been run first.
QFileInfo localFileData("test3");
const QString owner = localFileData.owner();
const QString group = localFileData.group();
QCOMPARE( listing.count(), 15 );
QCOMPARE( listing[ 0], QString("mode=40755 user=user group=group path=aaaemptydir type=dir") );
QCOMPARE( listing[ 1], QString("mode=40777 user=%1 group=%2 path=dir type=dir").arg(localFileData.owner()).arg(localFileData.group()) );
QCOMPARE( listing[ 2], QString("mode=40777 user=%1 group=%2 path=dir/subdir type=dir").arg(localFileData.owner()).arg(localFileData.group()) );
QCOMPARE( listing[ 1], QString("mode=40777 user=%1 group=%2 path=dir type=dir").arg(owner, group) );
QCOMPARE( listing[ 2], QString("mode=40777 user=%1 group=%2 path=dir/subdir type=dir").arg(owner,group) );
QCOMPARE( listing[ 3], QString("mode=100644 user=user group=group path=dir/subdir/mediumfile2 type=file size=100") );
QCOMPARE( listing[ 4], QString("mode=100644 user=weis group=users path=empty type=file size=0") );
QCOMPARE( listing[ 5], QString("mode=100644 user=user group=group path=hugefile type=file size=20000") );
QCOMPARE( listing[ 6], QString("mode=100644 user=user group=group path=mediumfile type=file size=100") );
QCOMPARE( listing[ 7], QString("mode=40777 user=%1 group=%2 path=my type=dir").arg(localFileData.owner()).arg(localFileData.group()) );
QCOMPARE( listing[ 8], QString("mode=40777 user=%1 group=%2 path=my/dir type=dir").arg(localFileData.owner()).arg(localFileData.group()) );
QCOMPARE( listing[ 7], QString("mode=40777 user=%1 group=%2 path=my type=dir").arg(owner, group) );
QCOMPARE( listing[ 8], QString("mode=40777 user=%1 group=%2 path=my/dir type=dir").arg(owner, group) );
QCOMPARE( listing[ 9], QString("mode=100644 user=dfaure group=hackers path=my/dir/test3 type=file size=29") );
QCOMPARE( listing[10], QString("mode=100440 user=weis group=users path=test1 type=file size=5") );
QCOMPARE( listing[11], QString("mode=100644 user=weis group=users path=test2 type=file size=8") );
QCOMPARE( listing[12], QString("mode=40777 user=%1 group=%2 path=z type=dir").arg(localFileData.owner()).arg(localFileData.group()) );
QCOMPARE( listing[12], QString("mode=40777 user=%1 group=%2 path=z type=dir").arg(owner, group) );
// This one was added with addLocalFile, so ignore mode/user/group.
QString str = listing[13];
str.replace(QRegExp("mode.*path"), "path" );