/*-
* Copyright (c) 2004 Nik Clayton
+ * 2017 Jérémie Galarneau
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
+#include <limits.h>
+#include <assert.h>
#include "tap.h"
static void _tap_init(void);
static void _cleanup(void);
+#ifdef __MINGW32__
+static inline
+void flockfile (FILE * filehandle) {
+ return;
+}
+
+static inline
+void funlockfile(FILE * filehandle) {
+ return;
+}
+#endif
+
/*
* Generate a test result.
*
return 0;
}
+void
+diag_multiline(const char *val)
+{
+ size_t len, i, line_start_idx = 0;
+
+ assert(val);
+ len = strlen(val);
+
+ for (i = 0; i < len; i++) {
+ int line_length;
+
+ if (val[i] != '\n') {
+ continue;
+ }
+
+ assert((i - line_start_idx + 1) <= INT_MAX);
+ line_length = i - line_start_idx + 1;
+ fprintf(stderr, "# %.*s", line_length, &val[line_start_idx]);
+ line_start_idx = i + 1;
+ }
+}
+
void
_expected_tests(unsigned int tests)
{