mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 10:52:56 +00:00
add qstrcmp() and qstrncmp() benchmarks
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
c34822f9d9
commit
5d8fc65afc
1 changed files with 16 additions and 0 deletions
|
@ -36,6 +36,8 @@ private slots:
|
|||
void compress_uncompress();
|
||||
void to_from_base64();
|
||||
void to_from_hex();
|
||||
void bench_qstrcmp();
|
||||
void bench_qstrncmp();
|
||||
};
|
||||
|
||||
|
||||
|
@ -111,6 +113,20 @@ void tst_qbytearray::to_from_hex() {
|
|||
}
|
||||
}
|
||||
|
||||
void tst_qbytearray::bench_qstrcmp() {
|
||||
QBENCHMARK {
|
||||
const int result = qstrcmp(lorem.constData(), lorem.constData());
|
||||
Q_UNUSED(result);
|
||||
}
|
||||
}
|
||||
|
||||
void tst_qbytearray::bench_qstrncmp() {
|
||||
static const int loremsize = lorem.size();
|
||||
QBENCHMARK {
|
||||
const int result = qstrncmp(lorem.constData(), lorem.constData(), loremsize);
|
||||
Q_UNUSED(result);
|
||||
}
|
||||
}
|
||||
|
||||
QTEST_MAIN(tst_qbytearray)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue