[users] Adjust tests for changed API

This commit is contained in:
Adriaan de Groot 2020-10-22 14:21:14 +02:00
parent f1772a7eae
commit 5b4f9d0b98
2 changed files with 12 additions and 15 deletions

View File

@ -74,10 +74,10 @@ calamares_add_test(
) )
calamares_add_test( calamares_add_test(
userscreatetest usersgroupstest
SOURCES SOURCES
TestCreateUserJob.cpp TestCreateUserJob.cpp # Misnomer
CreateUserJob.cpp MiscJobs.cpp
) )
calamares_add_test( calamares_add_test(

View File

@ -15,14 +15,14 @@
#include <QtTest/QtTest> #include <QtTest/QtTest>
// Implementation details // Implementation details
extern QStringList groupsInTargetSystem( const QDir& targetRoot ); // CreateUserJob extern QStringList groupsInTargetSystem(); // CreateUserJob
class CreateUserTests : public QObject class GroupTests : public QObject
{ {
Q_OBJECT Q_OBJECT
public: public:
CreateUserTests(); GroupTests();
~CreateUserTests() override {} ~GroupTests() override {}
private Q_SLOTS: private Q_SLOTS:
void initTestCase(); void initTestCase();
@ -30,23 +30,20 @@ private Q_SLOTS:
void testReadGroup(); void testReadGroup();
}; };
CreateUserTests::CreateUserTests() {} GroupTests::GroupTests() {}
void void
CreateUserTests::initTestCase() GroupTests::initTestCase()
{ {
Logger::setupLogLevel( Logger::LOGDEBUG ); Logger::setupLogLevel( Logger::LOGDEBUG );
cDebug() << "Users test started."; cDebug() << "Users test started.";
} }
void void
CreateUserTests::testReadGroup() GroupTests::testReadGroup()
{ {
QDir root( "/" );
QVERIFY( root.exists() );
// Get the groups in the host system // Get the groups in the host system
QStringList groups = groupsInTargetSystem( root ); QStringList groups = groupsInTargetSystem();
QVERIFY( groups.count() > 2 ); QVERIFY( groups.count() > 2 );
#ifdef __FreeBSD__ #ifdef __FreeBSD__
QVERIFY( groups.contains( QStringLiteral( "wheel" ) ) ); QVERIFY( groups.contains( QStringLiteral( "wheel" ) ) );
@ -65,7 +62,7 @@ CreateUserTests::testReadGroup()
} }
} }
QTEST_GUILESS_MAIN( CreateUserTests ) QTEST_GUILESS_MAIN( GroupTests )
#include "utils/moc-warnings.h" #include "utils/moc-warnings.h"