tests: clib: Make sure ssize_t type is signed
Add a test that verifies that ssize_t type is signed which is expected. Signed-off-by: Jukka Rissanen <jukka.rissanen@linux.intel.com>
This commit is contained in:
parent
b889120ca7
commit
3da2985b28
1 changed files with 12 additions and 0 deletions
|
@ -20,6 +20,7 @@
|
|||
#include <ztest.h>
|
||||
|
||||
#include <limits.h>
|
||||
#include <sys/types.h>
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
#include <zephyr/types.h>
|
||||
|
@ -55,6 +56,16 @@ void test_limits(void)
|
|||
zassert_true((long_max + long_one == LONG_MIN), NULL);
|
||||
}
|
||||
|
||||
static ssize_t foobar(void)
|
||||
{
|
||||
return -1;
|
||||
}
|
||||
|
||||
void test_ssize_t(void)
|
||||
{
|
||||
zassert_true(foobar() < 0, NULL);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @brief Test boolean types and values library
|
||||
|
@ -288,6 +299,7 @@ void test_main(void)
|
|||
{
|
||||
ztest_test_suite(test_c_lib,
|
||||
ztest_unit_test(test_limits),
|
||||
ztest_unit_test(test_ssize_t),
|
||||
ztest_unit_test(test_stdbool),
|
||||
ztest_unit_test(test_stddef),
|
||||
ztest_unit_test(test_stdint),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue