Reduce TEST_NUM from 1000 to 100 in fs_opendir_test.c
Reduce loop count from 100 to 30 in fs_stream_test.c
Signed-off-by: wangxingxing <wangxingxing@xiaomi.com>
Remove unnecessary usleep(1000) in the read thread of eventfd test.
The eventfd read operation will block and wait for data naturally via semaphore, no additional delay is needed.
Signed-off-by: wangxingxing <wangxingxing@xiaomi.com>
Replace sleep() with pthread_join() to properly wait for the child thread to finish, avoiding orphan threads.
Change sleep(1) to usleep(1000) to reduce test time while maintaining synchronization.
Fix loop iteration count mismatch between reader thread (6 iterations) and writer (5 iterations).
Signed-off-by: ligd <liguiding1@xiaomi.com>
Fix file descriptor leak issue where fd was stored in test_state for deferred close, but could fail when CONFIG_FDCHECK is enabled because fd cannot be closed in a different thread.
Signed-off-by: guohao15 <guohao15@xiaomi.com>
On SIM and QEMU, it is inevitable that the simulating vCPU got preempted
by other threads, causing large timing delay. This commit relax the timing
constraints to reduce the CT error.
Signed-off-by: ouyangxiangzhen <ouyangxiangzhen@xiaomi.com>
remove test_state of fs test cases
Removes unnecessary test_state structure usage for tracking file descriptors
Adds missing close(newfd) call in fs_dup_test.c to prevent file descriptor leaks
Simplifies test code by eliminating redundant fd tracking that could lead to incorrect resource management
Signed-off-by: wangxingxing <wangxingxing@xiaomi.com>
Add malloc.h header file to fstest.h to fix missing malloc/free
function declarations in filesystem test suites.
Signed-off-by: hongfengchen <hongfengchen@xiaomi.com>
Skip UDP listen test when CONFIG_NET_UDP is disabled to prevent
test failures on configurations without UDP support.
Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
Handle fdcheck path for badfd test to prevent unexpected dumps when
fdcheck is enabled, allowing proper testing of bad file descriptor
error cases.
Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
Guard fdcheck-sensitive paths in setsocketopt, dup2, and fsync tests
to avoid assertion failures when fdcheck is enabled, ensuring tests
can properly verify error handling behavior.
Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
Adjust net socket test expectations for correct behavior to prevent
false test failures in network socket test cases.
Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
getTimeofday_test.c:68:22: error: variable 'cnt' set but not used [-Werror,-Wunused-but-set-variable]
Signed-off-by: chenxiaoyi <chenxiaoyi@xiaomi.com>
fix compilation error:
kernel/socket/cases/net_socket_test_010.c: In function ‘ioctltestinternal’:
kernel/socket/cases/net_socket_test_010.c:188:20: error: ‘siocgifname’ undeclared (first use in this function)
188 | ret = ioctl(sfd, siocgifname, &ifr);
Signed-off-by: raiden00pl <raiden00@railab.me>
Clean up code by removing redundant and unused header file includes that were identified through static analysis.
This improves code readability and reduces unnecessary dependencies.
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
Most tools used for compliance and SBOM generation use SPDX identifiers
This change brings us a step closer to an easy SBOM generation.
Signed-off-by: Alin Jerpelea <alin.jerpelea@sony.com>
kernel/fs/cases/fs_stream_test.c:279:70: error: format ‘%zi’ expects argument of type ‘signed size_t’, but argument 4 has type ‘int’ [-Werror=format=]
279 | syslog(LOG_ERR, "len = %zi != return value from fwrite = %zi",
| ~~^
| |
| long int
| %i
280 | len, ret);
| ~~~
| |
| int
kernel/fs/cases/fs_stream_test.c:311:69: error: format ‘%zi’ expects argument of type ‘signed size_t’, but argument 4 has type ‘int’ [-Werror=format=]
311 | syslog(LOG_ERR, "len = %zi != return value from fread = %zi",
| ~~^
| |
| long int
| %i
312 | len, ret);
| ~~~
| |
| int
Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
some test cases have been added that cover the functionality of fs, mutex, pthread, socket, and syscall
Signed-off-by: tengshuangshuang <tengshuangshuang@xiaomi.com>
libuv:
CC: pthread/pthread_mutexattr_setrobust.c libuv/src/unix/thread.c: In function ‘uv_thread_create_ex’:
libuv/src/unix/thread.c:174:24: error: storage size of ‘param’ isn’t known
174 | struct sched_param param;
| ^~~~~
btsak_main:
In file included from btsak_main.c:39:
btsak.h:149:1: error: unknown type name ‘bool’
149 | bool btsak_str2bool(FAR const char *str);
pipe_main.c:
CC: sim/sim_registerdump.c pipe_main.c:44:30: error: unknown type name ‘pthread_addr_t’
44 | static void *open_write_only(pthread_addr_t pvarg)
| ^~~~~~~~~~~~~~
pipe_main.c: In function ‘pipe_main’:
pipe_main.c:81:3: error: unknown type name ‘pthread_t’
81 | pthread_t writeonly;
redirect_test.c: In function ‘redirection_test’:
redirect_test.c:205:3: error: unknown type name ‘pthread_t’
205 | pthread_t readerid;
| ^~~~~~~~~
redirect_test.c:206:3: error: unknown type name ‘pthread_t’
206 | pthread_t writerid;
| ^~~~~~~~~
drivertest_posix_timer.c:48:29: error: ‘optarg’ undeclared (first use in this function)
48 | value = (type)strtoul(optarg, &ptr, base); \
drivertest_posix_timer.c:208:3: warning: implicit declaration of function ‘sleep’ [-Wimplicit-function-declaration]
208 | sleep(SLEEPSECONDS);
| ^~~~~
drivertest_uart.c:92:13: warning: implicit declaration of function ‘read’; did you mean ‘fread’? [-Wimplicit-function-declaration]
92 | len = read(fd, &tmp_char, 1);
| ^~~~
| fread
drivertest_uart.c:323:44: error: ‘optopt’ undeclared (first use in this function)
323 | printf("Unknown option: %c\n", optopt);
kernel/fs/cases/fs_getfilep_test.c:71:9: warning: implicit declaration of function ‘fs_getfilep’ [-Wimplicit-function-declaration]
71 | ret = fs_getfilep(fileno(fp), &filep);
| ^~~~~~~~~~~
kernel/mm/cases/mm_test_008.c:148:9: warning: implicit declaration of function ‘task_create’; did you mean ‘timer_create’? [-Wimplicit-function-declaration]
148 | pid = task_create("TestNuttx08_routine_1",
| ^~~~~~~~~~~
| timer_create
/home/ajh/work/nuttxwork/apps/testing/cmocka/cmocka_main.c:171:11: warning: implicit declaration of function ‘setenv’ [-Wimplicit-function-declaration]
171 | setenv("CMOCKA_XML_FILE", xml_path, 1);
| ^~~~~~
drivertest_pm_runtime.c:123:7: warning: implicit declaration of function ‘usleep’ [-Wimplicit-function-declaration]
123 | usleep(210 * 1000);
| ^~~~~~
Signed-off-by: anjiahao <anjiahao@xiaomi.com>