Mercurial > louis > mq > lightsd
changeset 458:89ae4a498401
Add a bit more content to that effect test
author | Louis Opter <kalessin@kalessin.fr> |
---|---|
date | Mon, 23 May 2016 01:39:18 -0400 |
parents | 5868dc7734b0 |
children | c6515904f07f |
files | add_power_transition.patch |
diffstat | 1 files changed, 24 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/add_power_transition.patch Mon May 23 00:27:11 2016 -0400 +++ b/add_power_transition.patch Mon May 23 01:39:18 2016 -0400 @@ -1381,22 +1381,43 @@ new file mode 100644 --- /dev/null +++ b/tests/core/effect/test_effect_start.c -@@ -0,0 +1,17 @@ +@@ -0,0 +1,38 @@ +#include "core/effect.c" + +#include "mock_log.h" +#include "mock_timer.h" + ++union lgtd_effect_ctx TEST_EFFECT_CTX = { .as_uint = 0 }; ++ +enum { -+ FINITE, // duration != 0 ++ FINITE_WITHOUT_CALLBACK, // duration != 0 ++ FINITE_WITH_CALLBACK, + INSTANT, // duration == 0 + PERIODIC, // timer_ms != 0 + ONE_SHOT, // timer_ms == 0 -+} TEST_CASES; ++} test_case = 0;; ++ ++static int test_apply_callback_call_count = 0; ++ ++static void ++test_apply_callback(const struct lgtd_effect *effect) ++{ ++ test_apply_callback_call_count++; ++} ++ + +int +main(void) +{ ++ switch (test_case++) { ++ case FINITE_WITH_CALLBACK: ++ lgtd_effect_start( ++ "test", 420, NULL, 0, 0, test_apply_callback, TEST_EFFECT_CTX ++ ); ++ default: ++ break; ++ } ++ + return 0; +} diff --git a/tests/core/jsonrpc/test_jsonrpc_batch.c b/tests/core/jsonrpc/test_jsonrpc_batch.c