summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp')
-rw-r--r--tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp33
1 files changed, 14 insertions, 19 deletions
diff --git a/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp b/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp
index 5735c4043b..1d7cb1e903 100644
--- a/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp
+++ b/tests/auto/corelib/tools/qalgorithms/tst_qalgorithms.cpp
@@ -1,8 +1,7 @@
/****************************************************************************
**
** Copyright (C) 2012 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
+** Contact: http://www.qt-project.org/
**
** This file is part of the test suite of the Qt Toolkit.
**
@@ -35,6 +34,7 @@
**
**
**
+**
** $QT_END_LICENSE$
**
****************************************************************************/
@@ -105,29 +105,24 @@ QVector<DataType> generateData(QString dataSetType, const int length)
{
QVector<DataType> 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);