INN commit: branches/2.6 (3 files)
INN Commit
rra at isc.org
Sun Nov 27 13:56:41 UTC 2016
Date: Sunday, November 27, 2016 @ 05:56:40
Author: iulius
Revision: 10130
Update to latest rra-c-util and C TAP Harness upstream versions
Modified:
branches/2.6/lib/getaddrinfo.c
branches/2.6/tests/tap/basic.c
branches/2.6/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:53:54 UTC (rev 10129)
+++ lib/getaddrinfo.c 2016-11-27 13:56:40 UTC (rev 10130)
@@ -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:53:54 UTC (rev 10129)
+++ tests/tap/basic.c 2016-11-27 13:56:40 UTC (rev 10130)
@@ -539,6 +539,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:53:54 UTC (rev 10129)
+++ tests/tap/basic.h 2016-11-27 13:56:40 UTC (rev 10130)
@@ -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