Skip to content

Commit 098edd5

Browse files
author
CheerfulBear22
committed
Improved test code for slow_sort.c
1 parent b2d67f0 commit 098edd5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

sorting/slow_sort.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#include <stdio.h>
22
#include <stdlib.h>
33
#include <time.h>
4+
#include <assert.h>
45

56
/*Displays array passed as parameter*/
67
void display(int arr[], int size)
@@ -57,6 +58,11 @@ void test()
5758

5859
slowsort(arr, 0, size-1);
5960

61+
for (int i = 0; i < size - 1; i++)
62+
{
63+
assert(arr[i] <= arr[i+1]);
64+
}
65+
6066
display(arr, size);
6167

6268
free(arr);

0 commit comments

Comments
 (0)