From f6cd949472bfa7adcfb7f9910760f5f8e6da6db5 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 26 Apr 2023 12:12:55 +1000 Subject: [PATCH] test: cast the varargs to the right data size Fixes the test suite issues on 32 bit. Only needed for the 64 bit arguments, but let's do the 32 bit as well for solidarity and readability. Fixes #30 --- src/brei-shared.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/brei-shared.c b/src/brei-shared.c index b0a7d75..1db1f7a 100644 --- a/src/brei-shared.c +++ b/src/brei-shared.c @@ -482,7 +482,10 @@ MUNIT_TEST(test_brei_marshal) const char *str = "eierspeise"; { - _unref_(brei_result) *result = brei_marshal_va(brei, buf, "noiusf", 5, 0xab, 0xcd, -13, 0xfffd, str, 1.45); + _unref_(brei_result) *result = brei_marshal_va(brei, buf, "noiusf", 5, + (object_id_t)0xab, (object_id_t)0xcd, + (int32_t)-13, (uint32_t)0xfffd, + str, 1.45); munit_assert_ptr_null(result); } @@ -509,7 +512,10 @@ MUNIT_TEST(test_brei_marshal_bad_sig) const char *str = "eierspeise"; { - _unref_(brei_result) *result = brei_marshal_va(brei, buf, "noiusf", 5, 0xab, 0xcd, -13, 0xfffd, str, 1.45); + _unref_(brei_result) *result = brei_marshal_va(brei, buf, "noiusf", 5, + (object_id_t)0xab, (object_id_t)0xcd, + (int32_t)-13, (uint32_t)0xfffd, + str, 1.45); munit_assert_ptr_null(result); } @@ -630,7 +636,8 @@ MUNIT_TEST(test_brei_send_message) uint32_t opcode = 3; const char *signature = "ison"; int rc = brei_send_message_va(sock_write, id, opcode, signature, 4, - -42, string, 0xab, 0xcdef); + (int32_t)-42, string, + (object_id_t)0xab, (object_id_t)0xcdef); munit_assert_int(rc, ==, msglen); uint32_t buf[64];