#ifndef MESHLINK_TEST_UTILS_H
#define MESHLINK_TEST_UTILS_H
+#include <assert.h>
+#include <time.h>
+
#include "../src/meshlink.h"
// Simple synchronisation between threads
} while(0)
#endif
+
+/// Compare two timespec values.
+static bool timespec_lt(const struct timespec *a, const struct timespec *b) {
+ if(a->tv_sec == b->tv_sec) {
+ return a->tv_nsec < b->tv_nsec;
+ } else {
+ return a->tv_sec < b->tv_sec;
+ }
+}