|
|
|
@ -11,47 +11,44 @@ |
|
|
|
|
|
|
|
|
|
|
|
// Konsole
|
|
|
|
// Konsole
|
|
|
|
#include "../Emulation.h" |
|
|
|
#include "../Emulation.h" |
|
|
|
#include "../history/HistoryScrollFile.h" |
|
|
|
|
|
|
|
#include "../history/HistoryScrollNone.h" |
|
|
|
|
|
|
|
#include "../history/HistoryTypeFile.h" |
|
|
|
|
|
|
|
#include "../history/HistoryTypeNone.h" |
|
|
|
|
|
|
|
#include "../history/compact/CompactHistoryScroll.h" |
|
|
|
|
|
|
|
#include "../history/compact/CompactHistoryType.h" |
|
|
|
|
|
|
|
#include "../session/Session.h" |
|
|
|
#include "../session/Session.h" |
|
|
|
|
|
|
|
|
|
|
|
using namespace Konsole; |
|
|
|
using namespace Konsole; |
|
|
|
|
|
|
|
|
|
|
|
void HistoryTest::testHistoryNone() |
|
|
|
void HistoryTest::initTestCase() |
|
|
|
{ |
|
|
|
{ |
|
|
|
HistoryType *history; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
history = new HistoryTypeNone(); |
|
|
|
void HistoryTest::cleanupTestCase() |
|
|
|
QCOMPARE(history->isEnabled(), false); |
|
|
|
{ |
|
|
|
QCOMPARE(history->isUnlimited(), false); |
|
|
|
delete[] testImage; |
|
|
|
QCOMPARE(history->maximumLineCount(), 0); |
|
|
|
delete historyTypeNone; |
|
|
|
delete history; |
|
|
|
delete historyTypeFile; |
|
|
|
|
|
|
|
delete historyTypeCompact; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void HistoryTest::testHistoryFile() |
|
|
|
void HistoryTest::testHistoryNone() |
|
|
|
{ |
|
|
|
{ |
|
|
|
HistoryType *history; |
|
|
|
historyTypeNone = new HistoryTypeNone(); |
|
|
|
|
|
|
|
QCOMPARE(historyTypeNone->isEnabled(), false); |
|
|
|
|
|
|
|
QCOMPARE(historyTypeNone->isUnlimited(), false); |
|
|
|
|
|
|
|
QCOMPARE(historyTypeNone->maximumLineCount(), 0); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
history = new HistoryTypeFile(); |
|
|
|
void HistoryTest::testHistoryFile() |
|
|
|
QCOMPARE(history->isEnabled(), true); |
|
|
|
{ |
|
|
|
QCOMPARE(history->isUnlimited(), true); |
|
|
|
historyTypeFile = new HistoryTypeFile(); |
|
|
|
QCOMPARE(history->maximumLineCount(), -1); |
|
|
|
QCOMPARE(historyTypeFile->isEnabled(), true); |
|
|
|
delete history; |
|
|
|
QCOMPARE(historyTypeFile->isUnlimited(), true); |
|
|
|
|
|
|
|
QCOMPARE(historyTypeFile->maximumLineCount(), -1); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void HistoryTest::testCompactHistory() |
|
|
|
void HistoryTest::testCompactHistory() |
|
|
|
{ |
|
|
|
{ |
|
|
|
HistoryType *history; |
|
|
|
historyTypeCompact = new CompactHistoryType(42); |
|
|
|
|
|
|
|
QCOMPARE(historyTypeCompact->isEnabled(), true); |
|
|
|
history = new CompactHistoryType(42); |
|
|
|
QCOMPARE(historyTypeCompact->isUnlimited(), false); |
|
|
|
QCOMPARE(history->isEnabled(), true); |
|
|
|
QCOMPARE(historyTypeCompact->maximumLineCount(), 42); |
|
|
|
QCOMPARE(history->isUnlimited(), false); |
|
|
|
|
|
|
|
QCOMPARE(history->maximumLineCount(), 42); |
|
|
|
|
|
|
|
delete history; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void HistoryTest::testEmulationHistory() |
|
|
|
void HistoryTest::testEmulationHistory() |
|
|
|
@ -128,10 +125,7 @@ void HistoryTest::testHistoryScroll() |
|
|
|
|
|
|
|
|
|
|
|
void HistoryTest::testHistoryReflow() |
|
|
|
void HistoryTest::testHistoryReflow() |
|
|
|
{ |
|
|
|
{ |
|
|
|
const char testString[] = "abcdefghijklmnopqrstuvwxyz1234567890"; |
|
|
|
testImage = new Character[testStringSize]; |
|
|
|
const int testStringSize = sizeof(testString) / sizeof(char) - 1; |
|
|
|
|
|
|
|
// testImage leaks on any failure
|
|
|
|
|
|
|
|
auto testImage = new Character[testStringSize]; |
|
|
|
|
|
|
|
Character testChar; |
|
|
|
Character testChar; |
|
|
|
for (int i = 0; i < testStringSize; i++) { |
|
|
|
for (int i = 0; i < testStringSize; i++) { |
|
|
|
testImage[i] = Character((uint)testString[i]); |
|
|
|
testImage[i] = Character((uint)testString[i]); |
|
|
|
@ -182,7 +176,6 @@ void HistoryTest::testHistoryReflow() |
|
|
|
historyScrollFile->getCells(testStringSize - 1, 0, 1, &testChar); |
|
|
|
historyScrollFile->getCells(testStringSize - 1, 0, 1, &testChar); |
|
|
|
QCOMPARE(testChar, testImage[testStringSize - 1]); |
|
|
|
QCOMPARE(testChar, testImage[testStringSize - 1]); |
|
|
|
|
|
|
|
|
|
|
|
delete[] testImage; |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void HistoryTest::testHistoryTypeChange() |
|
|
|
void HistoryTest::testHistoryTypeChange() |
|
|
|
|