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

Chris Johns chrisj at rtems.org
Mon Feb 15 20:24:36 UTC 2021


On 16/2/21 2:12 am, Kinsey Moore wrote:
> From: ryan long <rlong at localhost.localdomain>

The email address looks wrong to me.

Chris

> 
> 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;
>      }
>  
> 


More information about the devel mailing list