diff options
Diffstat (limited to 'libcr_ipc/tests')
-rw-r--r-- | libcr_ipc/tests/test_chan.c | 10 | ||||
-rw-r--r-- | libcr_ipc/tests/test_rpc.c | 12 | ||||
-rw-r--r-- | libcr_ipc/tests/test_select.c | 9 |
3 files changed, 15 insertions, 16 deletions
diff --git a/libcr_ipc/tests/test_chan.c b/libcr_ipc/tests/test_chan.c index 9b6f018..e5d9dc8 100644 --- a/libcr_ipc/tests/test_chan.c +++ b/libcr_ipc/tests/test_chan.c @@ -15,12 +15,12 @@ COROUTINE cr_producer(void *_ch) { intchan_t *ch = _ch; cr_begin(); - intchan_send(ch, 1); + cr_chan_send(ch, 1); - while (!intchan_can_send(ch)) + while (!cr_chan_can_send(ch)) cr_yield(); - intchan_send(ch, 2); + cr_chan_send(ch, 2); cr_end(); @@ -31,10 +31,10 @@ COROUTINE cr_consumer(void *_ch) { intchan_t *ch = _ch; cr_begin(); - x = intchan_recv(ch); + x = cr_chan_recv(ch); test_assert(x == 1); - x = intchan_recv(ch); + x = cr_chan_recv(ch); test_assert(x == 2); cr_end(); diff --git a/libcr_ipc/tests/test_rpc.c b/libcr_ipc/tests/test_rpc.c index 1e3c471..910b738 100644 --- a/libcr_ipc/tests/test_rpc.c +++ b/libcr_ipc/tests/test_rpc.c @@ -18,10 +18,10 @@ COROUTINE cr_caller(void *_ch) { intrpc_t *ch = _ch; cr_begin(); - int resp = intrpc_send_req(ch, 1); + int resp = cr_rpc_send_req(ch, 1); test_assert(resp == 2); - resp = intrpc_send_req(ch, 3); + resp = cr_rpc_send_req(ch, 3); test_assert(resp == 4); cr_exit(); @@ -31,9 +31,9 @@ COROUTINE cr_worker1(void *_ch) { intrpc_t *ch = _ch; cr_begin(); - intrpc_req_t req = intrpc_recv_req(ch); + intrpc_req_t req = cr_rpc_recv_req(ch); test_assert(req.req == 1); - intrpc_send_resp(req, 2); + cr_rpc_send_resp(req, 2); cr_exit(); } @@ -42,9 +42,9 @@ COROUTINE cr_worker2(void *_ch) { intrpc_t *ch = _ch; cr_begin(); - intrpc_req_t req = intrpc_recv_req(ch); + intrpc_req_t req = cr_rpc_recv_req(ch); test_assert(req.req == 3); - intrpc_send_resp(req, 4); + cr_rpc_send_resp(req, 4); cr_exit(); } diff --git a/libcr_ipc/tests/test_select.c b/libcr_ipc/tests/test_select.c index 1db645b..3da1c78 100644 --- a/libcr_ipc/tests/test_select.c +++ b/libcr_ipc/tests/test_select.c @@ -53,9 +53,8 @@ COROUTINE cr_consumer(void *) { test_assert(ret_arg == 0); send = 890; - args[0] = CR_SELECT_SEND(&fch, &send); - args[1] = CR_SELECT_DEFAULT; - ret_arg = cr_select_v(2, args); + ret_arg = cr_select_l(CR_SELECT_SEND(&fch, &send), + CR_SELECT_DEFAULT); test_assert(ret_arg == 1); cr_end(); @@ -65,7 +64,7 @@ COROUTINE cr_producer(void *_n) { int n = *(int *)_n; cr_begin(); - intchan_send(&ch[n], n); + cr_chan_send(&ch[n], n); cr_end(); } @@ -73,7 +72,7 @@ COROUTINE cr_producer(void *_n) { COROUTINE cr_final(void *) { cr_begin(); - int ret = intchan_recv(&fch); + int ret = cr_chan_recv(&fch); printf("ret=%d\n", ret); test_assert(ret == 567); |