aboutsummaryrefslogtreecommitdiffstats
path: root/tests/CommonLibs
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2018-01-09 19:45:15 +0100
committerPau Espin Pedrol <pespin@sysmocom.de>2018-01-10 11:31:22 +0100
commit2f376a3edf6c1c6c49db822de17bbf0d3791775e (patch)
tree7dfef1dfa1ad97c89c84862badfc71a10a24d25e /tests/CommonLibs
parent2edbe4d366fcc9c340093d6daedcb08b1f62911f (diff)
tests: Sockets: adapt to have reproducible output and enable autotest
Diffstat (limited to 'tests/CommonLibs')
-rw-r--r--tests/CommonLibs/SocketsTest.cpp12
-rw-r--r--tests/CommonLibs/SocketsTest.ok1
2 files changed, 8 insertions, 5 deletions
diff --git a/tests/CommonLibs/SocketsTest.cpp b/tests/CommonLibs/SocketsTest.cpp
index 3198a5e..b51587d 100644
--- a/tests/CommonLibs/SocketsTest.cpp
+++ b/tests/CommonLibs/SocketsTest.cpp
@@ -44,7 +44,7 @@ void *testReaderIP(void *)
char buf[MAX_UDP_LENGTH];
int count = readSocket.read(buf, MAX_UDP_LENGTH);
if (count>0) {
- COUT("read: " << buf);
+ CERR("read: " << buf);
rc++;
} else {
sleep(2);
@@ -65,7 +65,7 @@ void *testReaderUnix(void *)
buf[MAX_UDP_LENGTH] = '\0';
int count = readSocket.read(buf, MAX_UDP_LENGTH);
if (count>0) {
- COUT("read: " << buf);
+ CERR("read: " << buf);
rc++;
} else {
sleep(2);
@@ -85,20 +85,22 @@ int main(int argc, char * argv[] )
UDPSocket socket1("127.0.0.1", 5061, "127.0.0.1", 5934);
UDDSocket socket1U("testSource","testDestination");
-
- COUT("socket1: " << socket1.port());
+
+ CERR("socket1: " << socket1.port());
// give the readers time to open
sleep(1);
for (int i=0; i<gNumToSend; i++) {
- socket1.write("Hello IP land");
+ socket1.write("Hello IP land");
socket1U.write("Hello Unix domain");
sleep(1);
}
readerThreadIP.join();
readerThreadUnix.join();
+
+ printf("Done\n");
}
// vim: ts=4 sw=4
diff --git a/tests/CommonLibs/SocketsTest.ok b/tests/CommonLibs/SocketsTest.ok
new file mode 100644
index 0000000..a965a70
--- /dev/null
+++ b/tests/CommonLibs/SocketsTest.ok
@@ -0,0 +1 @@
+Done