Age | Commit message (Collapse) | Author | Files | Lines |
|
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>
|
|
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.
|
|
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
|
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>
|
|
|
|
|
|
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>
|
|
Signed-off-by: Jakub Hrozek <jakub.hrozek@posteo.se>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
|
|
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
|
__func__ is not a macro. We just need to define it on Windows for now.
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
|
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
|
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
|
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>
|
|
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
|
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
|
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
|
Marks the old test runner functions as @deprecated in the doxygen config
Signed-off-by: Jakub Hrozek <jakub.hrozek@posteo.se>
|
|
Signed-off-by: Jakub Hrozek <jakub.hrozek@posteo.se>
|
|
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>
|
|
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>
|
|
Signed-off-by: Jakub Hrozek <jakub.hrozek@posteo.se>
|
|
Signed-off-by: Jakub Hrozek <jakub.hrozek@posteo.se>
|
|
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
|
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>
|
|
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
|
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>
|
|
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>
|
|
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
|
|
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
|
|
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
|
|
BUG: https://open.cryptomilk.org/issues/29
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
|
|
|
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>
|
|
|
|
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
|
|
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.
|
|
|
|
It may cause warning:
/usr/include/cmocka.h:50:0: warning: "PRINTF_ATTRIBUTE" redefined
[enabled by default]
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
|
|
It is better to use "#ifdef" for testing macros instead of "#if"
In header file, "#ifdef DOXYGEN" was used 30 times and "#if DOXYGEN"
23 times. This patch makes it consistent and enable warning Wundef to prevent
this kind of issues.
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
|
|
Numbers were printed as hexadecimal.n eror message,
It is good practice to print "0x" before hexadecimal numbers,
because it may be confusing without this.
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
|
|
|
|
|
|
|
|
|
|
Thanks to James Grenning <james@grenning.net>.
|
|
Visual Studio defines _UINTPTR_T_DEFINED if we have uintptr_t.
|
|
Signed-off-by: Pavel Březina <pbrezina@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
|
|
Signed-off-by: Pavel Březina <pbrezina@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
|
|
|
|
|