aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2018-01-15 10:43:31 +0100
committerPau Espin Pedrol <pespin@sysmocom.de>2018-01-15 10:47:13 +0100
commit10d76b6863cb2168cc5607fd70b191216acc851c (patch)
tree99d2cca9fa22a4f8fbe2fd9bdb40891bafae453f
parent708b8b44aeb8c0e57b8defb3007aef432f2e2b45 (diff)
tests: SocketsTest: Fail test on write fail
-rw-r--r--tests/CommonLibs/SocketsTest.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/CommonLibs/SocketsTest.cpp b/tests/CommonLibs/SocketsTest.cpp
index bde86b8..c4e31d8 100644
--- a/tests/CommonLibs/SocketsTest.cpp
+++ b/tests/CommonLibs/SocketsTest.cpp
@@ -61,6 +61,7 @@ void *testReaderIP(void *param)
int main(int argc, char * argv[] )
{
+ int count;
if (signal(SIGALRM, sigalarm_handler) == SIG_ERR) {
perror("signal");
@@ -82,7 +83,12 @@ int main(int argc, char * argv[] )
sleep(1);
for (int i=0; i<gNumToSend; i++) {
- socket1.write("Hello IP land");
+ CERR("write");
+ count = socket1.write("Hello IP land");
+ if (count < 0) {
+ COUT("FAIL: write");
+ exit(EXIT_FAILURE);
+ }
sleep(1);
}