summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/interception/tests/interception_linux_test.cc
diff options
context:
space:
mode:
Diffstat (limited to 'compiler-rt/lib/interception/tests/interception_linux_test.cc')
-rw-r--r--compiler-rt/lib/interception/tests/interception_linux_test.cc15
1 files changed, 5 insertions, 10 deletions
diff --git a/compiler-rt/lib/interception/tests/interception_linux_test.cc b/compiler-rt/lib/interception/tests/interception_linux_test.cc
index 5a1ca6ecbf5..3e859cb1a55 100644
--- a/compiler-rt/lib/interception/tests/interception_linux_test.cc
+++ b/compiler-rt/lib/interception/tests/interception_linux_test.cc
@@ -33,24 +33,19 @@ INTERCEPTOR(int, isdigit, int d) {
namespace __interception {
-TEST(Interception, GetRealFunctionAddress) {
+TEST(Interception, InterceptFunction) {
uptr malloc_address = 0;
- EXPECT_TRUE(GetRealFunctionAddress("malloc", &malloc_address, 0, 0));
+ EXPECT_TRUE(InterceptFunction("malloc", &malloc_address, 0, 0));
EXPECT_NE(0U, malloc_address);
+ EXPECT_FALSE(InterceptFunction("malloc", &malloc_address, 0, 1));
uptr dummy_address = 0;
- EXPECT_TRUE(
- GetRealFunctionAddress("dummy_doesnt_exist__", &dummy_address, 0, 0));
+ EXPECT_FALSE(InterceptFunction("dummy_doesnt_exist__", &dummy_address, 0, 0));
EXPECT_EQ(0U, dummy_address);
}
-TEST(Interception, GetFuncAddr) {
- EXPECT_NE(GetFuncAddr("malloc"), nullptr);
- EXPECT_EQ(GetFuncAddr("does_not_exist"), nullptr);
-}
-
TEST(Interception, Basic) {
- INTERCEPT_FUNCTION(isdigit);
+ EXPECT_TRUE(INTERCEPT_FUNCTION(isdigit));
// After interception, the counter should be incremented.
InterceptorFunctionCalled = 0;
OpenPOWER on IntegriCloud