38be0d1383
This is the beginning of revision history for this module. If you want to look at revision history older than this, please refer to the Qt Git wiki for how to use Git history grafting. At the time of writing, this wiki is located here: http://qt.gitorious.org/qt/pages/GitIntroductionWithQt If you have already performed the grafting and you don't see any history beyond this commit, try running "git log" with the "--follow" argument. Branched from the monolithic repo, Qt master branch, at commit 896db169ea224deb96c59ce8af800d019de63f12
36 lines
1.1 KiB
JavaScript
Executable File
36 lines
1.1 KiB
JavaScript
Executable File
#/bin/qscript
|
|
function QVERIFY(x, socket) {
|
|
if (!(x)) {
|
|
throw(socket.errorString());
|
|
}
|
|
}
|
|
|
|
var socket = new QScriptLocalSocket;
|
|
var tries = 0;
|
|
do {
|
|
socket.serverName = "qlocalsocket_autotest";
|
|
if ((socket.errorString() != "QLocalSocket::connectToServer: Invalid name")
|
|
&& (socket.errorString() != "QLocalSocket::connectToServer: Connection refused"))
|
|
break;
|
|
socket.sleep(1);
|
|
++tries;
|
|
print("isConnected:", socket.isConnected());
|
|
} while ((socket.errorString() == "QLocalSocket::connectToServer: Invalid name"
|
|
|| (socket.errorString() == "QlocalSocket::connectToServer: Connection refused"))
|
|
&& tries < 5000);
|
|
if (tries == 5000) {
|
|
print("too many tries, exiting");
|
|
} else {
|
|
socket.waitForConnected();
|
|
//print("isConnected:", socket.isConnected());
|
|
if (!socket.isConnected())
|
|
print("Not Connected:", socket.errorString());
|
|
socket.waitForReadyRead();
|
|
var text = socket.readLine();
|
|
var testLine = "test";
|
|
QVERIFY((text == testLine), socket);
|
|
QVERIFY((socket.errorString() == "Unknown error"), socket);
|
|
socket.close();
|
|
//print("client: exiting", text);
|
|
}
|