diff options
author | Jose Bollo <jose.bollo@iot.bzh> | 2019-02-15 13:41:38 +0100 |
---|---|---|
committer | José Bollo <jose.bollo@iot.bzh> | 2019-03-29 14:14:13 +0100 |
commit | a2cf84ecde926adeebf09bc2c284401513d3fab3 (patch) | |
tree | 2aeb893daf240e34ab12a8828f1b3ad9b900422c /src/tests | |
parent | 5011060f04181acbb18babcc2017a2f0b6cfb853 (diff) |
hooks: Allow to remove hooking (and/or trace)
This change allows to downsize the binder by
removing its internal hooking and tracing features.
Change-Id: Ifb080a7426216f6c6b1c8f8e5bf8ddd52df40a3e
Signed-off-by: Jose Bollo <jose.bollo@iot.bzh>
Diffstat (limited to 'src/tests')
-rw-r--r-- | src/tests/apiset/test-apiset.c | 8 | ||||
-rw-r--r-- | src/tests/session/test-session.c | 5 |
2 files changed, 13 insertions, 0 deletions
diff --git a/src/tests/apiset/test-apiset.c b/src/tests/apiset/test-apiset.c index b49ade90..96fbf4b5 100644 --- a/src/tests/apiset/test-apiset.c +++ b/src/tests/apiset/test-apiset.c @@ -58,7 +58,9 @@ const char *extras[] = { struct afb_api_itf api_itf_null = { .call = NULL, .service_start = NULL, +#if WITH_AFB_HOOK .update_hooks = NULL, +#endif .get_logmask = NULL, .set_logmask = NULL, .describe = NULL, @@ -395,7 +397,9 @@ int set_cb_start(void *closure) struct afb_api_itf set_api_itf = { .call = NULL, .service_start = set_cb_start, +#if WITH_AFB_HOOK .update_hooks = set_cb0, +#endif .get_logmask = set_cb_getmask, .set_logmask = set_cb_setmask, .describe = NULL, @@ -426,7 +430,9 @@ START_TEST (check_settings) ck_assert_int_eq(nn, set_count); set_count = 0; +#if WITH_AFB_HOOK afb_apiset_update_hooks(a, NULL); +#endif ck_assert_int_eq(nn, set_count); for (mask = 1 ; !(mask >> 10) ; mask <<= 1) { @@ -505,7 +511,9 @@ int clacb_start(void *closure) struct afb_api_itf clitf = { .call = NULL, .service_start = clacb_start, +#if WITH_AFB_HOOK .update_hooks = NULL, +#endif .get_logmask = NULL, .set_logmask = NULL, .describe = NULL, diff --git a/src/tests/session/test-session.c b/src/tests/session/test-session.c index 637b0a16..fdbb0435 100644 --- a/src/tests/session/test-session.c +++ b/src/tests/session/test-session.c @@ -187,6 +187,7 @@ END_TEST /*********************************************************************/ /* check hooking */ +#if WITH_AFB_HOOK int hookflag; void on_create(void *closure, const struct afb_hookid *hookid, struct afb_session *session) @@ -299,6 +300,8 @@ START_TEST (check_hooking) } END_TEST +#endif + /*********************************************************************/ @@ -327,6 +330,8 @@ int main(int ac, char **av) addtest(check_creation); addtest(check_capacity); addtest(check_cookies); +#if WITH_AFB_HOOK addtest(check_hooking); +#endif return !!srun(); } |