logo

system-testsuite

Unix system testsuite (highlights broken bits in GNU and BusyBox)

abs.c (409B)


  1. #include <atf-c.h> // ATF*, atf*
  2. #include <limits.h> // INT_MIN
  3. #include <stdlib.h> // abs
  4. ATF_TC(abs_int_min);
  5. ATF_TC_HEAD(abs_int_min, tc)
  6. {
  7. atf_tc_set_md_var(tc, "descr", "abs(3) returning negative value for INT_MIN");
  8. }
  9. ATF_TC_BODY(abs_int_min, tc)
  10. {
  11. ATF_CHECK(INT_MIN != abs(INT_MIN));
  12. ATF_CHECK(abs(INT_MIN) >= 0);
  13. }
  14. ATF_TP_ADD_TCS(tp)
  15. {
  16. ATF_TP_ADD_TC(tp, abs_int_min);
  17. return atf_no_error();
  18. }