aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorJohannes Schickel2009-12-27 11:05:43 +0000
committerJohannes Schickel2009-12-27 11:05:43 +0000
commit1cd917f67446be1438fabfdec43b87e6f6f797a7 (patch)
treef0ea447456fedb2aeb98115fb23b12f9da8c0e90 /test
parent7f8beedda72d14216abe91fb5c24a06cd9dc9da3 (diff)
downloadscummvm-rg350-1cd917f67446be1438fabfdec43b87e6f6f797a7.tar.gz
scummvm-rg350-1cd917f67446be1438fabfdec43b87e6f6f797a7.tar.bz2
scummvm-rg350-1cd917f67446be1438fabfdec43b87e6f6f797a7.zip
More cleanup.
svn-id: r46619
Diffstat (limited to 'test')
-rw-r--r--test/common/algorithm.h20
1 files changed, 9 insertions, 11 deletions
diff --git a/test/common/algorithm.h b/test/common/algorithm.h
index 4d53c87099..8ce0290c7e 100644
--- a/test/common/algorithm.h
+++ b/test/common/algorithm.h
@@ -22,14 +22,11 @@ class AlgorithmTestSuite : public CxxTest::TestSuite {
struct Item {
int value;
Item(int v) : value(v) {}
- };
- struct ItemCmp {
- bool operator()(const Item &a, const Item &b) {
- return a.value < b.value;
+ bool operator<(const Item &r) const {
+ return value < r.value;
}
};
-
public:
void test_pod_sort() {
{
@@ -37,7 +34,8 @@ public:
Common::sort(array, array + ARRAYSIZE(array));
checkSort(array, array + ARRAYSIZE(array), Common::Less<int>());
- Common::sort(array, array + ARRAYSIZE(array)); //already sorted one
+ // already sorted
+ Common::sort(array, array + ARRAYSIZE(array));
checkSort(array, array + ARRAYSIZE(array), Common::Less<int>());
}
{
@@ -57,12 +55,12 @@ public:
for(int i = 0; i < n; ++i)
list.push_back(Item(i * 0xDEADBEEF % 1337));
- Common::sort(list.begin(), list.end(), ItemCmp());
- checkSort(list.begin(), list.end(), ItemCmp());
+ Common::sort(list.begin(), list.end(), Common::Less<Item>());
+ checkSort(list.begin(), list.end(), Common::Less<Item>());
- //already sorted
- Common::sort(list.begin(), list.end(), ItemCmp());
- checkSort(list.begin(), list.end(), ItemCmp());
+ // already sorted
+ Common::sort(list.begin(), list.end(), Common::Less<Item>());
+ checkSort(list.begin(), list.end(), Common::Less<Item>());
}
};