From 5cccda4af3520ed511403c0cfc0326c583b97167 Mon Sep 17 00:00:00 2001 From: Yorick Barbanneau Date: Fri, 15 Oct 2021 02:04:42 +0200 Subject: [PATCH] Add some tests --- code/test/getchar.c | 9 +++++++++ code/test/getint.c | 9 +++++++++ code/test/putint.c | 7 +++++++ 3 files changed, 25 insertions(+) create mode 100644 code/test/getchar.c create mode 100644 code/test/getint.c create mode 100644 code/test/putint.c diff --git a/code/test/getchar.c b/code/test/getchar.c new file mode 100644 index 0000000..071586f --- /dev/null +++ b/code/test/getchar.c @@ -0,0 +1,9 @@ +#include "syscall.h" + +int main(){ + do { + char c = GetChar(); + PutChar(c); + PutChar('\n'); + } while(1 == 1); +} diff --git a/code/test/getint.c b/code/test/getint.c new file mode 100644 index 0000000..5dba854 --- /dev/null +++ b/code/test/getint.c @@ -0,0 +1,9 @@ +#include "syscall.h" + +int main(){ + do { + int number = GetInt(); + PutInt(number); + PutChar('\n'); + } while(1 == 1); +} diff --git a/code/test/putint.c b/code/test/putint.c new file mode 100644 index 0000000..5c47d11 --- /dev/null +++ b/code/test/putint.c @@ -0,0 +1,7 @@ +#include "syscall.h" + +int main(){ + PutInt(10); + PutInt(110); + PutInt(007); +}