abs.c (409B)
- #include <atf-c.h> // ATF*, atf*
- #include <limits.h> // INT_MIN
- #include <stdlib.h> // abs
- ATF_TC(abs_int_min);
- ATF_TC_HEAD(abs_int_min, tc)
- {
- atf_tc_set_md_var(tc, "descr", "abs(3) returning negative value for INT_MIN");
- }
- ATF_TC_BODY(abs_int_min, tc)
- {
- ATF_CHECK(INT_MIN != abs(INT_MIN));
- ATF_CHECK(abs(INT_MIN) >= 0);
- }
- ATF_TP_ADD_TCS(tp)
- {
- ATF_TP_ADD_TC(tp, abs_int_min);
- return atf_no_error();
- }