diff options
author | Liang Qi <liang.qi@nokia.com> | 2011-05-20 09:36:01 (GMT) |
---|---|---|
committer | Liang Qi <liang.qi@nokia.com> | 2011-05-20 12:28:12 (GMT) |
commit | 71f923f29e2c60444a85fc765fc582e06cb7eca4 (patch) | |
tree | d226463c2128c084ef83fcaf304912cb03934867 /tests/benchmarks | |
parent | 7ce566ed82666ac08f137f4d8590ce589d42c82a (diff) | |
download | Qt-71f923f29e2c60444a85fc765fc582e06cb7eca4.zip Qt-71f923f29e2c60444a85fc765fc582e06cb7eca4.tar.gz Qt-71f923f29e2c60444a85fc765fc582e06cb7eca4.tar.bz2 |
Add QUuid::toByteArray() and relevant
Add QUuid::toByteArray() and QUuid(const QByteArray &). Same
behavior with QUuid::toString() and QUuid(const QString &).
Task-number: QTBUG-19419
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 47a3d3f..608423a 100644 --- a/tests/benchmarks/corelib/plugin/quuid/tst_quuid.cpp +++ b/tests/benchmarks/corelib/plugin/quuid/tst_quuid.cpp @@ -56,6 +56,8 @@ private slots: void fromChar(); void toString(); void fromString(); + void toByteArray(); + void fromByteArray(); void toDataStream(); void fromDataStream(); void isNull(); @@ -93,6 +95,22 @@ void tst_bench_QUuid::fromString() } } +void tst_bench_QUuid::toByteArray() +{ + QUuid uuid = QUuid::createUuid(); + QBENCHMARK { + uuid.toByteArray(); + } +} + +void tst_bench_QUuid::fromByteArray() +{ + QByteArray string = "{67C8770B-44F1-410A-AB9A-F9B5446F13EE}"; + QBENCHMARK { + QUuid uuid(string); + } +} + void tst_bench_QUuid::toDataStream() { QUuid uuid1, uuid2; |