aboutsummaryrefslogtreecommitdiff
path: root/test/common/algorithm.h
diff options
context:
space:
mode:
authorMatthew Hoops2011-08-26 22:44:17 -0400
committerMatthew Hoops2011-08-26 22:44:17 -0400
commit4a69dc13d92e82fff85dc5a3a923b74ced259ffa (patch)
tree8945cd3745fd65f28b043caf7b1beddbbce2b2a1 /test/common/algorithm.h
parentad293b249e74dd1cfbdbd721d02145efbdaf9eca (diff)
parent5e174cbfe466dbbe8e5470b0a00de1481b986181 (diff)
downloadscummvm-rg350-4a69dc13d92e82fff85dc5a3a923b74ced259ffa.tar.gz
scummvm-rg350-4a69dc13d92e82fff85dc5a3a923b74ced259ffa.tar.bz2
scummvm-rg350-4a69dc13d92e82fff85dc5a3a923b74ced259ffa.zip
Merge remote branch 'upstream/master' into pegasus
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);
}
};
-