posix: Implement test for isastream
Add tests for `isastream()` signed-off-by: Gaetan Perrot <gaetanperrotpro@gmail.com>
This commit is contained in:
parent
4f9338a66b
commit
0b51d37f35
|
@ -59,4 +59,13 @@ ZTEST(stropts, test_getpmsg)
|
||||||
zassert_equal(errno, ENOSYS, "Expected errno ENOSYS, got %d", errno);
|
zassert_equal(errno, ENOSYS, "Expected errno ENOSYS, got %d", errno);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ZTEST(stropts, test_isastream)
|
||||||
|
{
|
||||||
|
int fd = -1;
|
||||||
|
int ret = isastream(fd);
|
||||||
|
|
||||||
|
zassert_equal(ret, -1, "Expected return value -1, got %d", ret);
|
||||||
|
zassert_equal(errno, ENOSYS, "Expected errno ENOSYS, got %d", errno);
|
||||||
|
}
|
||||||
|
|
||||||
ZTEST_SUITE(stropts, NULL, NULL, NULL, NULL, NULL);
|
ZTEST_SUITE(stropts, NULL, NULL, NULL, NULL, NULL);
|
||||||
|
|
|
@ -23,6 +23,7 @@ ZTEST(posix_headers, test_stropts_h)
|
||||||
zassert_not_null((void *)fattach, "fattach is null");
|
zassert_not_null((void *)fattach, "fattach is null");
|
||||||
zassert_not_null((void *)getmsg, "getmsg is null");
|
zassert_not_null((void *)getmsg, "getmsg is null");
|
||||||
zassert_not_null((void *)getpmsg, "getpmsg is null");
|
zassert_not_null((void *)getpmsg, "getpmsg is null");
|
||||||
|
zassert_not_null((void *)isastream, "isastream is null");
|
||||||
|
|
||||||
zassert_true(sizeof(((struct strbuf *)0)->maxlen) > 0, "maxlen size is 0");
|
zassert_true(sizeof(((struct strbuf *)0)->maxlen) > 0, "maxlen size is 0");
|
||||||
zassert_true(sizeof(((struct strbuf *)0)->len) > 0, "len size is 0");
|
zassert_true(sizeof(((struct strbuf *)0)->len) > 0, "len size is 0");
|
||||||
|
|
Loading…
Reference in a new issue