1
0
mirror of https://github.com/meekrosoft/fff synced 2026-01-23 00:15:59 +01:00
Commit Graph

159 Commits

Author SHA1 Message Date
Mike Long
ffde0537d8 Merge pull request #20 from usr42/master
Fix for issue 13: Add function prototype to DECLARE_* macro
2018-01-28 17:35:58 +00:00
Mike Long
b359c2391b Merge pull request #30 from rubiot/vararg_readme
Adding a section explaining how to fake variadic functions
2018-01-28 17:21:05 +00:00
Mike Long
82eab51659 Update to readme to correct misinformation on C standard
It turns out that nested functions are a gcc thing - not standard C.

Closes #34
2017-12-18 19:57:20 +01:00
Mike Long
b9a336b2d7 Merge pull request #39 from VincentDary/msvc-macro-fix
Msvc macro fix
2017-12-18 14:58:27 +01:00
snak3xe
e61b221827 Fix fff.h for MSVC macro compatibility. 2017-12-14 23:01:41 +01:00
snak3xe
eca3ccbe6c Fix fakegen.rb C header generator for M macro compatibility. 2017-12-14 22:52:27 +01:00
Mike Long
719dd8b6a3 Merge pull request #38 from nabijaczleweli/master
Add syntax highlighting and remove inline HTML from README
2017-10-09 09:20:05 +02:00
nabijaczleweli
fcc7f1c46f Use markdown instead of inline HTML in README 2017-10-08 01:44:10 +02:00
nabijaczleweli
a795833cba Add syntax highlighting to README 2017-10-08 01:39:36 +02:00
Rúbio
64ec1fc415 Merge pull request #1 from usr42/vararg_tests
Improve vararg tests
2017-02-06 19:15:21 -02:00
usr42
68692c712c Improve vararg tests 2017-02-06 21:36:34 +01:00
Rubio R. C. Terra
7cb667102d Adding a section explaining how to fake variadic functions 2017-02-06 18:14:02 -02:00
usr42
248c7906b4 Merge remote-tracking branch 'upstream/master' 2017-02-04 12:34:55 +01:00
Mike Long
74c07a8f66 Merge pull request #27 from usr42/issue26
Fix issue 26: Use void as parameter when no parameter exists
2017-02-03 21:02:49 +01:00
Mike Long
963ec65611 Merge pull request #25 from stephan-cr/fix-typos-in-readme
Fix typos in README
2017-02-03 21:00:14 +01:00
Mike Long
afe4189a05 Merge pull request #24 from stephan-cr/fix-multistatement-macro
Wrap statements in multistatement macro with do {} while (0)
2017-02-03 20:59:37 +01:00
Mike Long
00496626b4 Merge pull request #23 from usr42/issue21_without_issue13
Fix issue 21: Use function pointer for call_history
2017-02-03 20:54:53 +01:00
usr42
88e6ac34d1 Use void as parameter for FUNCNAME##_reset
FUNCNAME##_reset(void) instead of FUNCNAME##_reset()
2017-01-30 15:03:39 +01:00
usr42
7888b6e9c8 Use void as parameter when no parameter exists 2017-01-26 17:35:11 +01:00
Stephan Creutz
dc50381b24 Fix typos in README 2017-01-24 21:31:37 +01:00
Stephan Creutz
f77932ce1c Wrap statements in multistatement macro with do {} while (0) 2017-01-24 21:09:18 +01:00
usr42
03f61f8e9f Use function pointer for call_history 2017-01-24 21:03:09 +01:00
usr42
d2992fef8f Fix issue13: Add function prototype to DECLARE_* 2017-01-21 20:06:27 +01:00
Mike Long
4e7451acd1 Merge pull request #19 from usr42/master
Refactoring and bugfix
2017-01-20 10:22:32 +01:00
usr42
190fa67039 Fix FAKE_VALUE_FUNC with 20 parameters 2017-01-16 12:00:24 +01:00
usr42
0ec5f99ef8 Refactor output_macro_counting_shortcuts 2017-01-14 23:23:07 +01:00
usr42
bf2275a475 Fix gcc/g++ usage in Makefile 2017-01-14 10:04:45 +01:00
Mike Long
9c89d72548 Merge pull request #18 from aunsbjerg/master
Auto-counting macros for declaration and definition of fake
2016-12-22 09:49:36 +01:00
mj
2c47f8aa49 Added simple explanation and example to readme file 2016-12-18 15:19:08 +01:00
mj
f4b03caa88 Removed file I accidentally added 2016-12-18 15:06:48 +01:00
mj
0cf75a229e Added auto counting of parameters for declaration and definition of fake functions for global use. Adjusted unit tests of global functions 2016-12-18 15:03:15 +01:00
mj
daff1fb430 added helper for generating argument sequences 2016-12-18 11:25:11 +01:00
Mike Long
765109f9a2 Merge pull request #17 from alvarez86/update_custom_fake_seq_readme
README: Update README.md to give example of SET_CUSTOM_FAKE_SEQ macro
2016-09-28 07:56:44 +02:00
Paulo Antonio Alvarez
0daa84efe6 README: Update README.md to give example of SET_CUSTOM_FAKE_SEQ macro
The readme now contains an example taken from the test suite of how to
use the SET_CUSTOM_FAKE_SEQ macro.
2016-09-26 22:58:32 -03:00
Mike Long
ff40273dba Merge pull request #16 from CiderMan/master
Fix for issue 8
2016-09-25 19:32:47 +01:00
Mike Long
f88a17c2f3 Merge pull request #15 from alvarez86/custom_fake_seq
Support for custom fake sequences on non-variadic functions
2016-09-25 10:33:51 +02:00
Steve Hill
df0dc5deea Added missing #include, built and tested 2016-09-23 19:25:30 +01:00
Steve Hill
54cb4ff06e Add vim backup files to .gitignore 2016-09-23 19:19:03 +01:00
Paulo Antonio Alvarez
218cdf7067 fff.h with support to custom fake sequences (non-variadic functions)
The fff.h file now supports setting a sequence of custom fakes for
non-variadic functions using the SET_CUSTOM_FAKE_SEQ macro, with
works much like the SET_RETURN_SEQ macro.
2016-09-14 01:41:27 -03:00
Paulo Antonio Alvarez
961289f578 Added two test cases for SET_CUSTOM_FAKE_SEQ
Using a function that sets a value on a variable via a char pointer, we
test the following:
1 - Does the custom fakes are called in the expected order?
2 - When the sequence length is exhausted, do we only call the last
    custom fake in the sequence from then on?
2016-09-14 01:33:20 -03:00
Paulo Antonio Alvarez
845a8e2549 Support for custom fake function sequences (non-variadic functions)
This makes it possible to set a sequence of custom fakes for a function
using the macro SET_CUSTOM_FAKE_SEQ. Very useful for functions with out
parameters. Now we don't have to count the number of calls to implement
different behaviours on custom fakes.
2016-09-14 01:33:16 -03:00
Mike Long
3cd33eda54 Add travis build status to readme 2016-07-06 10:41:08 +02:00
Mike Long
ab1c68642b Initial try at a travis yaml 2016-07-06 10:36:12 +02:00
Mike Long
984059e60d Add git ignore to ignore build directory 2016-07-06 10:35:49 +02:00
Mike Long
8de85a4a68 Merge pull request #11 from rubiot/variadic_custom_fakes
Support for variadic custom fakes
2016-07-06 10:26:51 +02:00
Rubio R. C. Terra
6392c5fa1f Build and test with support for variadic custom fakes 2016-06-07 10:01:40 -03:00
Rubio R. C. Terra
88864216d3 Added test case for FAKE_VALUE_FUNC_VARARG. 2016-06-07 10:01:36 -03:00
Rubio R. C. Terra
8c7bd6912f Added macro counting shortcuts for variadic fakes 2016-06-07 10:01:31 -03:00
Rubio R. C. Terra
fa15147055 Added custom fake support for variadic functions
Custom fake support for variadic functions was limited. The variable
parameters were not passed to the custom fake.

Now a va_list is passed to the custom fake, so it is possible to access
all the arguments. For instance, a custom fake for fprintf() could call
the real fprintf() like this:

int fprintf_custom(FILE *stream, const char *format, va_list ap) {
  if (fprintf0_fake.return_val < 0) // should we fail?
    return fprintf0_fake.return_val;
  return vfprintf(stream, format, ap);
}
2016-06-07 10:01:26 -03:00
Rubio R. C. Terra
a34e5a5a20 Adding a line break after license 2016-06-07 10:01:09 -03:00