aboutsummaryrefslogtreecommitdiff
path: root/agent/src/test/java/com/code_intelligence/jazzer/instrumentor/HookValidationTest.kt
diff options
context:
space:
mode:
Diffstat (limited to 'agent/src/test/java/com/code_intelligence/jazzer/instrumentor/HookValidationTest.kt')
-rw-r--r--agent/src/test/java/com/code_intelligence/jazzer/instrumentor/HookValidationTest.kt6
1 files changed, 4 insertions, 2 deletions
diff --git a/agent/src/test/java/com/code_intelligence/jazzer/instrumentor/HookValidationTest.kt b/agent/src/test/java/com/code_intelligence/jazzer/instrumentor/HookValidationTest.kt
index 7e7c31c9..ac263dc5 100644
--- a/agent/src/test/java/com/code_intelligence/jazzer/instrumentor/HookValidationTest.kt
+++ b/agent/src/test/java/com/code_intelligence/jazzer/instrumentor/HookValidationTest.kt
@@ -22,7 +22,8 @@ import kotlin.test.assertFailsWith
class HookValidationTest {
@Test
fun testValidHooks() {
- assertEquals(6, loadHooks(ValidHookMocks::class.java).size)
+ val hooks = Hooks.loadHooks(setOf(ValidHookMocks::class.java.name)).first().hooks
+ assertEquals(5, hooks.size)
}
@Test
@@ -30,7 +31,8 @@ class HookValidationTest {
for (method in InvalidHookMocks::class.java.methods) {
if (method.isAnnotationPresent(MethodHook::class.java)) {
assertFailsWith<IllegalArgumentException>("Expected ${method.name} to be an invalid hook") {
- Hook.verifyAndGetHook(method, method.declaredAnnotations.first() as MethodHook)
+ val methodHook = method.declaredAnnotations.first() as MethodHook
+ Hook.createAndVerifyHook(method, methodHook, methodHook.targetClassName)
}
}
}