Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mock static inline functions in a header file #938

Open
MichaelBMiner opened this issue Oct 11, 2024 · 0 comments
Open

Mock static inline functions in a header file #938

MichaelBMiner opened this issue Oct 11, 2024 · 0 comments

Comments

@MichaelBMiner
Copy link

I am writing tests for code written on an MXCA153 NXP dev kit. I am writing tests for my led module and running into the following.

Linking test_led.out...
/bin/ld: build/test/out/c/test_led.o: in function test_led_init': /mnt/YoctoDrive/Documents/michael/hand-held-stop-sign/hand-held-stop-sign/test/test_led.c:37: undefined reference to RESET_ReleasePeripheralReset_Expect'
/bin/ld: /mnt/YoctoDrive/Documents/michael/hand-held-stop-sign/hand-held-stop-sign/test/test_led.c:38: undefined reference to RESET_ReleasePeripheralReset_Expect' /bin/ld: /mnt/YoctoDrive/Documents/michael/hand-held-stop-sign/hand-held-stop-sign/test/test_led.c:40: undefined reference to RESET_ReleasePeripheralReset_Expect'
/bin/ld: /mnt/YoctoDrive/Documents/michael/hand-held-stop-sign/hand-held-stop-sign/test/test_led.c:41: undefined reference to `RESET_ReleasePeripheralReset_Expect'

Now the function RESET_ReleasePeripheralReset is implemented in fsl_reset.h as

static inline void RESET_ReleasePeripheralReset(reset_ip_name_t peripheral)
{
    RESET_SetPeripheralReset(peripheral);
}

This function is never mocked in mock_fsl_reset.c or mock_fsl_reset.h

In the project.yml if I add the setting :treat_inlines: :include I believe my issue would be resolved, but then it gives me a new error which I posted in 933

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant