diff options
author | Liang Qi <liang.qi@nokia.com> | 2011-05-20 09:16:33 (GMT) |
---|---|---|
committer | Liang Qi <liang.qi@nokia.com> | 2011-05-20 12:28:13 (GMT) |
commit | 06873e467d98ad60d827afae29500bf2ff783c03 (patch) | |
tree | c56bf7072c25b006f740f783615a7dfa9436df51 /tests/benchmarks | |
parent | 71f923f29e2c60444a85fc765fc582e06cb7eca4 (diff) | |
download | Qt-06873e467d98ad60d827afae29500bf2ff783c03.zip Qt-06873e467d98ad60d827afae29500bf2ff783c03.tar.gz Qt-06873e467d98ad60d827afae29500bf2ff783c03.tar.bz2 |
Add QUuid::toRfc4122() and fromRfc4122()
Following the RFC4122, provide the interfaces between QUuid
and QByteArray, they are simpler then toByteArray() and
relevant.
Thanks for the suggestion and brief code from Robin Burchell.
Task-number: QTBUG-19420
Reviewed-by: joao
Diffstat (limited to 'tests/benchmarks')
-rw-r--r-- | tests/benchmarks/corelib/plugin/quuid/tst_quuid.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/benchmarks/corelib/plugin/quuid/tst_quuid.cpp b/tests/benchmarks/corelib/plugin/quuid/tst_quuid.cpp index 608423a..77a9920 100644 --- a/tests/benchmarks/corelib/plugin/quuid/tst_quuid.cpp +++ b/tests/benchmarks/corelib/plugin/quuid/tst_quuid.cpp @@ -58,6 +58,8 @@ private slots: void fromString(); void toByteArray(); void fromByteArray(); + void toRfc4122(); + void fromRfc4122(); void toDataStream(); void fromDataStream(); void isNull(); @@ -111,6 +113,22 @@ void tst_bench_QUuid::fromByteArray() } } +void tst_bench_QUuid::toRfc4122() +{ + QUuid uuid = QUuid::createUuid(); + QBENCHMARK { + uuid.toRfc4122(); + } +} + +void tst_bench_QUuid::fromRfc4122() +{ + QByteArray string = QByteArray::fromHex("67C8770B44F1410AAB9AF9B5446F13EE"); + QBENCHMARK { + QUuid uuid = QUuid::fromRfc4122(string); + } +} + void tst_bench_QUuid::toDataStream() { QUuid uuid1, uuid2; |