add test library for random values generation

This commit is contained in:
2016-05-29 03:33:41 +03:00
parent 7b154af1b3
commit cae9e0d2e3
12 changed files with 148 additions and 105 deletions

View File

@ -20,6 +20,7 @@
#include <QtTest>
#include "awtestlibrary.h"
#include "extupgrade.h"
@ -114,13 +115,10 @@ void TestAbstractExtItem::generateFilename()
writeFileName = QString("%1/awesomewidgets/tmp/")
.arg(QStandardPaths::writableLocation(
QStandardPaths::GenericDataLocation));
int diff = 'Z' - 'A';
int count = rand() % 20 + 1;
for (int i = 0; i < count; i++) {
char c = 'A' + (rand() % diff);
fileName += QChar(c);
writeFileName += QChar(c);
}
QString name = AWTestLibrary::randomString(20);
fileName += name;
writeFileName += name;
}