Skip to content

Commit a077a2c

Browse files
committed
tests: Make sure to use ZVFS_OPEN_SIZE define
As the CONFIG_ZVFS_OPEN_MAX is set to 0 by default, we must use ZVFS_OPEN_SIZE in the tests. Signed-off-by: Jukka Rissanen <[email protected]>
1 parent 12eb6a1 commit a077a2c

File tree

5 files changed

+6
-6
lines changed

5 files changed

+6
-6
lines changed

tests/net/socket/select/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ ZTEST_USER(net_socket_select, test_fd_set)
3434
{
3535
zsock_fd_set set;
3636

37-
/* Relies on specific value of CONFIG_ZVFS_OPEN_MAX in prj.conf */
37+
/* Relies on specific value of ZVFS_OPEN_SIZE */
3838
zassert_equal(sizeof(set.bitset), sizeof(uint32_t) * 2, "");
3939

4040
ZSOCK_FD_ZERO(&set);

tests/net/socket/tcp/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2665,7 +2665,7 @@ static void after(void *arg)
26652665
{
26662666
ARG_UNUSED(arg);
26672667

2668-
for (int i = 0; i < CONFIG_ZVFS_OPEN_MAX; ++i) {
2668+
for (int i = 0; i < ZVFS_OPEN_SIZE; ++i) {
26692669
(void)zsock_close(i);
26702670
}
26712671
}

tests/net/socket/udp/src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3719,7 +3719,7 @@ static void after(void *arg)
37193719
{
37203720
ARG_UNUSED(arg);
37213721

3722-
for (int i = 0; i < CONFIG_ZVFS_OPEN_MAX; ++i) {
3722+
for (int i = 0; i < ZVFS_OPEN_SIZE; ++i) {
37233723
(void)zsock_close(i);
37243724
}
37253725
}

tests/posix/fs/src/test_fs_file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,7 @@ ZTEST(posix_fs_file_test, test_fs_unlink)
261261
ZTEST(posix_fs_file_test, test_fs_fd_leak)
262262
{
263263
const int reps =
264-
MAX(CONFIG_POSIX_OPEN_MAX, CONFIG_ZVFS_OPEN_MAX) + 5;
264+
MAX(CONFIG_POSIX_OPEN_MAX, ZVFS_OPEN_SIZE) + 5;
265265

266266
for (int i = 0; i < reps; i++) {
267267
if (i > 0) {

tests/posix/xsi_realtime/src/shm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,10 @@
3131
#define OPEN_FLAGS (VALID_FLAGS & ~O_CREAT)
3232

3333
/* account for stdin, stdout, stderr */
34-
#define N (CONFIG_ZVFS_OPEN_MAX - 3)
34+
#define N (ZVFS_OPEN_SIZE - 3)
3535

3636
/* we need to have at least 2 shared memory objects */
37-
BUILD_ASSERT(N >= 2, "CONFIG_ZVFS_OPEN_MAX must be > 4");
37+
BUILD_ASSERT(N >= 2, "ZVFS_OPEN_SIZE must be > 4");
3838

3939
#define S_TYPEISSHM(st) (((st)->st_mode & ZVFS_MODE_IFMT) == ZVFS_MODE_IFSHM)
4040

0 commit comments

Comments
 (0)