exercism / c

Exercism exercises in C.
https://exercism.org/tracks/c
MIT License
298 stars 181 forks source link

Return `int` in pop-count example #949

Closed ryanplusplus closed 9 months ago

ryanplusplus commented 10 months ago

I noticed this when doing the exercise. Our example returns an unsigned int, but the tests check for int.

github-actions[bot] commented 10 months ago

This PR touches files which potentially affect the outcome of the tests of an exercise. This will cause all students' solutions to affected exercises to be re-tested.

If this PR does not affect the result of the test (or, for example, adds an edge case that is not worth rerunning all tests for), please add the following to the merge-commit message which will stops student's tests from re-running. Please copy-paste to avoid typos.

[no important files changed]

For more information, refer to the documentation. If you are unsure whether to add the message or not, please ping @exercism/maintainers-admin in a comment. Thank you!

ahans commented 10 months ago

Is the issue that the test uses TEST_ASSERT_EQUAL_INT instead of TEST_ASSERT_EQUAL_UINT? In that case I think it'd be much better to change the test. Requiring students to implement their function returning int would be quite unexpected, given that in the tests expected is of type unsigned int. Since this exercise was only published yesterday, there are probably not many solutions that would require retesting.

ryanplusplus commented 10 months ago

Is the issue that the test uses TEST_ASSERT_EQUAL_INT instead of TEST_ASSERT_EQUAL_UINT? In that case I think it'd be much better to change the test. Requiring students to implement their function returning int would be quite unexpected, given that in the tests expected is of type unsigned int. Since this exercise was only published yesterday, there are probably not many solutions that would require retesting.

Yep, good point. I'll switch back to my initial approach.