mirror of
https://github.com/arcan1s/awesome-widgets.git
synced 2025-07-13 22:05:48 +00:00
add test library for random values generation
This commit is contained in:
@ -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);
|
||||
|
Reference in New Issue
Block a user