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,12 +20,13 @@
#include <QtTest>
#include "awtestlibrary.h"
#include "extscript.h"
void TestExtScript::initTestCase()
{
generateRandomString();
randomString = AWTestLibrary::randomString();
extScript = new ExtScript(nullptr);
extScript->setInterval(1);
@ -102,17 +103,4 @@ void TestExtScript::test_copy()
}
void TestExtScript::generateRandomString()
{
randomString.clear();
int diff = 'Z' - 'A';
int count = rand() % 100 + 1;
for (int i = 0; i < count; i++) {
char c = 'A' + (rand() % diff);
randomString += QChar(c);
}
}
QTEST_MAIN(TestExtScript);