Git commit 0898f61d491cf391ecc805c9569ee430b6ac6b2f by Kurt Hindenburg. Committed on 31/08/2013 at 23:15. Pushed by hindenburg into branch 'master'. Add testTerminal - just scrollBarPosition for now M +3 -0 src/tests/CMakeLists.txt A +49 -0 src/tests/TerminalTest.cpp [License: GPL (v2+)] A +41 -0 src/tests/TerminalTest.h [License: GPL (v2+)] http://commits.kde.org/konsole/0898f61d491cf391ecc805c9569ee430b6ac6b2f diff --git a/src/tests/CMakeLists.txt b/src/tests/CMakeLists.txt index 8e68e3d..86d60f0 100644 --- a/src/tests/CMakeLists.txt +++ b/src/tests/CMakeLists.txt @@ -18,6 +18,9 @@ target_link_libraries(PartTest ${KDE4_KPARTS_LIBS} ${KDE4_KPTY_LIBS} ${KONSOLE_TEST_LIBS}) = +kde4_add_unit_test(TerminalTest TerminalTest.cpp) +target_link_libraries(TerminalTest ${KONSOLE_TEST_LIBS}) + kde4_add_unit_test(PtyTest PtyTest.cpp) target_link_libraries(PtyTest ${KDE4_KPTY_LIBS} ${KONSOLE_TEST_LIBS}) = diff --git a/src/tests/TerminalTest.cpp b/src/tests/TerminalTest.cpp new file mode 100644 index 0000000..202b7cd --- /dev/null +++ b/src/tests/TerminalTest.cpp @@ -0,0 +1,49 @@ +/* + Copyright 2013 by Kurt Hindenburg + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. +*/ + +// Own +#include "TerminalTest.h" + +#include "qtest_kde.h" + +// Konsole +#include "../TerminalDisplay.h" + +using namespace Konsole; + +void TerminalTest::testScrollBarPositions() +{ + + TerminalDisplay* display =3D new TerminalDisplay(0); + + // ScrollBar Positions + display->setScrollBarPosition(Enum::ScrollBarLeft); + QCOMPARE(Enum::ScrollBarLeft, display->scrollBarPosition()); + display->setScrollBarPosition(Enum::ScrollBarRight); + QCOMPARE(Enum::ScrollBarRight, display->scrollBarPosition()); + display->setScrollBarPosition(Enum::ScrollBarHidden); + QCOMPARE(Enum::ScrollBarHidden, display->scrollBarPosition()); + + delete display; +} + +QTEST_KDEMAIN(TerminalTest , GUI) + +#include "TerminalTest.moc" + diff --git a/src/tests/TerminalTest.h b/src/tests/TerminalTest.h new file mode 100644 index 0000000..302363b --- /dev/null +++ b/src/tests/TerminalTest.h @@ -0,0 +1,41 @@ +/* + Copyright 2013 by Kurt Hindenburg + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + 02110-1301 USA. +*/ + +#ifndef TERMINALTEST_H +#define TERMINALTEST_H + +#include + +namespace Konsole +{ + +class TerminalTest : public QObject +{ + Q_OBJECT + +private slots: + void testScrollBarPositions(); + +private: +}; + +} + +#endif // TERMINALTEST_H +