- Jun 11, 2024
-
-
Andreas Schneider authored
-
Andreas Schneider authored
-
- Apr 17, 2024
-
-
Friedrich Schwedler authored
Implements: assert_ptr_equal with assert_ptr_equal_msg assert_ptr_not_equal with assert_ptr_not_equal_msg assert_null with assert_null_msg assert_non_null with assert_non_null_msg Signed-off-by:
Friedrich Schwedler <fschwedler@emlix.com> Reviewed-by:
Andreas Schneider <asn@cryptomilk.org>
-
Friedrich Schwedler authored
Signed-off-by:
Friedrich Schwedler <fschwedler@emlix.com> Reviewed-by:
Andreas Schneider <asn@cryptomilk.org>
-
Friedrich Schwedler authored
Signed-off-by:
Friedrich Schwedler <fschwedler@emlix.com> Reviewed-by:
Andreas Schneider <asn@cryptomilk.org>
-
Friedrich Schwedler authored
with automatic formating depending on the output format Signed-off-by:
Friedrich Schwedler <fschwedler@emlix.com> Reviewed-by:
Andreas Schneider <asn@cryptomilk.org>
-
- Feb 12, 2024
-
-
Jakub Czapiga authored
Use boolean type instead of integer to return logical values. This ensures correct values handling and reduction in confusion for developers. TEST=mkdir obj ; ( cd obj && cmake --DCMAKE_BUILD_TYPE=RelWithDebInfo \ -DPICKY_DEVELOPER=ON DUNIT_TESTING=ON .. && make -j \ && ctest --output-on-failure ) Reviewed-by:Andreas Schneider <asn@cryptomilk.org>
-
Andreas Schneider authored
-
- Feb 06, 2024
-
-
Andreas Schneider authored
-
- Feb 05, 2024
-
-
Andreas Schneider authored
Reviewed-by:Joseph Sutton <jsutton@samba.org>
-
Andreas Schneider authored
Reviewed-by:Joseph Sutton <jsutton@samba.org>
-
Andreas Schneider authored
Reviewed-by:Joseph Sutton <jsutton@samba.org>
-
Andreas Schneider authored
Reviewed-by:Joseph Sutton <jsutton@samba.org>
-
- Feb 04, 2024
-
-
Joseph Sutton authored
The %x specifier expects an unsigned argument. If char is signed, cmocka_print_error() may incorrectly display values sign-extended. To fix this, use an unsigned char and the corresponding format specifier (%hhx). Signed-off-by:
Joseph Sutton <josephsutton@catalyst.net.nz> Reviewed-by:
Andreas Schneider <asn@cryptomilk.org>
-
- Feb 03, 2024
-
-
Jakub Czapiga authored
Replace characters with their XML string equivalents to allow for them in the tests and groups names. Reviewed-by:Andreas Schneider <asn@cryptomilk.org>
-
Jakub Czapiga authored
Return successfuly if there is nothing to replace. Allow for replacement with superset pattern. Simplified example without fix: c_strreplace("ABCD", "A", "AX") -> "AAAAAA...AAAXBCD" Simplified example with fix: c_strreplace("ABCD", "A", "AX") -> "AXBCD" Reviewed-by:Andreas Schneider <asn@cryptomilk.org>
-
- Feb 02, 2024
-
-
Andreas Schneider authored
-
Andreas Schneider authored
-
Andreas Schneider authored
-
Andreas Schneider authored
-
Andreas Schneider authored
-
Andreas Schneider authored
-
Andreas Schneider authored
-
Andreas Schneider authored
-
Andreas Schneider authored
-
Andreas Schneider authored
-
Andreas Schneider authored
-
Andreas Schneider authored
-
Andreas Schneider authored
-
Andreas Schneider authored
See #93
-
- Jan 05, 2024
-
-
Eshan Kelkar authored
Signed-off-by:
Eshan Kelkar <eshankelkar@galorithm.com> Reviewed-by:
Andreas Schneider <asn@cryptomilk.org>
-
Eshan Kelkar authored
Signed-off-by:
Eshan Kelkar <eshankelkar@galorithm.com> Reviewed-by:
Andreas Schneider <asn@cryptomilk.org>
-
Eshan Kelkar authored
Both assert_true(expression) and assert_false(expression) print the expression when the assertion fails. Its not very clear on seeing the expression that what exactly is the error, whether its the expression being true or it being false. This commit changes the assert_true() and assert_false() such that on failure of assertion: - assert_true(expression) prints : expression is not true - assert_false(expression) prints : expression is not false Signed-off-by:
Eshan Kelkar <eshankelkar@galorithm.com> Reviewed-by:
Andreas Schneider <asn@cryptomilk.org>
-
- Aug 01, 2023
-
-
Andreas Schneider authored
We do not support such old versions anymore.
-
Alois Klink authored
In some cases, using the `assert_ptr_*()` macros causes GCC to throw a `-Wmaybe-unitialized` warning. For example: ```c void * my_ptr = malloc(1); // throws a `-Wmaybe-unitialized` warning assert_non_null(my_ptr); ``` This is because GCC assumes that a function accepting a `const void *` (or other constant pointer type) tries to read the pointer value. See [the `-Wmaybe-unitialized` docs][1]. We can tell GCC that the `_assert_ptr_equal`/`_assert_ptr_not_equal` functions only try to read the pointer address, not the pointer value, by using the [`access` function attribute][2]. Since CMocka supports C99, we can't use the ISO C23 attribute syntax. However, we can use the IBM/GCC/Clang `__attribute__` syntax hidden behind `#ifdef` guards, so that they're ignored on compilers that don't support `__attribute__`. [1]: https://gcc.gnu.org/onlinedocs/gcc-12.2.0/gcc/Warning-Options.html#Warning-Options [2]: https://gcc.gnu.org/onlinedocs/gcc-12.2.0/gcc/Common-Function-Attributes.html#Common-Function-Attributes on-behalf-of: @nqminds <info@nqminds.com> Reviewed-by:
Andreas Schneider <asn@cryptomilk.org>
-
wdlkmpx authored
33 tests: 21 ok, 12 expected fail, 0 fail, 0 skipped Reviewed-by:Andreas Schneider <asn@cryptomilk.org>
-
wdlkmpx authored
Reviewed-by:Andreas Schneider <asn@cryptomilk.org>
-
Alois Klink authored
Enable the [`WINDOWS_EXPORT_ALL_SYMBOLS` CMake property][1], which automatically exports all symbols into the `.dll` file. This feature is available since [CMake 3.4][2], which is fine, since the minimum version of CMake CMocka supports is CMake 3.5. It is a bit slower, but it does mean that we no longer need to manually create a `.def` file, as CMake will automatically create one for us. [1]: https://cmake.org/cmake/help/latest/prop_tgt/WINDOWS_EXPORT_ALL_SYMBOLS.html [2]: https://www.kitware.com//create-dlls-on-windows-without-declspec-using-new-cmake-export-all-feature/ Reviewed-by:
Andreas Schneider <asn@cryptomilk.org>
-
Alois Klink authored
Add a new macro called `CMOCKA_DLLEXTERN` that represents Windows DLL storage class specifiers. Essentially, in order to publically export some data in a DLL, you must either declare the function/data with `__declspec(dllexport)`, or list the function/data in a `.def` file (which is what the CMocka project does). In order to import functions from a DLL, `__declspec(dllimport)` may be used for a performance increase. However, **`__declspec(dllimport)` is required for importing data from a DLL**! The new `CMOCKA_DLLEXTERN` macro takes care of this for us, when we're using MSVC. See https://github.com/MicrosoftDocs/cpp-docs/blob/main/docs/cpp/definitions-and-declarations-cpp.md Reviewed-by:
Andreas Schneider <asn@cryptomilk.org>
-
- May 07, 2023
-
-
Alexander Courtis authored
Reviewed-by:Andreas Schneider <asn@cryptomilk.org>
-