diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-10-16 17:31:10 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-10-16 17:31:10 +0200 |
commit | 422c12d85d3eca55eca6f23c140910150a5fd166 (patch) | |
tree | 52d7b466d73f2d1a3b4ba98b20d558c8c75dc96a /tests/testutils.h | |
parent | ad9e3074f2949a0ea604bc191109fa0ad7b8e2e4 (diff) | |
download | sink-422c12d85d3eca55eca6f23c140910150a5fd166.tar.gz sink-422c12d85d3eca55eca6f23c140910150a5fd166.zip |
QUICK_TRY_VERIFY for quick polling in benchmarks
Diffstat (limited to 'tests/testutils.h')
-rw-r--r-- | tests/testutils.h | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/testutils.h b/tests/testutils.h index f89da38..6e935f3 100644 --- a/tests/testutils.h +++ b/tests/testutils.h | |||
@@ -45,3 +45,11 @@ do {\ | |||
45 | if (!QTest::qVerify(result.errorCode(), #statement, "", __FILE__, __LINE__))\ | 45 | if (!QTest::qVerify(result.errorCode(), #statement, "", __FILE__, __LINE__))\ |
46 | return;\ | 46 | return;\ |
47 | } while (0) | 47 | } while (0) |
48 | |||
49 | #define QUICK_TRY_VERIFY(statement) \ | ||
50 | do {\ | ||
51 | static int timeout = 5000; \ | ||
52 | for (int i = 0; i < timeout && #statement; i++) { \ | ||
53 | QTest::qWait(1); \ | ||
54 | } \ | ||
55 | } while (0) | ||