|
@@ -86,6 +86,21 @@ static void testFail() {
|
|
#endif
|
|
#endif
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+BUBBLE_SORT(size_t, Size)
|
|
|
|
+#define greateThanSize(a, b) ((a) > (b))
|
|
|
|
+BUBBLE_SORT_SOURCE(size_t, Size, greateThanSize)
|
|
|
|
+
|
|
|
|
+static void testSort() {
|
|
|
|
+ size_t data[] = {9, 0, 3, 1, 8, 4, 6, 2, 5, 7};
|
|
|
|
+ size_t n = ARRAY_LENGTH(data);
|
|
|
|
+ bubbleSortSize(data, n);
|
|
|
|
+ bubbleSortSize(data, n);
|
|
|
|
+ bubbleSortSize(data, 0);
|
|
|
|
+ for(size_t i = 0; i < n; i++) {
|
|
|
|
+ TEST_SIZE(data[i], i);
|
|
|
|
+ }
|
|
|
|
+}
|
|
|
|
+
|
|
void testUtility(bool light) {
|
|
void testUtility(bool light) {
|
|
testPopCount();
|
|
testPopCount();
|
|
testZeroRellocate();
|
|
testZeroRellocate();
|
|
@@ -97,6 +112,7 @@ void testUtility(bool light) {
|
|
testSleep(light ? 50'000'000 : 1'300'000'000);
|
|
testSleep(light ? 50'000'000 : 1'300'000'000);
|
|
testSwap();
|
|
testSwap();
|
|
testFail();
|
|
testFail();
|
|
|
|
+ testSort();
|
|
}
|
|
}
|
|
|
|
|
|
static void outOfMemory(void*) {
|
|
static void outOfMemory(void*) {
|