From 359da1ae76fbce6cf017aa48f690c52cfaa26f14 Mon Sep 17 00:00:00 2001 From: Jesse Rosenstock Date: Wed, 8 Jul 2020 17:11:41 +0200 Subject: [PATCH] Update bit-field tests after #1058 merge --- test/val/bitfield.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/val/bitfield.c b/test/val/bitfield.c index c249b0f59..81d5b2aa1 100644 --- a/test/val/bitfield.c +++ b/test/val/bitfield.c @@ -63,9 +63,9 @@ static struct four_bits_with_int { static void test_four_bits_with_int(void) { - /* We would like this to be 3. https://github.com/cc65/cc65/issues/1054 */ - if (sizeof(struct four_bits_with_int) != 4) { - printf("Got sizeof(struct four_bits_with_int) = %zu, expected 4.\n", + /* The first 4-bit bit-field just takes one byte, so the size is 3. */ + if (sizeof(struct four_bits_with_int) != 3) { + printf("Got sizeof(struct four_bits_with_int) = %zu, expected 3.\n", sizeof(struct four_bits_with_int)); failures++; } @@ -140,9 +140,9 @@ static struct overlap_with_int { static void test_overlap_with_int(void) { - /* We would like this to be 5. */ - if (sizeof(struct overlap_with_int) != 6) { - printf("Got sizeof(struct overlap_with_int) = %zu, expected 6.\n", + /* First two fields in 3 bytes, then another 2 bytes. */ + if (sizeof(struct overlap_with_int) != 5) { + printf("Got sizeof(struct overlap_with_int) = %zu, expected 5.\n", sizeof(struct overlap_with_int)); failures++; }