You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I wonder for example why CMock does not include in the mock_reference.h created from reference.h the macros that are created in reference.h file.
For example if I am testing test.c then I mock reference.h and inside this there is a definition e.g. #def MASK 0x01 and I want to use it in my unit testing file ut_test.c so the definition is not copied into the mocked version mock_reference.h so then I have to add the #def MASK 0x01 to my test file ut_test.c, if I want it to work. But then I have to maintain to macros with the same value.
Here is a code example, sorry if there is not Ok, is just something quick to explain my question.
Are you using ceedling? If so, check if the :use_test_preprocessor: is set to FALSE.
Otherwise cmock will receive a preprocessed header, which has all defines/macros/includes/... removed, and so the generated header will also have this stuff removed.
Hi, I wonder for example why CMock does not include in the mock_reference.h created from reference.h the macros that are created in reference.h file.
For example if I am testing test.c then I mock reference.h and inside this there is a definition e.g. #def MASK 0x01 and I want to use it in my unit testing file ut_test.c so the definition is not copied into the mocked version mock_reference.h so then I have to add the #def MASK 0x01 to my test file ut_test.c, if I want it to work. But then I have to maintain to macros with the same value.
Here is a code example, sorry if there is not Ok, is just something quick to explain my question.
reference.h
test.c
ut_test.c
The text was updated successfully, but these errors were encountered: