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
This commit is contained in:
Peter Hutterer 2023-04-26 12:12:55 +10:00
parent 9c5c3c890f
commit f6cd949472

View file

@ -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];