From 642155703e9d91db6229f3863b885104e49f0b61 Mon Sep 17 00:00:00 2001 From: Robin Burchell Date: Sat, 21 Jan 2012 13:54:36 +0200 Subject: Minor style fixups. Add spaces where necessary, and pull braces back to the same line. Change-Id: If543686c9727a110f8a91f1a88e08d5d2ac12284 Reviewed-by: Richard J. Moore --- .../corelib/tools/qalgorithms/tst_qalgorithms.cpp | 29 +++++++++------------- 1 file changed, 12 insertions(+), 17 deletions(-) (limited to 'tests/auto/corelib') diff --git a/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp b/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp index 5735c4043b..d88fb9a82f 100644 --- a/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp +++ b/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp @@ -105,29 +105,24 @@ QVector generateData(QString dataSetType, const int length) { QVector container; if (dataSetType == "Random") { - for(int i=0; i < length; ++i) + for (int i = 0; i < length; ++i) container.append(rand()); - } - else if (dataSetType == "Ascending") { - for (int i=0; i < length; ++i) + } else if (dataSetType == "Ascending") { + for (int i = 0; i < length; ++i) container.append(i); - } - else if (dataSetType == "Descending") { - for (int i=0; i < length; ++i) + } else if (dataSetType == "Descending") { + for (int i = 0; i < length; ++i) container.append(length - i); - } - else if (dataSetType == "Equal") { - for (int i=0; i < length; ++i) + } else if (dataSetType == "Equal") { + for (int i = 0; i < length; ++i) container.append(43); - } - else if (dataSetType == "Duplicates") { - for (int i=0; i < length; ++i) + } else if (dataSetType == "Duplicates") { + for (int i = 0; i < length; ++i) container.append(i % 10); - } - else if (dataSetType == "Almost Sorted") { - for (int i=0; i < length; ++i) + } else if (dataSetType == "Almost Sorted") { + for (int i = 0; i < length; ++i) container.append(i); - for(int i = 0; i<= length / 10; ++i) { + for (int i = 0; i <= length / 10; ++i) { const int iswap = i * 9; DataType tmp = container.at(iswap); container[iswap] = container.at(iswap + 1); -- cgit v1.2.3