Skip to content

Problem with mocked function using 32-bit compiler in Ceedling unit tests #1117

@dampie286

Description

@dampie286

Hello,

I'm working on a project that uses Ceedling for unit testing, and I'm encountering an issue with a mocked function that writes to a pointer variable when compiling with a 32-bit compiler.

Function being mocked:

eResult eCalculate(float32_t fInVal, float32_t * const pOutVal);

Relevant part of project.yml:

:flags:
  :test:
    :compile:
      - -m32
      - -g
      - -O0
    :link:
      - -m32
      - -g

When I use eCalculate_ReturnThruPtr_pOutVal(...), the value of pOutVal is invalid in 2 out of 3 test cases compared to the expected value.
The issue disappears when I remove the -m32 flag.

While debugging the unit tests, I noticed that the CMock instance address differs from the expected address.

Do I need to change or add something in project.yml, or could this be an issue with CMock or Ceedling?

Note: In another project, I use a similar function and have no issues with 32-bit compilation.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions