Clean up and explain libs_utils.h^WCHECK.h.
Test: treehugger
Change-Id: I73d6ed21520a0c2659826d1c01479917ed9b388d
diff --git a/tests/libs/libs_utils.h b/tests/libs/CHECK.h
similarity index 71%
rename from tests/libs/libs_utils.h
rename to tests/libs/CHECK.h
index 7dae241..2575d5b 100644
--- a/tests/libs/libs_utils.h
+++ b/tests/libs/CHECK.h
@@ -14,14 +14,13 @@
* limitations under the License.
*/
-#ifndef LIBS_UTILS_H
-#define LIBS_UTILS_H
+#pragma once
+
+// Tests proper can use libbase, but libraries for testing dlopen()
+// should probably avoid dependencies other than ones we're specifically
+// trying to test.
#include <assert.h>
-#include <stdio.h>
-#include <stdlib.h>
#define CHECK(e) \
- ((e) ? static_cast<void>(0) : __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, #e))
-
-#endif // LIBS_UTILS_H
+ ((e) ? static_cast<void>(0) : __assert2(__FILE__, __LINE__, __PRETTY_FUNCTION__, #e))
diff --git a/tests/libs/cfi_test_helper.cpp b/tests/libs/cfi_test_helper.cpp
index c1a7b6d..71cdc89 100644
--- a/tests/libs/cfi_test_helper.cpp
+++ b/tests/libs/cfi_test_helper.cpp
@@ -14,11 +14,10 @@
* limitations under the License.
*/
-#include <assert.h>
#include <stdint.h>
#include <stdlib.h>
-#include "libs_utils.h"
+#include "CHECK.h"
// This library is built for all targets, including host tests, so __cfi_slowpath may not be
// present. But it is only used in the bionic loader tests.
diff --git a/tests/libs/cfi_test_helper2.cpp b/tests/libs/cfi_test_helper2.cpp
index 11a6036..d7cd495 100644
--- a/tests/libs/cfi_test_helper2.cpp
+++ b/tests/libs/cfi_test_helper2.cpp
@@ -14,10 +14,9 @@
* limitations under the License.
*/
-#include <assert.h>
#include <dlfcn.h>
-#include "libs_utils.h"
+#include "CHECK.h"
int main(void) {
void* handle;
diff --git a/tests/libs/preinit_getauxval_test_helper.cpp b/tests/libs/preinit_getauxval_test_helper.cpp
index 2a79b97..53d4cc9 100644
--- a/tests/libs/preinit_getauxval_test_helper.cpp
+++ b/tests/libs/preinit_getauxval_test_helper.cpp
@@ -19,7 +19,7 @@
#include <unistd.h>
#include <sys/auxv.h>
-#include "libs_utils.h"
+#include "CHECK.h"
static unsigned long g_AT_RANDOM;
static unsigned long g_AT_PAGESZ;
diff --git a/tests/libs/preinit_syscall_test_helper.cpp b/tests/libs/preinit_syscall_test_helper.cpp
index 9b6b6df..3ca8131 100644
--- a/tests/libs/preinit_syscall_test_helper.cpp
+++ b/tests/libs/preinit_syscall_test_helper.cpp
@@ -19,7 +19,7 @@
#include <unistd.h>
#include <sys/auxv.h>
-#include "libs_utils.h"
+#include "CHECK.h"
static ssize_t g_result;
static int g_errno;
diff --git a/tests/libs/stack_tagging_helper.cpp b/tests/libs/stack_tagging_helper.cpp
index 7396dd0..e7e26af 100644
--- a/tests/libs/stack_tagging_helper.cpp
+++ b/tests/libs/stack_tagging_helper.cpp
@@ -28,7 +28,7 @@
#include <bionic/malloc.h>
-#include "libs_utils.h"
+#include "CHECK.h"
#if defined(__aarch64__)