tests/auto/qlocalsocket/lackey/scripts/server.js
changeset 0 1918ee327afb
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/auto/qlocalsocket/lackey/scripts/server.js	Mon Jan 11 14:00:40 2010 +0000
@@ -0,0 +1,19 @@
+#/bin/qscript
+function QVERIFY(x, server) {
+    if (!(x)) {
+        throw(server.errorString());
+    }
+}
+var server = new QScriptLocalServer;
+QVERIFY(server.listen("qlocalsocket_autotest"), server);
+var done = args[1];
+var testLine = "test";
+while (done > 0) {
+    QVERIFY(server.waitForNewConnection(), server);
+    var serverSocket = server.nextConnection();
+    serverSocket.write(testLine);
+    QVERIFY(serverSocket.waitForBytesWritten(), serverSocket);
+    QVERIFY(serverSocket.errorString() == ""
+            ||serverSocket.errorString() == "Unknown error", serverSocket);
+    --done;
+}