aboutgitcodelistschat:MatrixIRC
path: root/tests/unit/test_actions.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/unit/test_actions.c')
-rw-r--r--tests/unit/test_actions.c22
1 files changed, 5 insertions, 17 deletions
diff --git a/tests/unit/test_actions.c b/tests/unit/test_actions.c
index 2bf92d4..e648063 100644
--- a/tests/unit/test_actions.c
+++ b/tests/unit/test_actions.c
@@ -253,33 +253,22 @@ END_TEST
START_TEST(test_act_return_ref)
{
int64_t v = 2;
+ uint16_t offset = 4;
struct action actions[] = {
{
.type = A_RETURN,
- .ret = { .type = REFERENCE, .value_p = &v },
+ .ret = { .type = REFERENCE, .value_off = offset },
},
};
- int ret = do_actions(NULL, actions, sizeof(actions) / sizeof(actions[0]), -1,
+ memcpy((uint16_t *)&tmp_data + offset, &v, sizeof(v));
+
+ int ret = do_actions(&tmp_data, actions, sizeof(actions) / sizeof(actions[0]), -1,
notifyfd, req.id);
ck_assert_msg(ret == 0, strerror(errno));
check_target_result(v, 0, false);
}
END_TEST
-START_TEST(test_act_return_empty_ref)
-{
- struct action actions[] = {
- {
- .type = A_RETURN,
- .ret = { .type = REFERENCE, .value_p = NULL },
- },
- };
- int ret = do_actions(NULL, actions, sizeof(actions) / sizeof(actions[0]), -1,
- notifyfd, req.id);
- ck_assert_int_eq(ret, -1);
-}
-END_TEST
-
START_TEST(test_act_call)
{
struct action actions[] = {
@@ -365,7 +354,6 @@ Suite *action_call_suite(void)
tcase_set_timeout(ret, timeout);
tcase_add_test(ret, test_act_return);
tcase_add_test(ret, test_act_return_ref);
- tcase_add_test(ret, test_act_return_empty_ref);
suite_add_tcase(s, ret);
block = tcase_create("a_block");