summaryrefslogtreecommitdiff
path: root/debian/patches/fix_kptyprocesstest.diff
blob: 9346b3237c25a822ee40205070e75c893641b592 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
Index: kde4libs/kpty/tests/kptyprocesstest.cpp
===================================================================
--- kde4libs.orig/kpty/tests/kptyprocesstest.cpp	2014-01-14 16:28:19.728840544 -0300
+++ kde4libs/kpty/tests/kptyprocesstest.cpp	2014-01-14 19:26:40.082679408 -0300
@@ -88,31 +88,33 @@
     }
     QCOMPARE(p.pty()->readAll(), QByteArray("hello from me\r\n"));
 
+    // echo closes stdout after echoing it's argument so this tests are bogus
     // write to the second process' pty
-    p2.pty()->write("hello from process 2\n");
-    QVERIFY(p2.pty()->waitForBytesWritten(1000));
+    //p2.pty()->write("hello from process 2\n");
+    //QVERIFY(p2.pty()->waitForBytesWritten(1000));
+
 
     // read the result back from the first process' pty
-    QVERIFY(p.pty()->waitForReadyRead(1500));
-    for (int i = 0; i < 5; ++i) {
-        if (p.pty()->canReadLine())
-            break;
-        MyQThread::msleep(500);
-    }
-    QCOMPARE(p.pty()->readAll(), QByteArray("hello from process 2\r\n"));
+    //QVERIFY(p.pty()->waitForReadyRead(1500));
+    //for (int i = 0; i < 5; ++i) {
+    //    if (p.pty()->canReadLine())
+    //        break;
+    //    MyQThread::msleep(500);
+    //}
+    //QCOMPARE(p.pty()->readAll(), QByteArray("hello from process 2\r\n"));
 
     // write to the first process' pty
-    p.pty()->write("hi from process 1\n");
-    QVERIFY(p.pty()->waitForBytesWritten(1000));
+    //p.pty()->write("hi from process 1\n");
+    //QVERIFY(p.pty()->waitForBytesWritten(1000));
 
     // read the result back from the second process' pty
-    QVERIFY(p2.pty()->waitForReadyRead(1500));
-    for (int i = 0; i < 5; ++i) {
-        if (p.pty()->canReadLine())
-            break;
-        MyQThread::msleep(500);
-    }
-    QCOMPARE(p2.pty()->readAll(), QByteArray("hi from process 1\r\n"));
+    //QVERIFY(p2.pty()->waitForReadyRead(1500));
+    //for (int i = 0; i < 5; ++i) {
+    //    if (p.pty()->canReadLine())
+    //        break;
+    //    MyQThread::msleep(500);
+    //}
+    //QCOMPARE(p2.pty()->readAll(), QByteArray("hi from process 1\r\n"));
 
     // cleanup
     p.terminate();