INN commit: trunk (3 files)

INN Commit rra at isc.org
Sun Nov 27 13:50:18 UTC 2016


    Date: Sunday, November 27, 2016 @ 05:50:17
  Author: iulius
Revision: 10128

Update to latest rra-c-util and C TAP Harness upstream versions

Modified:
  trunk/lib/getaddrinfo.c
  trunk/tests/tap/basic.c
  trunk/tests/tap/basic.h

-------------------+
 lib/getaddrinfo.c |    1 +
 tests/tap/basic.c |   26 ++++++++++++++++++++++++++
 tests/tap/basic.h |    6 +++++-
 3 files changed, 32 insertions(+), 1 deletion(-)

Modified: lib/getaddrinfo.c
===================================================================
--- lib/getaddrinfo.c	2016-11-27 13:43:25 UTC (rev 10127)
+++ lib/getaddrinfo.c	2016-11-27 13:50:17 UTC (rev 10128)
@@ -217,6 +217,7 @@
     else {
         ai->ai_canonname = strdup(canonical);
         if (ai->ai_canonname == NULL) {
+            /* sin will be freed by freeaddrinfo. */
             freeaddrinfo(ai);
             return NULL;
         }

Modified: tests/tap/basic.c
===================================================================
--- tests/tap/basic.c	2016-11-27 13:43:25 UTC (rev 10127)
+++ tests/tap/basic.c	2016-11-27 13:50:17 UTC (rev 10128)
@@ -543,6 +543,32 @@
 
 
 /*
+ * Takes an expected boolean value and a seen boolean value and assumes the
+ * test passes if the truth value of both match.
+ */
+int
+is_bool(int wanted, int seen, const char *format, ...)
+{
+    int success;
+
+    fflush(stderr);
+    check_diag_files();
+    success = (!!wanted == !!seen);
+    if (success)
+        printf("ok %lu", testnum++);
+    else {
+        diag("wanted: %s", !!wanted ? "true" : "false");
+        diag("  seen: %s", !!seen ? "true" : "false");
+        printf("not ok %lu", testnum++);
+        _failed++;
+    }
+    PRINT_DESC(" - ", format);
+    putchar('\n');
+    return success;
+}
+
+
+/*
  * Takes an expected integer and a seen integer and assumes the test passes
  * if those two numbers match.
  */

Modified: tests/tap/basic.h
===================================================================
--- tests/tap/basic.h	2016-11-27 13:43:25 UTC (rev 10127)
+++ tests/tap/basic.h	2016-11-27 13:50:17 UTC (rev 10128)
@@ -116,8 +116,12 @@
 
 /*
  * Check an expected value against a seen value.  Returns true if the test
- * passes and false if it fails.
+ * passes and false if it fails.  is_bool takes an int since the bool type
+ * isn't fully portable yet, but interprets both arguments for their truth
+ * value, not for their numeric value.
  */
+int is_bool(int wanted, int seen, const char *format, ...)
+    __attribute__((__format__(printf, 3, 4)));
 int is_int(long wanted, long seen, const char *format, ...)
     __attribute__((__format__(printf, 3, 4)));
 int is_string(const char *wanted, const char *seen, const char *format, ...)



More information about the inn-committers mailing list