- 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> (backported from commit 2206c225)
-
- Feb 03, 2024
-
-
Alois Klink authored
Disable `-Wdeclaration-after-statement`. Before ISO C99, declaring variables after statements was not allowed by the C standard, but was allowed by GCC as an extension. CMocka now requires a minimum version of C99, since commit 5a4b1587 , so this behaviour is valid on all compilers. on-behalf-of: @nqminds <info@nqminds.com> Reviewed-by:
Andreas Schneider <asn@cryptomilk.org> (cherry picked from commit bfdf78c4)
-
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> (cherry picked from commit 90315882)
-
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> (cherry picked from commit 54b3af46)
-
- Feb 02, 2024
-
-
Alexander Dahl authored
Projects using cmocka could have done this successfully from version 1.0 to 1.1.5 to build against cmocka: ``` find_package(cmocka 1.0 REQUIRED CONFIG) ``` and later ``` target_link_libraries(myapp ${CMOCKA_LIBRARIES} ) ``` Modern apps should just "link" against 'cmocka::cmocka' instead like it's done in examples already. To not break old builds (as it is the case with cmocka release 1.1.7) we can put that modern target string into the variable CMOCKA_LIBRARIES and thus trick old projects to just use that, keeping compatibility until those projects explicitly use the modern version. Link: https://cmake.org/cmake/help/latest/command/install.html#install-export Link: https://cmake.org/cmake/help/latest/manual/cmake-packages.7.html#package-configuration-file Link: https://cmake.org/cmake/help/latest/module/CMakePackageConfigHelpers.html#module:CMakePackageConfigHelpers Fixes: #87 Signed-off-by:Alexander Dahl <ada@thorsis.com> Reviewed-by:
Andreas Schneider <asn@cryptomilk.org> (cherry picked from commit de676758)
-
Alexander Dahl authored
Makes the implementation behave the same like libc calloc() and not fail with unpredictable errors in test_malloc() anymore. Signed-off-by:
Alexander Dahl <ada@thorsis.com> Reviewed-by:
Andreas Schneider <asn@cryptomilk.org> (cherry picked from commit 6ff1378b)
-
Alexander Dahl authored
calloc() is prone to integer overflow on multiplication of its arguments. glibc, musl, and uclibc test for that in its implementations and return NULL in that case with errno set to ENOMEM. cmocka lacks such a check and passes all kinds of overflown values to test_malloc() with different ways to fail. Signed-off-by:
Alexander Dahl <ada@thorsis.com> Reviewed-by:
Andreas Schneider <asn@cryptomilk.org> (cherry picked from commit d87c4700)
-
- Feb 23, 2023
-
-
Andreas Schneider authored
-
- Feb 19, 2023
-
-
Andreas Schneider authored
Fixes #86
-
- Feb 17, 2023
-
-
Andreas Schneider authored
-
Andreas Schneider authored
Signed-off-by:Andreas Schneider <asn@cryptomilk.org>
-
Andreas Schneider authored
This way compilers should not mark it as unreachable.
-
Andreas Schneider authored
-
Andreas Schneider authored
-
- Feb 16, 2023
-
-
Biswapriyo Nath authored
This fixes path relocation in mingw environment by using predefined Libs and Cflags variable in pkgconfig file. Otherwise, libdir and includedir are not shown in pkgconf output. e.g. * Without predefined variables: - pkgconf -cflags cmocka: No output - pkgconf -libs cmocka: -lcmocka * With predefined variables: - pkgconf -cflags cmocka: -IC:/msys64/mingw64/include - pkgconf -libs cmocka: -LC:/msys64/mingw64/lib -lcmocka Also official documentation suggests to use predefiend keywords here https://people.freedesktop.org/~dbn/pkg-config-guide.html Signed-off-by:
Biswapriyo Nath <nathbappai@gmail.com> Reviewed-by:
Andreas Schneider <asn@cryptomilk.org>
-
Andreas Schneider authored
This should fix being imported by other projects. Fixes #85
-
Andreas Schneider authored
Fixes #63
-
Andreas Schneider authored
Fixes #65
-
Andreas Schneider authored
-
Andreas Schneider authored
Signed-off-by:Andreas Schneider <asn@cryptomilk.org>
-
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
-
Frédéric Jouault authored
Reviewed-by:Andreas Schneider <asn@cryptomilk.org>
-
Alexander Dahl authored
Fixes: 400038f6 ("include: Add a group for mock objects.") Signed-off-by:
Alexander Dahl <ada@thorsis.com> Reviewed-by:
Andreas Schneider <asn@cryptomilk.org>
-
Ammar Ratnani authored
-
- Oct 12, 2020
-
-
Andreas Schneider authored
Fixes #26 (cherry picked from commit fe9663b8)
-
- Oct 07, 2020
-
-
Andreas Schneider authored
-
Andreas Schneider authored
Will be required in future.
-
Andreas Schneider authored
The documentation is doxygen generated in the meantime!
-
Andreas Schneider authored
Also add basic tests Fixes #48
-
Andreas Schneider authored
Fixes #51
-
- Oct 05, 2020
-
-
Sergey Bronnikov authored
Version must be specified in a first line of TAP13 output. See TAP13 specification - https://testanything.org/tap-version-13-specification.html Reviewed-by:
Andreas Schneider <asn@cryptomilk.org>
-
- Oct 04, 2020
-
-
Pascal Cuoq authored
Reviewed-by:Andreas Schneider <asn@cryptomilk.org>
-