Skip to content

Commit 2656691

Browse files
Jakub Klimczakfkokosinski
authored andcommitted
tests/posix/device_io: test every libc
Expand the test to cover every libc that Zephyr currently integrates. Signed-off-by: Jakub Klimczak <jklimczak@internships.antmicro.com> Signed-off-by: Filip Kokosinski <fkokosinski@antmicro.com>
1 parent 5dfbe14 commit 2656691

File tree

1 file changed

+2
-8
lines changed
  • tests/posix/device_io/src

1 file changed

+2
-8
lines changed

tests/posix/device_io/src/main.c

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ ZTEST(posix_device_io, test_pselect)
140140

141141
ZTEST(posix_device_io, test_pwrite)
142142
{
143-
/* Zephyr does not yet support writing through a file descriptor */
143+
/* stdout is not seekable, thus it does not support pwrite */
144144
zexpect_equal(pwrite(STDOUT_FILENO, "x", 1, 0), -1);
145145
zexpect_equal(errno, ENOTSUP, "%d", errno);
146146
}
@@ -149,8 +149,7 @@ ZTEST(posix_device_io, test_read)
149149
{
150150
uint8_t buf[8];
151151

152-
/* reading from stdin does not work in Zephyr */
153-
zassert_equal(read(STDIN_FILENO, buf, sizeof(buf)), 0);
152+
zassert_equal(read(STDIN_FILENO, buf, sizeof(buf)), 8);
154153
}
155154

156155
ZTEST(posix_device_io, test_select)
@@ -168,12 +167,7 @@ ZTEST(posix_device_io, test_select)
168167

169168
ZTEST(posix_device_io, test_write)
170169
{
171-
/* write is only implemented in newlib and arcmwdt */
172-
#if defined(CONFIG_NEWLIB_LIBC) || defined(CONFIG_ARCMWDT_LIBC)
173170
zexpect_equal(write(STDOUT_FILENO, "x", 1), 1);
174-
#else
175-
zexpect_equal(write(STDOUT_FILENO, "x", 1), 0);
176-
#endif
177171
}
178172

179173
ZTEST_SUITE(posix_device_io, NULL, NULL, NULL, NULL, NULL);

0 commit comments

Comments
 (0)