Age | Commit message (Collapse) | Author | Files | Lines |
|
|
|
|
|
|
|
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
|
|
This is for multiple groups in one test to make sure they do not create
invalid xml.
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>
|
|
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
|
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>
|
|
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
|
|
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
|
|
Currently, realloc(ptr, 0) does not free the pointer as specified by
'man 3 realloc':
The realloc() function changes the size of the memory block pointed
to by ptr to size bytes. [...] if size is equal to zero, and ptr is
not NULL, then the call is equivalent to free(ptr). [...]
This causes a leak of the allocated memory, and tests that use this
particular realloc() pattern fail.
Signed-off-by: Niels de Vos <ndevos@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
Reviewed-by: Jakub Hrozek <jakub.hrozek@posteo.se>
|
|
Signed-off-by: Jakub Hrozek <jakub.hrozek@posteo.se>
|
|
cmocka_private.h uses WORDSIZE:
# if __WORDSIZE == 64
# define __PRI64_PREFIX "l"
But on some platforms, like Solaris, cmocka guesses its own WORDSIZE
value in cmocka.h. Therefore it's important to include cmocka_private.h
after cmocka.h
|
|
Signed-off-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>
|
|
Signed-off-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: Jakub Hrozek <jakub.hrozek@posteo.se>
|
|
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
|
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>
|
|
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
|
|
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
|
|
This way we make sure we don't run into an assert if we have more
teardown functions than setup functions.
|
|
Assertions are commonly used in setup function. If setup function fail
test should not be executed, because it may result into unexpected behaviour
(crash)
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
|
|
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
|
|
This is not really necessary but it fixes Coverity.
CID #1146810
|
|
This reverts commit eb3613e6b4c7b1d6d3a6593bd20ce8654e6bc5b8.
|
|
|
|
|
|
|
|
|
|
|
|
|