Modified inparam test case to also test param capture by type.
authorJustin Seyster <jseyster@cs.sunysb.edu>
Tue, 26 Oct 2010 01:28:07 +0000 (21:28 -0400)
committerJustin Seyster <jseyster@cs.sunysb.edu>
Tue, 26 Oct 2010 01:28:07 +0000 (21:28 -0400)
test/plugin-inparam.c

index 0d83cf50b9a7102fe007cc7be106827aa829c180..afd24f335e9aaeb85b065734e839b42568e63938 100644 (file)
@@ -11,8 +11,9 @@ static void plugin_join_on_call(struct aop_joinpoint *jp, void *data)
   struct aop_dynval *p2;
 
   p1 = aop_capture_in_param(jp, 0);
-  p2 = aop_capture_in_param(jp, 1);
-  aop_insert_advice(jp, advice_name, AOP_INSERT_BEFORE, AOP_DYNVAL(p1), AOP_DYNVAL(p2), AOP_TERM_ARG);
+  p2 = aop_capture_in_param_by_type(jp, 1, aop_t_all_fp());
+  if (p2 != NULL)
+    aop_insert_advice(jp, advice_name, AOP_INSERT_BEFORE, AOP_DYNVAL(p1), AOP_DYNVAL(p2), AOP_TERM_ARG);
 }
 
 static unsigned int plugin_int()
@@ -22,7 +23,6 @@ static unsigned int plugin_int()
   pc = aop_match_function_entry();
   aop_filter_entry_by_name(pc, "foo");
   aop_filter_by_in_param(pc, 0, aop_t_all_signed());
-  aop_filter_by_in_param(pc, 1, aop_t_all_fp());
   aop_join_on(pc, plugin_join_on_call, "_advice_foo");
 
   return 0;