summaryrefslogtreecommitdiff
path: root/include
AgeCommit message (Collapse)AuthorFilesLines
2022-12-27Imported Upstream version 1.1.5upstream/1.1.5cmocka-1.1.5upstreamTizenOpenSource1-7/+93
2022-12-27Imported Upstream version 1.1.3cmocka-1.1.3JinWang An1-23/+15
2022-12-27Imported Upstream version 1.1.2cmocka-1.1.2JinWang An1-6/+20
2016-10-03This patch allows cmocka to be run under windows 64-bitNikos Mavrogiannopoulos1-1/+1
In that system while the maximum word size is 64-bits, the 'unsigned long int' type is only 32-bits. Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2016-09-21Fixed format specifier width mismatchJoseph Ates1-1/+14
On some platforms PRIu64 is not necessarily the width of the LargestIntegralType. A new decimal format specifier for LargestIntegralType was added and replaces the invocations of PRIu64.
2016-09-21cmocka: Use defines for WILL_RETURN valuesAndreas Schneider1-2/+5
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2016-02-10cmocka: Add will_return_maybe() for ignoring mock returnsJoseph Ates1-3/+32
As both parameter and function call order checking allow for ignoring cases where they are never invoked, the mock return values are at somewhat of a mismatch in that they must always be returned at least once (even in the case of will_return_always()). Therefore, the ability to set the count to -2 on will_return_count was added with a new macro (will_return_maybe) that indicates that that the value field may never be returned and still allow a successful test. Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2015-12-18cmocka: Add support to verify call orderingJoseph Ates1-0/+141
2015-09-30include: Improve documentation for prestate macrosAndreas Schneider1-8/+10
2015-09-23cmocka: Allow to pass initial data to test casesPawel Szewczyk1-4/+21
Sometimes multiple test cases share the same test function, running it on different data. To pass this data to test functions we must define setup function for each data set. It's not very convienient when there are many states to test. This commit introduce more elegant way to pass data to tests. The initial_state field of CMUnitTest structure can be defined by user. It will be either passed to setup function, which makes any preparation needed, or it will be passed directly to test function when setup func is NULL. Signed-off-by: Pawel Szewczyk <p.szewczyk@samsung.com>
2015-08-04include: Protect config.h inclusionAndreas Schneider1-0/+2
Thanks to Gregory Pakosz. Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-08-01include: Add va_copy macro if MSVC doesn't provide itAndreas Schneider1-0/+4
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-02-25Fix function types in doxygen docsJakub Hrozek1-2/+2
Signed-off-by: Jakub Hrozek <jakub.hrozek@posteo.se> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2015-02-20include: Add macro for assert_ptr_equal().Andreas Schneider1-0/+38
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-02-20include: Fix building with newer gcc versions.Andreas Schneider1-5/+2
__func__ is not a macro. We just need to define it on Windows for now. Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-02-13include: Use LargestIntegralType instead of uintmax_tAndreas Schneider1-26/+29
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-02-13include: Fix documentation for mock functionsAndreas Schneider1-7/+7
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-02-12cmocka: Surround include info with code endcodeKrzysztof Opasiak1-1/+2
Doxygen makes list of includes hard to read when it is not explicitly marked as code. Surround it with code marks to improve readability. Signed-off-by: Krzysztof Opasiak <k.opasiak@samsung.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2015-02-12include: Correctly include signal.hAndreas Schneider1-1/+0
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-02-12include: Fix warning for missing __WORDSIZEAndreas Schneider1-0/+2
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-02-11tests: Fix building the tests with Visual Studio.Andreas Schneider1-0/+1
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-02-11config: Add missing define for (v)snprintf functions.Andreas Schneider1-0/+2
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-02-11include: Add missing functions for Visual Studio.Andreas Schneider1-1/+98
Move the ugly stuff to cmocka_private.h. Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-02-11include: Define __WORDSIZE if needed.Andreas Schneider1-0/+10
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-02-11include: Fix pointer casting and add check_expected_ptr()Andreas Schneider1-1/+19
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-02-10include: Define fix defintion of LargestIntegralTypeAndreas Schneider1-32/+36
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-02-10docs: Mark the old test runner functions as deprecatedJakub Hrozek1-10/+30
Marks the old test runner functions as @deprecated in the doxygen config Signed-off-by: Jakub Hrozek <jakub.hrozek@posteo.se>
2015-02-09Add cmockery legacy header.Andreas Schneider3-0/+14
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-02-09include: Add Programming by Contract header.Luis Pabón2-0/+63
Signed-off-by: Luis Pabón <lpabon@redhat.com>
2015-02-09cmocka: Add support for skipping a testJakub Hrozek1-0/+11
Signed-off-by: Jakub Hrozek <jakub.hrozek@posteo.se>
2015-02-09cmocka: Add Test Anything Protocol message outputAndreas Schneider1-1/+2
This adds support to print test reporting in the Test Anything Protocol. See http://testanything.org/tap-specification.html Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-02-09cmocka: Add support for xunit reportsJakub Hrozek1-0/+1
Pair-Programmed-With: Andreas Schneider <asn@cryptomilk.org> Signed-off-by: Jakub Hrozek <jakub.hrozek@posteo.se> Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-02-08cmocka: Add subunit message output typeJakub Hrozek1-0/+1
Signed-off-by: Jakub Hrozek <jakub.hrozek@posteo.se>
2015-02-08cmocka: Add a function to select the message output typeJakub Hrozek1-0/+17
Signed-off-by: Jakub Hrozek <jakub.hrozek@posteo.se>
2015-02-08cmocka: Mark run_tests as deprecated.Andreas Schneider1-53/+13
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2015-02-08cmocka: Implement a new test runner.Andreas Schneider1-0/+170
Pair-Programmed-With: Jakub Hrozek <jakub.hrozek@posteo.se> Signed-off-by: Andreas Schneider <asn@cryptomilk.org> Signed-off-by: Jakub Hrozek <jakub.hrozek@posteo.se>
2015-02-08cmocka: Add a test_realloc() function.Andreas Schneider1-0/+18
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2014-07-28cmocka: use ISO C99 PRIu64 over LargestIntegralTypePrintfUnsignedFormatEmil Velikov1-9/+0
With commit commit 8642ef21b07(cmocka: introduce LargestIntegralTypePrintfUnsignedFormat modifier) we introduces this superfluous macro in order to work around the differences when printing 64bit unsigned integer values. Rather than reinventing the wheel use the C99's PRIu64 and fall back locally to their platform/compiler specific counterparts if the inttypes.h header does not exist. Thanks to scythe from the #cmocka channel for pointing out. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2014-07-23cmocka: introduce LargestIntegralTypePrintfUnsignedFormat modifierEmil Velikov1-0/+9
The modifier is almost identical to LargestIntegralTypePrintfFormat in terms that it handles 64bit integer values, but unlike the latter it prints them as unsigned value. Behind the scenes it uses %I64u for windows, and %llu otherwise. Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2014-05-29cmocka: fix doxygen comment for assert_not_in_range()Michael Adam1-2/+2
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2014-05-29cmocka: fix doxygen comment for assert_in_range()Michael Adam1-2/+2
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2014-05-29cmocka: fix doxygen comment for assert_return_code()Michael Adam1-1/+1
Signed-off-by: Michael Adam <obnox@samba.org> Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2014-05-20doc: Improve documentation for fail_msg().Andreas Schneider1-0/+11
BUG: https://open.cryptomilk.org/issues/29 Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2014-04-11doc: Document the group functions.Andreas Schneider1-0/+2
2014-04-11include: Fix count parameter of expect_check() macroSebastian Dröge1-1/+1
It was always using 0, which meant that the values were never ever used. This commit changes it to 1, which is consistent with the other macros. Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2014-04-11cmocka: Define inline if not defined with MSVC.Andreas Schneider1-6/+13
2014-04-11cmocka: Add support for test groups.Andreas Schneider1-0/+18
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
2014-04-10cmocka: Add a dummy function for setup and teardown.Andreas Schneider1-1/+7
We need a matching number for setup and teardown functions else we can run in an assert. So this adds a dummy which doesn't do anything.
2014-04-09doc: Fix some typos.Andreas Schneider1-3/+3
2014-02-21Use prefix for commonly used macro PRINTF_ATTRIBUTELukas Slebodnik1-6/+7
It may cause warning: /usr/include/cmocka.h:50:0: warning: "PRINTF_ATTRIBUTE" redefined [enabled by default] Reviewed-by: Andreas Schneider <asn@cryptomilk.org>