Add more checks to iomux test
This commit is contained in:
@@ -28,6 +28,7 @@ static void simple_rcb(struct IOMux *mux, struct IOMuxFD *fd, unsigned int event
|
||||
|
||||
ck_assert_int_le(fd->cookie_int, 2);
|
||||
fd->cookie_int++;
|
||||
fail_if(event != MUX_EV_READ);
|
||||
|
||||
r = read(fd->fd, buf, sizeof buf);
|
||||
ck_assert(r >= 0);
|
||||
@@ -53,6 +54,8 @@ static void simple_wcb(struct IOMux *mux, struct IOMuxFD *fd, unsigned int event
|
||||
ck_assert_int_eq(fd->cookie_int, 0);
|
||||
fd->cookie_int = 1;
|
||||
|
||||
fail_if(event != MUX_EV_WRITE);
|
||||
|
||||
written = write(fd->fd, "Hello", 5);
|
||||
ck_assert_int_eq(written, 5);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user