forked from ArcheGraphics/HydraViewer
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest_benchmark.cpp
31 lines (27 loc) · 862 Bytes
/
test_benchmark.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
// Copyright (c) 2024 Feng Yang
//
// I am making my contributions/submissions to this project solely in my
// personal capacity and am not conveying any rights to any intellectual
// property of any third parties.
#include "test_benchmark.h"
void TestBenchmark::multiple_data() {
QTest::addColumn<bool>("useLocaleCompare");
QTest::newRow("locale-aware-compare") << true;
QTest::newRow("standard-compare") << false;
}
void TestBenchmark::multiple() {
QFETCH(bool, useLocaleCompare);
QString str1 = QLatin1String("This is a test string");
QString str2 = QLatin1String("This is a test string");
int result;
if (useLocaleCompare) {
QBENCHMARK {
result = str1.localeAwareCompare(str2);
}
} else {
QBENCHMARK {
result = (str1 == str2);
}
}
Q_UNUSED(result);
}