another iteration with fix travis tests

This commit is contained in:
2017-02-14 04:26:59 +03:00
parent a30e6ba21b
commit b818586a23
6 changed files with 17 additions and 20 deletions

View File

@ -18,19 +18,30 @@
#include "awtestlibrary.h"
#include <KWindowSystem>
#include <QSet>
#include <QStandardPaths>
bool AWTestLibrary::isKWinActive()
{
KWindowSystem::setShowingDesktop(true);
bool state = KWindowSystem::showingDesktop();
KWindowSystem::setShowingDesktop(false);
return state;
}
char AWTestLibrary::randomChar()
{
return 'A' + (rand() % static_cast<int>('Z' - 'A'));
return 'A' + (qrand() % static_cast<int>('Z' - 'A'));
}
double AWTestLibrary::randomDouble()
{
return static_cast<double>(rand()) / static_cast<double>(RAND_MAX);
return static_cast<double>(qrand()) / static_cast<double>(RAND_MAX);
}
@ -52,7 +63,7 @@ QPair<QString, QString> AWTestLibrary::randomFilenames()
int AWTestLibrary::randomInt(const int max)
{
return rand() % max;
return qrand() % max;
}