Commit Graph

770 Commits

Author SHA1 Message Date
Andreas Schneider d4f1c58522 include: Document cmocka_print_error() 2022-03-11 11:44:15 +01:00
Andreas Schneider 9994ceea95 src: Rename cm_print_error to cmocka_print_error 2022-03-11 11:38:36 +01:00
Ammar Ratnani aba3c7d4df Fix issue with fail_msg 2022-03-11 11:36:07 +01:00
Evan Miller 8820579699 Always pass stack-protector flag to linker
Fixes issue with GCC 7.5 and OS X 10.4.

See: https://trac.macports.org/ticket/63469

Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2022-03-11 08:09:08 +01:00
Andreas Schneider 2ff20a8ef9 include: Update copyright year info 2022-03-11 08:01:09 +01:00
Carsten Lange a066c20abf Add new feature stop
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2022-03-11 08:00:12 +01:00
NikLeberg edacf938e8 feature: add multiple simultaneous outputs
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2022-03-11 07:16:53 +01:00
Andreas Schneider 201c3c8175 include: Define strtok_r with Visual Studio
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2022-03-05 22:05:01 +01:00
Andreas Schneider 080ae1de04 gitlab-ci: Move memory and ub sanitizer to analysis stage 2022-03-03 09:33:01 +01:00
Andreas Schneider 9e9418b7fa gitlab-ci: Move freebsd to test stage 2022-03-03 08:56:44 +01:00
Andreas Schneider 7835a27ff8 tests: Fix unused parameter warning. 2022-03-03 07:23:32 +01:00
Andreas Schneider 43673a4f73 examples: Add missing compile and link options 2022-03-02 09:30:10 +01:00
Andreas Schneider 300254514a gitlab-ci: Introduce stages 2022-03-02 09:30:10 +01:00
Andreas Schneider e42b0ed34c gitlab-ci: Fix typo in fedora/mingw32 build 2022-03-02 09:30:10 +01:00
Andreas Schneider 487d2dff70 gitlab-ci: Use gitlab windows runners 2022-03-02 09:30:10 +01:00
Andreas Schneider bc1d46f221 gitlab-ci: Reformat yaml 2022-03-02 09:30:10 +01:00
Andreas Schneider 3760d5ff1a tests: The exception handler doesn't work on Windows
Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2022-03-02 09:30:10 +01:00
Andreas Schneider f6134a5431 tests: Relax regular expression for test_exception_handler 2022-03-02 09:30:10 +01:00
Andreas Schneider 828d6cf316 tests: Raise segmantation fault
This way compilers should not mark it as unreachable.
2022-03-02 09:30:10 +01:00
Andreas Schneider 4ca2205565 tests: Rename exceptions tests array 2022-03-02 09:30:10 +01:00
Andreas Schneider 499a670935 tests: Fix unused parameter warnings in test_expect_check_fail.c 2022-03-02 09:30:10 +01:00
Andreas Schneider b3b2a9cc4a tests: Fix unused parameter warnings in test_expect_check.c 2022-03-02 09:30:10 +01:00
Andreas Schneider 22a382b615 tests: Initialize 'struct stat' in test_assert_macros.c 2022-03-02 09:30:10 +01:00
Andreas Schneider a7a1ae83d5 cmake: Fix path where to find cmocka.dll 2022-03-02 09:30:10 +01:00
Andreas Schneider 593a77689e gitignore: Add .cache directory 2022-03-02 09:04:01 +01:00
Johan Stridkvist 59f47928a0 Add macro for expect_check_count
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2022-02-26 20:48:25 +01:00
Frédéric Jouault c47ad7bcc3 include: Improved call ordering documentation
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2022-02-26 20:45:11 +01:00
Andreas Schneider 248c29634c Update editorconfig 2022-02-26 20:42:14 +01:00
Alexander Dahl 285a70c65b Add .editorconfig
To avoid whitespace fixups and let editors do the right thing in the
first place, introduce editorconfig.

Link: https://editorconfig.org/
Link: https://gitlab.com/cmocka/cmocka/-/merge_requests/37#note_547543224
Signed-off-by: Alexander Dahl <ada@thorsis.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2022-02-26 20:40:21 +01:00
Alexander Dahl 4b8c67c3fb doc: Remove redundant include line in documentation
stdint was added to inline doc in 2019 and to main doc in 2020, but with
that accidentally to the header file again.

Fixes: 8d99418ef6 ("include: Change from should to must and add stdint.h")
Fixes: e31967fbed ("doc: Add stdint.h to headers")
Signed-off-by: Alexander Dahl <ada@thorsis.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2022-02-26 20:26:26 +01:00
Alexander Dahl 629ae858da doc: Remove redundant words
Fixes: 400038f6ca ("include: Add a group for mock objects.")
Signed-off-by: Alexander Dahl <ada@thorsis.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2022-02-26 18:39:15 +01:00
Alexander Dahl 5a4b15870e cmake: Add C99 requirement to target properties
stdint.h and uintmax_t require a C99 capable compiler. Let CMake know.

Fixes: 0e70150002 ("cmocka: Replace LargestIntegralType with uintmax_t")
Signed-off-by: Alexander Dahl <ada@thorsis.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2021-04-08 15:37:21 +02:00
Alexander Dahl 93703d7411 cmake: Combine target properties in a single statement
This is more compact, readable, and easier to extend later.

Signed-off-by: Alexander Dahl <ada@thorsis.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2021-04-08 15:37:21 +02:00
Wolfram Rösler 160dffe8d0 Don't use non-literal format strings
to allow the compiler to check parameter types.

Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2021-01-13 17:29:35 +01:00
Wolfram Rösler 65d69f72b8 Fix unexpanded %s in leftover values error messages
Before:

        myfunction: '%s' parameter still has values that haven't been checked.

Now, %s is expanded properly:

        myfunction: 'num_samples' parameter still has values that haven't been checked.

Parameter `error_message` of functions `check_for_leftover_values` and
`check_for_leftover_values_list` isn't actually the error message but
rather a printf-style format string (containing one `%s`) used to build
the error message. That means that it must be the first argument of
`cm_print_error`. The previous version used another `%s` to output the
contents of `error_message`, so the format string was printed but not
expanded.

Renamed the parameter to `error_message_fmt` for emphasis.

Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
2021-01-13 17:29:35 +01:00
Andreas Schneider a4fc3dd770 cmocka: Use intmax_t for assert_return_code()
Fixes #31
2020-10-12 08:25:26 +02:00
Andreas Schneider 1003e76472 cmocka: Remove deprecated functions and cmockery legacy support 2020-10-12 08:25:26 +02:00
Andreas Schneider ae89bfa145 cmocka: Rename to cast_ptr_to_uintmax_type() 2020-10-12 08:25:26 +02:00
Andreas Schneider 68f1d95923 include: Rename to cast_to_uintptr_type() 2020-10-12 08:25:26 +02:00
Andreas Schneider cfc2cf54a4 include: Rename to cast_to_uintmax_type() 2020-10-12 08:25:26 +02:00
Andreas Schneider 00b3deb56d cmocka: Move PrintFormat defines to C file 2020-10-12 08:25:26 +02:00
Andreas Schneider 36b929f0fb cmocka: Rename LargestIntegral* to UintMax* 2020-10-12 08:25:26 +02:00
Andreas Schneider 821e125df6 cmocka: Rename to cast_uintmax_type_to_pointer 2020-10-12 08:25:26 +02:00
Andreas Schneider 0e70150002 cmocka: Replace LargestIntegralType with uintmax_t
This requires #include <stdint.h>

Fixes #38
Fixes #49
2020-10-12 08:25:26 +02:00
Andreas Schneider fe9663b80e cmocka: Fix cm_print_error() in check_for_leftover_values(_list)
Fixes #26
2020-10-12 08:23:52 +02:00
Andreas Schneider 314602bce4 include: Improve documentation for expect_value() 2020-10-05 18:01:13 +02:00
Andreas Schneider e31967fbed doc: Add stdint.h to headers
Will be required in future.
2020-10-05 17:10:47 +02:00
Andreas Schneider 25b8f0abed doc: Remove old and obsolete index.html
The documentation is doxygen generated in the meantime!
2020-10-05 17:06:19 +02:00
Andreas Schneider 7b91eaa93b cmocka: Remove cast in assert_string_(not_)equal macros
Also add basic tests

Fixes #48
2020-10-05 16:56:49 +02:00
Andreas Schneider 36c85066de cmocka: Increase the vprint buffers
Fixes #51
2020-10-05 16:56:46 +02:00