Skip to content

Commit 196165e

Browse files
authored
Update wave_sort.cpp
1 parent 838a9e2 commit 196165e

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

sorting/wave_sort.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -53,31 +53,31 @@ static void test() {
5353
std::cout << "Test 1... ";
5454
std::vector<int> arr1 = sorting::wave_sort::waveSort(array1,7);
5555
const std::vector<int> o1 = {2, 1, 10, 5, 49, 23, 90};
56-
assert(std::equal(arr1.begin(),arr1.end(),o1.begin(),o1.end()));
56+
assert(arr1==o1);
5757
std::cout << "passed" << std::endl;
5858

5959
// [1, 3, 4, 2, 7, 8] return [2, 1, 4, 3, 8, 7]
6060
std::vector<int> array2 = {1, 3, 4, 2, 7, 8};
6161
std::cout << "Test 2... ";
6262
std::vector<int> arr2 = sorting::wave_sort::waveSort(array2,6);
6363
const std::vector<int> o2 = {2, 1, 4, 3, 8, 7};
64-
assert(std::equal(arr2.begin(),arr2.end(),o2.begin(),o2.end()));
64+
assert(arr2==o2);
6565
std::cout << "passed" << std::endl;
6666

6767
// [3, 3, 3, 3] return [3, 3, 3, 3]
6868
std::vector<int> array3 = {3, 3, 3, 3};
6969
std::cout << "Test 3... ";
7070
std::vector<int> arr3 = sorting::wave_sort::waveSort(array3,4);
7171
const std::vector<int> o3 = {3, 3, 3, 3};
72-
assert(std::equal(arr3.begin(),arr3.end(),o3.begin(),o3.end()));
72+
assert(arr3==o3);
7373
std::cout << "passed" << std::endl;
7474

7575
// [9, 4, 6, 8, 14, 3] return [4, 3, 8, 6, 14, 9]
7676
std::vector<int> array4 = {9, 4, 6, 8, 14, 3};
7777
std::cout << "Test 4... ";
7878
std::vector<int> arr4 = sorting::wave_sort::waveSort(array4,6);
7979
const std::vector<int> o4 = {4, 3, 8, 6, 14, 9};
80-
assert(std::equal(arr4.begin(),arr4.end(),o4.begin(),o4.end()));
80+
assert(arr4==o4);
8181
std::cout << "passed" << std::endl;
8282
}
8383

0 commit comments

Comments
 (0)