[PATCH v2] tests/validation: Fix 64bit test failure

Kinsey Moore kinsey.moore at oarcorp.com
Mon Feb 15 20:44:01 UTC 2021


The email address got fixed here in v2. We were just responding on the original one.

Kinsey

-----Original Message-----
From: devel <devel-bounces at rtems.org> On Behalf Of Kinsey Moore
Sent: Monday, February 15, 2021 09:20
To: devel at rtems.org
Subject: [PATCH v2] tests/validation: Fix 64bit test failure

From: Ryan Long <ryan.long at oarcorp.com>

The ts-validation-0 test currently fails on 64bit BSPs due to a
limitation of the message structure. Changing the max message size to a
size_t type and adjusting the expected value in the test resolves this.

Closes #4179.
---
 cpukit/include/rtems/rtems/message.h                | 2 +-
 cpukit/include/rtems/score/coremsgimpl.h            | 2 +-
 cpukit/score/src/coremsg.c                          | 2 +-
 spec/build/bsps/aarch64/a53/tsta53.yml              | 3 ---
 spec/build/bsps/aarch64/xilinx-zynqmp/tstqemu.yml   | 3 ---
 testsuites/validation/tc-message-construct-errors.c | 2 +-
 6 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/cpukit/include/rtems/rtems/message.h b/cpukit/include/rtems/rtems/message.h
index 14083b8cd0..7bb48ba35a 100644
--- a/cpukit/include/rtems/rtems/message.h
+++ b/cpukit/include/rtems/rtems/message.h
@@ -51,7 +51,7 @@ typedef struct {
    * @brief This member defines the maximum number of pending messages supported
    *   by the message queue.
    */
-  uint32_t maximum_pending_messages;
+  size_t maximum_pending_messages;
 
   /**
    * @brief This member defines the maximum message size supported by the message
diff --git a/cpukit/include/rtems/score/coremsgimpl.h b/cpukit/include/rtems/score/coremsgimpl.h
index 6f6a01bea6..c7a424c08c 100644
--- a/cpukit/include/rtems/score/coremsgimpl.h
+++ b/cpukit/include/rtems/score/coremsgimpl.h
@@ -144,7 +144,7 @@ void *_CORE_message_queue_Workspace_allocate(
 Status_Control _CORE_message_queue_Initialize(
   CORE_message_queue_Control          *the_message_queue,
   CORE_message_queue_Disciplines       discipline,
-  uint32_t                             maximum_pending_messages,
+  size_t                               maximum_pending_messages,
   size_t                               maximum_message_size,
   CORE_message_queue_Allocate_buffers  allocate_buffers,
   const void                          *arg
diff --git a/cpukit/score/src/coremsg.c b/cpukit/score/src/coremsg.c
index cf7f44ed17..530f05719a 100644
--- a/cpukit/score/src/coremsg.c
+++ b/cpukit/score/src/coremsg.c
@@ -35,7 +35,7 @@ RTEMS_STATIC_ASSERT(
 Status_Control _CORE_message_queue_Initialize(
   CORE_message_queue_Control          *the_message_queue,
   CORE_message_queue_Disciplines       discipline,
-  uint32_t                             maximum_pending_messages,
+  size_t                               maximum_pending_messages,
   size_t                               maximum_message_size,
   CORE_message_queue_Allocate_buffers  allocate_buffers,
   const void                          *arg
diff --git a/spec/build/bsps/aarch64/a53/tsta53.yml b/spec/build/bsps/aarch64/a53/tsta53.yml
index 9135fac7f4..4ecef03641 100644
--- a/spec/build/bsps/aarch64/a53/tsta53.yml
+++ b/spec/build/bsps/aarch64/a53/tsta53.yml
@@ -4,9 +4,6 @@ actions:
     # expected to fail, don't compile these
     minimum: exclude
 
-    # test broken under 64bit due to SIZE_MAX differences
-    validation-0: exclude
-
     # don't compile due to toolchain issues
     spconfig01: exclude
     spmisc01: exclude
diff --git a/spec/build/bsps/aarch64/xilinx-zynqmp/tstqemu.yml b/spec/build/bsps/aarch64/xilinx-zynqmp/tstqemu.yml
index d0efba65cd..45fdc503aa 100644
--- a/spec/build/bsps/aarch64/xilinx-zynqmp/tstqemu.yml
+++ b/spec/build/bsps/aarch64/xilinx-zynqmp/tstqemu.yml
@@ -4,9 +4,6 @@ actions:
     # expected to fail
     minimum: exclude
 
-    # test broken under 64bit due to SIZE_MAX differences
-    validation-0: expected-fail
-
     # don't compile due to toolchain issues
     spconfig01: exclude
     spmisc01: exclude
diff --git a/testsuites/validation/tc-message-construct-errors.c b/testsuites/validation/tc-message-construct-errors.c
index 5820855ac4..903ff534fa 100644
--- a/testsuites/validation/tc-message-construct-errors.c
+++ b/testsuites/validation/tc-message-construct-errors.c
@@ -278,7 +278,7 @@ static void RtemsMessageReqConstructErrors_Pre_MaxPending_Prepare(
     }
 
     case RtemsMessageReqConstructErrors_Pre_MaxPending_Big: {
-      ctx->config.maximum_pending_messages = UINT32_MAX;
+      ctx->config.maximum_pending_messages = SIZE_MAX;
       break;
     }
 
-- 
2.20.1

_______________________________________________
devel mailing list
devel at rtems.org
http://lists.rtems.org/mailman/listinfo/devel


More information about the devel mailing list