Skip to content
Permalink
Browse files

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>
  • Loading branch information...
jukkar committed Jul 8, 2019
1 parent b889120 commit 3da2985b28372d04680ad64f29649f43e841d894
Showing with 12 additions and 0 deletions.
  1. +12 −0 tests/lib/c_lib/src/main.c
@@ -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),

0 comments on commit 3da2985

Please sign in to comment.
You can’t perform that action at this time.