logo

system-testsuite

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

strlen.c (402B)


  1. #include <atf-c.h> // ATF*, atf*
  2. #include <stdio.h> // fopen, fclose, fputs
  3. #include <errno.h> // errno
  4. #include <string.h> // strerror
  5. ATF_TC(strlen_null);
  6. ATF_TC_HEAD(strlen_null, tc)
  7. {
  8. atf_tc_set_md_var(tc, "descr", "works with being passed NULL");
  9. }
  10. ATF_TC_BODY(strlen_null, tc)
  11. {
  12. ATF_CHECK(strlen(NULL) == 0);
  13. }
  14. ATF_TP_ADD_TCS(tp)
  15. {
  16. ATF_TP_ADD_TC(tp, strlen_null);
  17. return atf_no_error();
  18. }