VU-Programming / copp-skeleton

Project Application Development skeleton for C
Other
21 stars 50 forks source link

Add hardening tests #30

Closed sse245 closed 1 year ago

sse245 commented 1 year ago

Adds a test suite for the hardening bonus. The following things are tested and should be handled appropriately by a student's implementation:

For the above tests the student's implementation should return -1 for init_ijvm.

For the above tests the student's implementation should cause a successive call to finished() to return true. The invalid code should not cause any errors like segmentation faults, but an error message can be printed.

For the above tests the student's implementation should match the behaviour of Java. For an overflow that means that the number rolls over from 2147483647 to -2147483648 and continues the operation from there. For an underflow that means that the number rolls over from -2147483648 to 2147483647 and continues the operation from there.

Sanitizers should be run separately and should not indicate any errors.