chiark / gitweb /
signame.c test coverage -> 100%
authorRichard Kettlewell <rjk@greenend.org.uk>
Tue, 27 Nov 2007 20:49:04 +0000 (20:49 +0000)
committerRichard Kettlewell <rjk@greenend.org.uk>
Tue, 27 Nov 2007 20:49:04 +0000 (20:49 +0000)
Makefile.am
lib/test.c

index 99c4710..bba9048 100644 (file)
@@ -22,11 +22,9 @@ EXTRA_DIST=TODO CHANGES README.streams BUGS ChangeLog.d      \
 README.upgrades README.client README.mac README.raw
 SUBDIRS=@subdirs@
 
-check-recursive: before-check
+check-report: before-check check make-coverage-reports
 before-check:
        rm -f */*.gcda */*.gcov
-
-check-report: check make-coverage-reports
 make-coverage-reports:
        @for subdir in lib plugins server clients disobedience; do \
          echo cd $$subdir;\
index f4043b9..69dbf01 100644 (file)
@@ -42,6 +42,7 @@
 #include "unicode.h"
 #include "inputline.h"
 #include "wstat.h"
+#include "signame.h"
 
 static int tests, errors;
 static int fail_first;
@@ -673,6 +674,16 @@ static void test_unicode(void) {
   breaktest("auxiliary/WordBreakTest.txt", utf32_is_word_boundary);
 }
 
+static void test_signame(void) {
+  fprintf(stderr, "test_signame\n");
+  insist(find_signal("SIGTERM") == SIGTERM);
+  insist(find_signal("SIGHUP") == SIGHUP);
+  insist(find_signal("SIGINT") == SIGINT);
+  insist(find_signal("SIGQUIT") == SIGQUIT);
+  insist(find_signal("SIGKILL") == SIGKILL);
+  insist(find_signal("SIGYOURMUM") == -1);
+}
+
 int main(void) {
   fail_first = !!getenv("FAIL_FIRST");
   insist('\n' == 0x0A);
@@ -720,8 +731,9 @@ int main(void) {
   /* words.c */
   test_casefold();
   test_words();
-  /* XXX words() */
   /* wstat.c */
+  /* signame.c */
+  test_signame();
   fprintf(stderr,  "%d errors out of %d tests\n", errors, tests);
   return !!errors;
 }