summaryrefslogtreecommitdiffstats
path: root/tests/benchmarks/corelib/json/tst_bench_qtbinaryjson.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/benchmarks/corelib/json/tst_bench_qtbinaryjson.cpp')
-rw-r--r--tests/benchmarks/corelib/json/tst_bench_qtbinaryjson.cpp12
1 files changed, 9 insertions, 3 deletions
diff --git a/tests/benchmarks/corelib/json/tst_bench_qtbinaryjson.cpp b/tests/benchmarks/corelib/json/tst_bench_qtbinaryjson.cpp
index 8f3e2cc8c6..2253d00778 100644
--- a/tests/benchmarks/corelib/json/tst_bench_qtbinaryjson.cpp
+++ b/tests/benchmarks/corelib/json/tst_bench_qtbinaryjson.cpp
@@ -87,7 +87,9 @@ void BenchmarkQtBinaryJson::cleanup()
void BenchmarkQtBinaryJson::parseNumbers()
{
- QFile file(QLatin1String("numbers.json"));
+ QString testFile = QFINDTESTDATA("numbers.json");
+ QVERIFY2(!testFile.isEmpty(), "cannot find test file numbers.json!");
+ QFile file(testFile);
file.open(QFile::ReadOnly);
QByteArray testJson = file.readAll();
@@ -99,7 +101,9 @@ void BenchmarkQtBinaryJson::parseNumbers()
void BenchmarkQtBinaryJson::parseJson()
{
- QFile file(QLatin1String("../../../auto/corelib/json/test.json"));
+ QString testFile = QFINDTESTDATA("test.json");
+ QVERIFY2(!testFile.isEmpty(), "cannot find test file test.json!");
+ QFile file(testFile);
file.open(QFile::ReadOnly);
QByteArray testJson = file.readAll();
@@ -111,7 +115,9 @@ void BenchmarkQtBinaryJson::parseJson()
void BenchmarkQtBinaryJson::parseJsonToVariant()
{
- QFile file(QLatin1String("../../../auto/corelib/json/test.json"));
+ QString testFile = QFINDTESTDATA("test.json");
+ QVERIFY2(!testFile.isEmpty(), "cannot find test file test.json!");
+ QFile file(testFile);
file.open(QFile::ReadOnly);
QByteArray testJson = file.readAll();