Skip to content

Commit 3c42773

Browse files
Jakub Klimczaknashif
authored andcommitted
zvfs: Remove test for static initialization of stdin, stdout, stderr
This removes a function that created a new mutex and conditional variable and used memcpy() to compare them with ones in a given fdtable entry. Since those struct members are initialized statically, this test doesn't serve much of a purpose anymore. Moreover, padding bytes inside structs are technically not required to be zero, so these memcpy() calls caused SonarQube to complain. Signed-off-by: Jakub Klimczak <[email protected]>
1 parent f16f3f6 commit 3c42773

File tree

2 files changed

+0
-43
lines changed

2 files changed

+0
-43
lines changed

lib/os/zvfs/zvfs_fdtable.c

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -179,30 +179,6 @@ static int _check_fd(int fd)
179179
return 0;
180180
}
181181

182-
#ifdef CONFIG_ZTEST
183-
bool fdtable_fd_is_initialized(int fd)
184-
{
185-
struct k_mutex ref_lock;
186-
struct k_condvar ref_cond;
187-
188-
if (fd < 0 || fd >= ARRAY_SIZE(fdtable)) {
189-
return false;
190-
}
191-
192-
ref_lock = (struct k_mutex)Z_MUTEX_INITIALIZER(fdtable[fd].lock);
193-
if (memcmp(&ref_lock, &fdtable[fd].lock, sizeof(ref_lock)) != 0) {
194-
return false;
195-
}
196-
197-
ref_cond = (struct k_condvar)Z_CONDVAR_INITIALIZER(fdtable[fd].cond);
198-
if (memcmp(&ref_cond, &fdtable[fd].cond, sizeof(ref_cond)) != 0) {
199-
return false;
200-
}
201-
202-
return true;
203-
}
204-
#endif /* CONFIG_ZTEST */
205-
206182
void *zvfs_get_fd_obj(int fd, const struct fd_op_vtable *vtable, int err)
207183
{
208184
struct fd_entry *entry;

tests/posix/common/src/_main.c

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)