2
Copyright 2008 by Robert Knight <robertknight@gmail.com>
4
This program is free software; you can redistribute it and/or modify
5
it under the terms of the GNU General Public License as published by
6
the Free Software Foundation; either version 2 of the License, or
7
(at your option) any later version.
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU General Public License for more details.
14
You should have received a copy of the GNU General Public License
15
along with this program; if not, write to the Free Software
16
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
24
#include <QtCore/QSize>
25
#include <QtCore/QStringList>
28
#include <qtest_kde.h>
30
using namespace Konsole;
36
void PtyTest::cleanup()
40
void PtyTest::testFlowControl()
43
const bool input = true;
44
pty.setFlowControlEnabled(input);
45
const bool output = pty.flowControlEnabled();
46
QCOMPARE(output, input);
49
void PtyTest::testEraseChar()
52
const char input = 'x';
53
pty.setEraseChar(input);
54
const char output = pty.eraseChar();
55
QCOMPARE(output, input);
58
void PtyTest::testUseUtmp()
61
const bool input = true;
62
pty.setUseUtmp(input);
63
const bool output = pty.isUseUtmp();
64
QCOMPARE(output, input);
67
void PtyTest::testWindowSize()
71
pty.setWindowSize(input.width(), input.height());
72
QSize output = pty.windowSize();
73
QCOMPARE(output, input);
76
void PtyTest::testRunProgram()
79
QString program = "sh";
80
QStringList arguments ;
82
QStringList environments;
83
const int result = pty.start(program, arguments, environments);
87
// since there is no other processes using this pty, the two methods
88
// should return the same pid.
89
QCOMPARE(pty.foregroundProcessGroup(), pty.pid());
92
QTEST_KDEMAIN_CORE(PtyTest)
94
#include "PtyTest.moc"