Make tests/libs/CHECK.h work on the host

The `__assert2` function is not provided by glibc, in particular.

Bug: none
Test: manual
Change-Id: I72c428fd0794aceec2bfaf37638be0ff6a02f289
diff --git a/tests/libs/CHECK.h b/tests/libs/CHECK.h
index 2575d5b..5870b07 100644
--- a/tests/libs/CHECK.h
+++ b/tests/libs/CHECK.h
@@ -20,7 +20,15 @@
 // should probably avoid dependencies other than ones we're specifically
 // trying to test.
 
-#include <assert.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+static inline void check_failure(const char* file, int line, const char* function,
+                                 const char* failed_expression) {
+  fprintf(stderr, "%s:%d: %s: assertion \"%s\" failed\n", file, line, function, failed_expression);
+  fflush(stderr);
+  abort();
+}
 
 #define CHECK(e) \
-  ((e) ? static_cast<void>(0) : __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, #e))
+  ((e) ? static_cast<void>(0) : check_failure(__FILE__, __LINE__, __PRETTY_FUNCTION__, #e))