From aaa463ec9fe1c8f55a3ef5fa6ca290ac196199b1 Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Sun, 12 Aug 2012 23:14:14 -0700 Subject: [PATCH] Assert return values. --- libguac/tests/protocol/instruction_read.c | 7 +++++-- libguac/tests/protocol/instruction_write.c | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/libguac/tests/protocol/instruction_read.c b/libguac/tests/protocol/instruction_read.c index a763ad21..45e7083d 100644 --- a/libguac/tests/protocol/instruction_read.c +++ b/libguac/tests/protocol/instruction_read.c @@ -56,7 +56,7 @@ void test_instruction_read() { "5.test2,10.hellohello,15.worldworldworld;"; /* Create pipe */ - pipe(fd); + CU_ASSERT_EQUAL_FATAL(pipe(fd), 0); /* File descriptors */ rfd = fd[0]; @@ -72,7 +72,10 @@ void test_instruction_read() { /* Child (pipe writer) */ if (childpid != 0) { close(rfd); - write(wfd, test_string, sizeof(test_string)); + CU_ASSERT_EQUAL( + write(wfd, test_string, sizeof(test_string)), + sizeof(test_string) + ); exit(0); } diff --git a/libguac/tests/protocol/instruction_write.c b/libguac/tests/protocol/instruction_write.c index 1e003942..58b136a4 100644 --- a/libguac/tests/protocol/instruction_write.c +++ b/libguac/tests/protocol/instruction_write.c @@ -52,7 +52,7 @@ void test_instruction_write() { int fd[2], childpid; /* Create pipe */ - pipe(fd); + CU_ASSERT_EQUAL_FATAL(pipe(fd), 0); /* File descriptors */ rfd = fd[0];