diff options
Diffstat (limited to 'lib/interception/tests/interception_linux_test.cc')
-rw-r--r-- | lib/interception/tests/interception_linux_test.cc | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/interception/tests/interception_linux_test.cc b/lib/interception/tests/interception_linux_test.cc index cc09aa09d..3e859cb1a 100644 --- a/lib/interception/tests/interception_linux_test.cc +++ b/lib/interception/tests/interception_linux_test.cc @@ -1,9 +1,8 @@ //===-- interception_linux_test.cc ----------------------------------------===// // -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // @@ -34,19 +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, Basic) { - ASSERT_TRUE(INTERCEPT_FUNCTION(isdigit)); + EXPECT_TRUE(INTERCEPT_FUNCTION(isdigit)); // After interception, the counter should be incremented. InterceptorFunctionCalled = 0; |