Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
Plasma Workspace
Commits
efdcea70
Verified
Commit
efdcea70
authored
Jan 19, 2022
by
Eugene Popov
🇺🇦
Committed by
Fushan Wen
Mar 29, 2022
Browse files
Revert "klipper: Add `testTrimmedText`"
This reverts commit
fc888e5d
.
parent
00710125
Changes
1
Hide whitespace changes
Inline
Side-by-side
klipper/autotests/historymodeltest.cpp
View file @
efdcea70
...
...
@@ -22,11 +22,6 @@ private Q_SLOTS:
void
testIndexOf
();
void
testType_data
();
void
testType
();
/**
* Test if the text is correctly trimmed, and can still provide the full text.
*/
void
testTrimmedText
();
};
void
HistoryModelTest
::
testSetMaxSize
()
...
...
@@ -237,26 +232,5 @@ void HistoryModelTest::testType()
QCOMPARE
(
history
->
index
(
0
).
data
(
HistoryModel
::
TypeRole
).
value
<
HistoryItemType
>
(),
expectedType
);
}
void
HistoryModelTest
::
testTrimmedText
()
{
QScopedPointer
<
HistoryModel
>
history
(
new
HistoryModel
(
nullptr
));
QScopedPointer
<
QAbstractItemModelTester
>
modelTest
(
new
QAbstractItemModelTester
(
history
.
data
()));
history
->
setMaxSize
(
10
);
QCOMPARE
(
history
->
rowCount
(),
0
);
// insert one item with a very long text
QString
veryLongText
;
for
(
int
i
=
0
;
i
<
500
;
i
++
)
{
veryLongText
.
append
(
QStringLiteral
(
"a"
));
// Text length is 500
}
history
->
insert
(
QSharedPointer
<
HistoryItem
>
(
new
HistoryStringItem
(
veryLongText
)));
const
QModelIndex
index
=
history
->
index
(
0
,
0
);
// Test full text
QCOMPARE
(
index
.
data
(
HistoryModel
::
FullTextRole
).
value
<
QString
>
(),
veryLongText
);
// Test trimmed text, 200 is from HistoryStringItem::text()
QCOMPARE
(
index
.
data
(
Qt
::
DisplayRole
).
value
<
QString
>
(),
veryLongText
.
left
(
200
-
1
)
+
QStringLiteral
(
"…"
));
}
QTEST_MAIN
(
HistoryModelTest
)
#include "historymodeltest.moc"
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment