From e90d69948c067b7359369b0e7424f1a46c728540 Mon Sep 17 00:00:00 2001 From: EnderIce2 Date: Wed, 27 Mar 2024 20:51:08 +0200 Subject: [PATCH] Add test_stdin function --- apps/base/utest/userspace_test.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/apps/base/utest/userspace_test.c b/apps/base/utest/userspace_test.c index 513bede6..b88739c6 100644 --- a/apps/base/utest/userspace_test.c +++ b/apps/base/utest/userspace_test.c @@ -737,6 +737,20 @@ void reboot_linux() reboot(RB_AUTOBOOT); } +void test_stdin() +{ + printf("- Testing stdin\n"); + + while (1) + { + printf("Input: "); + fflush(stdout); + char input[256]; + fgets(input, sizeof(input), stdin); + printf("%s", input); + } +} + void self_fork_exec() { while (1) @@ -812,6 +826,8 @@ int main(int argc, char *argv[], char *envp[]) // fork_bomb(); // fork_bomb_syscall(); + // test_stdin(); + // test_stdio(); test_unaligned(); test_passwd(); test_brk(); @@ -819,7 +835,6 @@ int main(int argc, char *argv[], char *envp[]) test_signal(); test_ptmx(); test_args(argc, argv, envp); - // test_stdio(); test_system(); test_file(); test_dirent();