First implementation of socket stream classes derived
[sockstream.git] / test / stream
diff --git a/test/stream b/test/stream
new file mode 100755 (executable)
index 0000000..261d184
--- /dev/null
@@ -0,0 +1,36 @@
+#!/bin/bash
+#
+#   Test script for socket stream classes.
+#   Use a few test programs to test stream communication
+#   through sockets.
+#
+
+TESTSTRING="this is a test"
+
+#
+# Test the iscokstream class
+#
+
+echo $TESTSTRING|nc -l 1234 &
+OUT=$(./intest)
+if [ "$OUT" = "$TESTSTRING" ]
+then
+   echo "  isockstream OK."
+else
+   echo "  isockstream Fail."
+fi
+
+#
+# Test the oscokstream class
+#
+
+nc -l 1234 >stream.out&
+echo $TESTSTRING |./outtest
+read OUT <stream.out
+rm stream.out
+if [ "$OUT" = "$TESTSTRING" ]
+then
+   echo "  osockstream OK."
+else
+   echo "  osockstream Fail."
+fi