| 34 | namespace __interception { |
| 35 | |
| 36 | TEST(Interception, InterceptFunction) { |
| 37 | uptr malloc_address = 0; |
| 38 | EXPECT_TRUE(InterceptFunction("malloc", &malloc_address, 0, 0)); |
| 39 | EXPECT_NE(0U, malloc_address); |
| 40 | EXPECT_FALSE(InterceptFunction("malloc", &malloc_address, 0, 1)); |
| 41 | |
| 42 | uptr dummy_address = 0; |
| 43 | EXPECT_FALSE(InterceptFunction("dummy_doesnt_exist__", &dummy_address, 0, 0)); |
| 44 | EXPECT_EQ(0U, dummy_address); |
| 45 | } |
| 46 | |
| 47 | TEST(Interception, Basic) { |
| 48 | EXPECT_TRUE(INTERCEPT_FUNCTION(isdigit)); |
nothing calls this directly
no test coverage detected