The subroutine assert_equal_int_arr calls test_fail_msg twice when testing an array of incorrect size. This results in double-counting of failed tests, as shown in the test summary.
Example
Testing incorrect solutions to the High Scores exercise
Before
When size is correct but contents are incorrect:
1: ERROR: Test 8: Personal top when there is only one
1: ERROR: Expected < 40 0 0 > but got < 99 0 0 >
1: Test summary: 5 of 8 tests failed
When size is incorrect:
1: ERROR: Test 8: Personal top when there is only one
1: ERROR: Arrays are not the same size!
1: ERROR: Expected < 40 0 0 > but got < 40 0 >
1: ERROR: Test 8: Personal top when there is only one
1: ERROR: Expected < 40 0 0 > but got < 40 0 >
1: Test summary: 10 of 8 tests failed
After
When size is correct but contents are incorrect:
1: ERROR: Test 8: Personal top when there is only one
1: ERROR: Expected < 40 0 0 > but got < 99 0 0 >
1: Test summary: 5 of 8 tests failed
When size is incorrect:
1: ERROR: Test 8: Personal top when there is only one
1: ERROR: Arrays are not the same size!
1: ERROR: Expected < 40 0 0 > but got < 40 0 >
1: Test summary: 5 of 8 tests failed
The subroutine
assert_equal_int_arr
callstest_fail_msg
twice when testing an array of incorrect size. This results in double-counting of failed tests, as shown in the test summary.Example
Testing incorrect solutions to the High Scores exercise
Before
When size is correct but contents are incorrect:
When size is incorrect:
After
When size is correct but contents are incorrect:
When size is incorrect: