From e7e179aabd661279184e342b644e1bdb8cec7032 Mon Sep 17 00:00:00 2001 From: Edward Welbourne Date: Wed, 5 Oct 2022 14:59:52 +0200 Subject: [PATCH] tst_QAlgorithms: fix misleading indent in data table MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A violation of coding style (requiring braces on multi-line bodies of conditionals) was accompanied by a mis-indented else block. Fix a long line while I'm about it. Change-Id: Ibe9cf15eadbe9ef58138d7876e5e2c5a14a92fd4 Reviewed-by: MÃ¥rten Nordheim Reviewed-by: Marc Mutz (cherry picked from commit 0d915623ecef9d81f25c3891101b68384331233d) --- .../tools/qalgorithms/tst_qalgorithms.cpp | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp b/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp index 7e1cd8dcf15..0ac0b7cd13f 100644 --- a/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp +++ b/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp @@ -253,19 +253,22 @@ void tst_QAlgorithms::popCount_data_impl(size_t sizeof_T_Int) } // and some random ones: - if (sizeof_T_Int >= 8) + if (sizeof_T_Int >= 8) { for (size_t i = 0; i < 1000; ++i) { const quint64 input = QRandomGenerator::global()->generate64(); QTest::addRow("0x%016llx", input) << input << bitsSetInInt64(input); } - else if (sizeof_T_Int >= 2) - for (size_t i = 0; i < 1000 ; ++i) { - const quint32 input = QRandomGenerator::global()->generate(); - if (sizeof_T_Int >= 4) - QTest::addRow("0x%08x", input) << quint64(input) << bitsSetInInt(input); - else - QTest::addRow("0x%04x", quint16(input & 0xFFFF)) << quint64(input & 0xFFFF) << bitsSetInShort(input & 0xFFFF); + } else if (sizeof_T_Int >= 2) { + for (size_t i = 0; i < 1000 ; ++i) { + const quint32 input = QRandomGenerator::global()->generate(); + if (sizeof_T_Int >= 4) { + QTest::addRow("0x%08x", input) << quint64(input) << bitsSetInInt(input); + } else { + QTest::addRow("0x%04x", quint16(input & 0xFFFF)) + << quint64(input & 0xFFFF) << bitsSetInShort(input & 0xFFFF); } + } + } } template