Update description of 'create_error_stubs'

Change-Id: Ica84be72a229a4fd90e3d5ce0b3449722699f637
This commit is contained in:
Roland Stahn
2025-06-11 12:55:28 +02:00
parent c9154a19dd
commit 0cefcf05f9
2 changed files with 17 additions and 17 deletions
+4 -4
View File
@@ -1,8 +1,8 @@
[submodule "vendor/unity"]
path = vendor/unity
url = https://github.com/throwtheswitch/unity.git
branch = master
[submodule "vendor/c_exception"] [submodule "vendor/c_exception"]
path = vendor/c_exception path = vendor/c_exception
url = https://github.com/throwtheswitch/cexception.git url = https://github.com/throwtheswitch/cexception.git
branch = master branch = master
[submodule "vendor/unity"]
path = vendor/unity
url = https://github.com/throwtheswitch/unity.git
branch = master
+13 -13
View File
@@ -1,7 +1,7 @@
CMock: A Summary CMock: A Summary
================ ================
*[ThrowTheSwitch.org](http://throwtheswitch.org)* *[ThrowTheSwitch.org](http://throwtheswitch.org)*
*This documentation is released under a Creative Commons 3.0 Attribution Share-Alike License* *This documentation is released under a Creative Commons 3.0 Attribution Share-Alike License*
@@ -138,7 +138,7 @@ that resembles a pointer or array, it breaks the argument into TWO arguments.
The first is the original pointer. The second specify the number of elements The first is the original pointer. The second specify the number of elements
it is to verify of that array. If you specify 1, it'll check one object. If 2, it is to verify of that array. If you specify 1, it'll check one object. If 2,
it'll assume your pointer is pointing at the first of two elements in an array. it'll assume your pointer is pointing at the first of two elements in an array.
If you specify zero elements and `UNITY_COMPARE_PTRS_ON_ZERO_ARRAY` is defined, If you specify zero elements and `UNITY_COMPARE_PTRS_ON_ZERO_ARRAY` is defined,
then this assertion can also be used to directly compare the pointers to verify then this assertion can also be used to directly compare the pointers to verify
that they are pointing to the same memory address. that they are pointing to the same memory address.
@@ -421,23 +421,23 @@ from the defaults. We've tried to specify what the defaults are below.
* default: *nil* * default: *nil*
* `:create_error_stubs`: * `:create_error_stubs`:
New users of CMock sometimes struggle with the concept that CMock is New users of CMock sometimes struggle with the concept that CMock is
generating differently named interface functions for a mock depending generating differently named interface functions for a mock depending
on whether a function to be mocked has a return value or not (see on whether a function to be mocked has a return value or not (see
description of the plugins *Expect*, *ExpectAnyArgs*, *Array*, *Ignore*, description of the plugins `:Expect`, `:ExpectAnyArgs`, `:Array`, `:Ignore`,
*IgnoreStateless* above). They are looking e.g. for a function `func_Expect()` `:IgnoreStateless` above). They are looking e.g. for a function `func_Expect()`
while CMock generated the function `func_ExpectAndReturn()` instead. while CMock generated the function `func_ExpectAndReturn()` instead.
This has proven to be a significant hurdle, because it is not easy to This has proven to be a significant hurdle, because it is not easy to
spot the slightly different named function within the generated mock. spot the slightly different named function within the generated mock.
Therefore since release v2.6.0 CMock is generating *both* functions Therefore CMock (v2.6.0 and newer) is generating *both* functions
per default, although one of them has only a "stub" functionality: per default, although one of them has only a "stub" functionality:
it is aborting the testcase when called with a helpful error message on call it will always fail the test emitting a helpful error message
pointing towards the correct function. pointing towards the correct function.
Experienced CMock users on the other hand might prefer the original Experienced CMock users on the other hand might prefer the original
behavior, where no additional error stubs are generated - e.g. to behavior, where no additional error stubs are generated - e.g. to
ensure code completion offers only "real" functionality of the mock. ensure code completion offers only "real" functionality of the mock.
In this case the option `:create_error_stubs` should be set to false. In this case, the option `:create_error_stubs` can be set to false.
* default: true * default: true
@@ -658,7 +658,7 @@ from the defaults. We've tried to specify what the defaults are below.
for the test code to also see the newly generated header ,and not for the test code to also see the newly generated header ,and not
the old header with inline functions, the build system has to add the old header with inline functions, the build system has to add
the mock folder to the include paths. the mock folder to the include paths.
Furthermore, we need to keep the order of include paths in mind. We Furthermore, we need to keep the order of include paths in mind. We
have to set the mock folder before the other includes to avoid the have to set the mock folder before the other includes to avoid the
test code including the original header instead of the newly test code including the original header instead of the newly