diff options
author | Alex Blasche <alexander.blasche@digia.com> | 2014-08-26 11:37:47 +0200 |
---|---|---|
committer | Alex Blasche <alexander.blasche@digia.com> | 2014-08-27 10:08:30 +0200 |
commit | 9f4c45b58b82b59740dc60e22cba6894efd6c164 (patch) | |
tree | 578325ff39d2042546830ac5323e2ecab7c7cb77 /tests | |
parent | 8a02c2ffd83afc17a4ea825e4954705ce21da99c (diff) |
Improve quint128 to QBluetoothUuid conversion performance
The change improves the performance between 8-10%.
Change-Id: I342e669d3f18cd2179b65f1af172db52303ff44c
Reviewed-by: Aaron McCarthy <mccarthy.aaron@gmail.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/qbluetoothuuid/tst_qbluetoothuuid.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/tests/auto/qbluetoothuuid/tst_qbluetoothuuid.cpp b/tests/auto/qbluetoothuuid/tst_qbluetoothuuid.cpp index a040a5c5..e905eb94 100644 --- a/tests/auto/qbluetoothuuid/tst_qbluetoothuuid.cpp +++ b/tests/auto/qbluetoothuuid/tst_qbluetoothuuid.cpp @@ -64,6 +64,7 @@ private slots: void tst_conversion(); void tst_comparison_data(); void tst_comparison(); + void tst_quint128ToUuid(); }; tst_QBluetoothUuid::tst_QBluetoothUuid() @@ -375,6 +376,18 @@ void tst_QBluetoothUuid::tst_comparison() } } } + +void tst_QBluetoothUuid::tst_quint128ToUuid() +{ + QBluetoothUuid temp(QString("{67C8770B-44F1-410A-AB9A-F9B5446F13EE}")); + quint128 array = temp.toUInt128(); + QBluetoothUuid u(array); + QVERIFY(temp == u); + + QBENCHMARK { + QBluetoothUuid u(array); + } +} QTEST_MAIN(tst_QBluetoothUuid) #include "tst_qbluetoothuuid.moc" |