No Unit Test EXPECT_CALL assertion

Hello, I am pretty new with PlatformIO and not so seasoned with Unit Test so maybe this is a silly question.
I am developing a C++ embedded software project that connect several software components (SWC) through a run time environment (RTE) by reading and writing global variables, the SWCs read their inputs and write their outputs from the RTE by calling specific functions instead of directly accessing to the global variables.
I am trying to design unit test for every single SWC by mocking the RTE read functions for the inputs and my idea is to check that the SWC call the correct RTE write functions with the correct value to be written, but there is nothing like EXPECT_CALL assertion to validate that a function is called.
How can I proceed in this case? Note that none of the SWC or the RTE functions have a return value.

The unit test framework integrated with PlatformIO is Unity. I don’t see a “expect / verify method invocation” feature in that framework’s documentation (by glancing over it). So, a different unit test framework might be more suitable for you.

The EXPECT_CALL macro you’re referring to seems to come from Google’s Mock library. That library actually has a platformio.ini with a reference project, in which that macro should be available. So you can try that.

Other libraries like FakeIt also support a “verify method invocation” check. A thread about using it in PlatformIO with a refernce project can be foudn in the thread Integrate Cmock with Unity unit testing framework.

Thanks for your help, with GoogleTest/GoogleMock frameworks now I am able to design and run unit test in the native platform and mock other modules and hardware dependent functions. So most of my code is already tested before I start validating it on the target. The setup is a bit tricky so I want to share the platformio.ini file that works in my project.

[env:native]
platform = native
lib_compat_mode = off
lib_deps = google/googletest @ ^1.10.0
build_flags = -pthread ;Required in Visual Studio Code in Ubuntu
              -std=c++11
              -D TESTING ;Build flag for testing
test_build_project_src = true ;Build from the sourde code folder

Also I found a very useful post about how to mock functions for embedded C project with GoogleMock without significantly changing the source code, here is the link: Using GoogleTest and GoogleMock frameworks for embedded C - CodeProject