@@ -134,14 +134,12 @@ private Q_SLOTS:
134134 QCoreApplication::processEvents(); // to let the service register on DBus
135135
136136 QDBusInterface accIface("org.freedesktop.Accounts", "/org/freedesktop/Accounts", "org.freedesktop.Accounts", QDBusConnection::systemBus());
137− QVERIFY(accIface.isValid());
137+ QTRY_VERIFY(accIface.isValid());
138138 QDBusReply<QDBusObjectPath> userPath = accIface.asyncCall("FindUserById", static_cast<qint64>(geteuid()));
139− if (!userPath.isValid()) {
140− QFAIL("Could not get user path in Account Service");
139+ if (userPath.isValid()) {
140+ QDBusInterface userAccIface("org.freedesktop.Accounts", userPath.value().path(), "org.freedesktop.Accounts.User", QDBusConnection::systemBus());
141+ QTRY_COMPARE(dbusUnitySessionService.RealName(), userAccIface.property("RealName").toString());
141142 }
142−
143− QDBusInterface userAccIface("org.freedesktop.Accounts", userPath.value().path(), "org.freedesktop.Accounts.User", QDBusConnection::systemBus());
144− QCOMPARE(dbusUnitySessionService.RealName(), userAccIface.property("RealName").toString());
145143 }
146144
147145 void testLogin1Capabilities() {