1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
|
TEST_CASE("Testing sortRow() - 2"){
const unsigned int rows = 5;
const unsigned int columns = 5;
char first[rows][columns] = {
{'a', 'q', 'a', 'z', 'p'},
{'b', 'a', 'b', 'a', 'c'},
{'a', 'b', 'c', 'c', 'd'},
{'a', 'a', 'a', 'a', 'a'},
{'a', 'b', 'a', 'b', 'z'}
};
char firstSorted[rows][columns] = {
{'a', 'a', 'p', 'q', 'z'},
{'a', 'a', 'b', 'b', 'c'},
{'a', 'b', 'c', 'c', 'd'},
{'a', 'a', 'a', 'a', 'a'},
{'a', 'a', 'b', 'b', 'z'}
};
for (int i = 0; i < 5; i++){
sortRow(first, i);
}
for (int i = 0; i < rows; i++){
for (int j = 0; j < columns; j++){
REQUIRE(first[i][j] == firstSorted[i][j]);
}
}
}
|