aboutsummaryrefslogtreecommitdiff
path: root/test/common/algorithm.h
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2013-04-18 23:34:29 +0200
committerWillem Jan Palenstijn2013-05-08 20:39:44 +0200
commit01f3f3a8dd0ad2891939d03b0ce47cbf36ea9bc6 (patch)
tree544b07f3aa41abe7907bcd2040cdad11ebc324bb /test/common/algorithm.h
parent9cf2c83e5e5a35816ab153bf8443dac691829ea8 (diff)
parenta41d72a44a660c72fdadbc3a8ef580e5e03cb890 (diff)
downloadscummvm-rg350-01f3f3a8dd0ad2891939d03b0ce47cbf36ea9bc6.tar.gz
scummvm-rg350-01f3f3a8dd0ad2891939d03b0ce47cbf36ea9bc6.tar.bz2
scummvm-rg350-01f3f3a8dd0ad2891939d03b0ce47cbf36ea9bc6.zip
Merge branch 'master'
Diffstat (limited to 'test/common/algorithm.h')
-rw-r--r--test/common/algorithm.h25
1 files changed, 12 insertions, 13 deletions
diff --git a/test/common/algorithm.h b/test/common/algorithm.h
index 4d7e9b2e20..6eecae3635 100644
--- a/test/common/algorithm.h
+++ b/test/common/algorithm.h
@@ -38,30 +38,30 @@ public:
const int arraySorted[] = { 1, 2, 3, 3, 4, 5 };
const int arrayUnsorted[] = { 5, 3, 1, 2, 4, 3 };
- TS_ASSERT_EQUALS(checkSort(arraySorted, arraySorted + ARRAYSIZE(arraySorted), Common::Less<int>()), true);
- TS_ASSERT_EQUALS(checkSort(arraySorted, arraySorted + ARRAYSIZE(arraySorted), Common::Greater<int>()), false);
+ TS_ASSERT_EQUALS(checkSort(arraySorted, ARRAYEND(arraySorted), Common::Less<int>()), true);
+ TS_ASSERT_EQUALS(checkSort(arraySorted, ARRAYEND(arraySorted), Common::Greater<int>()), false);
- TS_ASSERT_EQUALS(checkSort(arrayUnsorted, arrayUnsorted + ARRAYSIZE(arrayUnsorted), Common::Less<int>()), false);
- TS_ASSERT_EQUALS(checkSort(arrayUnsorted, arrayUnsorted + ARRAYSIZE(arrayUnsorted), Common::Greater<int>()), false);
+ TS_ASSERT_EQUALS(checkSort(arrayUnsorted, ARRAYEND(arrayUnsorted), Common::Less<int>()), false);
+ TS_ASSERT_EQUALS(checkSort(arrayUnsorted, ARRAYEND(arrayUnsorted), Common::Greater<int>()), false);
}
void test_pod_sort() {
{
int array[] = { 63, 11, 31, 72, 1, 48, 32, 69, 38, 31 };
- Common::sort(array, array + ARRAYSIZE(array));
- TS_ASSERT_EQUALS(checkSort(array, array + ARRAYSIZE(array), Common::Less<int>()), true);
+ Common::sort(array, ARRAYEND(array));
+ TS_ASSERT_EQUALS(checkSort(array, ARRAYEND(array), Common::Less<int>()), true);
// already sorted
- Common::sort(array, array + ARRAYSIZE(array));
- TS_ASSERT_EQUALS(checkSort(array, array + ARRAYSIZE(array), Common::Less<int>()), true);
+ Common::sort(array, ARRAYEND(array));
+ TS_ASSERT_EQUALS(checkSort(array, ARRAYEND(array), Common::Less<int>()), true);
}
{
int array[] = { 90, 80, 70, 60, 50, 40, 30, 20, 10 };
- Common::sort(array, array + ARRAYSIZE(array));
- TS_ASSERT_EQUALS(checkSort(array, array + ARRAYSIZE(array), Common::Less<int>()), true);
+ Common::sort(array, ARRAYEND(array));
+ TS_ASSERT_EQUALS(checkSort(array, ARRAYEND(array), Common::Less<int>()), true);
- Common::sort(array, array + ARRAYSIZE(array), Common::Greater<int>());
- TS_ASSERT_EQUALS(checkSort(array, array + ARRAYSIZE(array), Common::Greater<int>()), true);
+ Common::sort(array, ARRAYEND(array), Common::Greater<int>());
+ TS_ASSERT_EQUALS(checkSort(array, ARRAYEND(array), Common::Greater<int>()), true);
}
}
@@ -80,4 +80,3 @@ public:
TS_ASSERT_EQUALS(checkSort(list.begin(), list.end(), Common::Less<Item>()), true);
}
};
-