mirror of
https://github.com/ThrowTheSwitch/CMock.git
synced 2026-06-05 21:15:20 +00:00
Update description of 'create_error_stubs'
Change-Id: Ica84be72a229a4fd90e3d5ce0b3449722699f637
This commit is contained in:
+4
-4
@@ -1,8 +1,8 @@
|
||||
[submodule "vendor/unity"]
|
||||
path = vendor/unity
|
||||
url = https://github.com/throwtheswitch/unity.git
|
||||
branch = master
|
||||
[submodule "vendor/c_exception"]
|
||||
path = vendor/c_exception
|
||||
url = https://github.com/throwtheswitch/cexception.git
|
||||
branch = master
|
||||
[submodule "vendor/unity"]
|
||||
path = vendor/unity
|
||||
url = https://github.com/throwtheswitch/unity.git
|
||||
branch = master
|
||||
|
||||
+13
-13
@@ -1,7 +1,7 @@
|
||||
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*
|
||||
|
||||
@@ -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
|
||||
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.
|
||||
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
|
||||
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*
|
||||
|
||||
* `:create_error_stubs`:
|
||||
New users of CMock sometimes struggle with the concept that CMock is
|
||||
generating differently named interface functions for a mock depending
|
||||
New users of CMock sometimes struggle with the concept that CMock is
|
||||
generating differently named interface functions for a mock depending
|
||||
on whether a function to be mocked has a return value or not (see
|
||||
description of the plugins *Expect*, *ExpectAnyArgs*, *Array*, *Ignore*,
|
||||
*IgnoreStateless* above). They are looking e.g. for a function `func_Expect()`
|
||||
description of the plugins `:Expect`, `:ExpectAnyArgs`, `:Array`, `:Ignore`,
|
||||
`:IgnoreStateless` above). They are looking e.g. for a function `func_Expect()`
|
||||
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.
|
||||
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:
|
||||
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.
|
||||
|
||||
|
||||
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.
|
||||
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
|
||||
|
||||
@@ -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
|
||||
the old header with inline functions, the build system has to add
|
||||
the mock folder to the include paths.
|
||||
|
||||
|
||||
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
|
||||
test code including the original header instead of the newly
|
||||
|
||||
Reference in New Issue
Block a user