aboutsummaryrefslogtreecommitdiff
path: root/src/tests/utests/chan1
diff options
context:
space:
mode:
authorAlex Auvolat <alex@adnab.me>2016-07-30 23:17:12 +0200
committerAlex Auvolat <alex@adnab.me>2016-07-30 23:17:12 +0200
commitf58f65c30de315d4419f69a92a708cbed797ff37 (patch)
treeefaaa82089523dc0f7a3b9a6ab4c963550f9b241 /src/tests/utests/chan1
parentfa5327d4cc5e47656326b8c0c55d23cd71b04462 (diff)
downloadkogata-f58f65c30de315d4419f69a92a708cbed797ff37.tar.gz
kogata-f58f65c30de315d4419f69a92a708cbed797ff37.zip
Release mode (enables some optimizations) ; fix tests.
Diffstat (limited to 'src/tests/utests/chan1')
-rw-r--r--src/tests/utests/chan1/test.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/tests/utests/chan1/test.c b/src/tests/utests/chan1/test.c
index 1b89255..0c4e61a 100644
--- a/src/tests/utests/chan1/test.c
+++ b/src/tests/utests/chan1/test.c
@@ -1,26 +1,26 @@
#include <string.h>
-#include <malloc.h>
+#include <kogata/malloc.h>
-#include <syscall.h>
-#include <debug.h>
+#include <kogata/syscall.h>
+#include <kogata/debug.h>
int main(int argc, char **argv) {
- fd_pair_t ch = make_channel(false);
+ fd_pair_t ch = sc_make_channel(false);
char* s = "Hello, world!";
- ASSERT(write(ch.a, 0, strlen(s), s) == strlen(s));
+ ASSERT(sc_write(ch.a, 0, strlen(s), s) == strlen(s));
char buf[128];
- ASSERT(read(ch.b, 0, 128, buf) == strlen(s));
+ ASSERT(sc_read(ch.b, 0, 128, buf) == strlen(s));
ASSERT(strncmp(s, buf, strlen(s)) == 0);
- close(ch.a);
+ sc_close(ch.a);
sel_fd_t sel = { .fd = ch.b, .req_flags = SEL_ERROR };
- ASSERT(select(&sel, 1, 0));
+ ASSERT(sc_select(&sel, 1, 0));
ASSERT(sel.got_flags & SEL_ERROR);
- close(ch.b);
+ sc_close(ch.b);
dbg_printf("(TEST-OK)\n");