Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Tobias Hunger
qt-creator
Commits
190fdf36
Commit
190fdf36
authored
Jun 10, 2010
by
Kai Koehne
Browse files
QmlDesigner: Add test case for Rewriter not removing Ids form model
Task-number: BAUHAUS-780
parent
ef48306b
Changes
2
Hide whitespace changes
Inline
Side-by-side
tests/auto/qml/qmldesigner/coretests/testcore.cpp
View file @
190fdf36
...
...
@@ -5426,6 +5426,39 @@ void TestCore::testRewriterChangeId()
node
.
setId
(
"myId"
);
}
void
TestCore
::
testRewriterRemoveId
()
{
const
char
*
qmlString
=
"import Qt 4.7
\n
Rectangle { id: rect }"
;
QPlainTextEdit
textEdit
;
textEdit
.
setPlainText
(
qmlString
);
NotIndentingTextEditModifier
textModifier
(
&
textEdit
);
QScopedPointer
<
Model
>
model
(
Model
::
create
(
"Qt/Item"
));
QVERIFY
(
model
.
data
());
QScopedPointer
<
TestView
>
view
(
new
TestView
);
QVERIFY
(
view
.
data
());
model
->
attachView
(
view
.
data
());
QScopedPointer
<
TestRewriterView
>
testRewriterView
(
new
TestRewriterView
());
testRewriterView
->
setTextModifier
(
&
textModifier
);
model
->
attachView
(
testRewriterView
.
data
());
ModelNode
rootModelNode
(
view
->
rootModelNode
());
QVERIFY
(
rootModelNode
.
isValid
());
QCOMPARE
(
rootModelNode
.
id
(),
QString
(
"rect"
));
QSKIP
(
"Fix me!!!! Task BAUHAUS-780"
,
SkipAll
);
//
// remove id in text
//
const
char
*
qmlString2
=
"import Qt 4.7
\n
Rectangle { }"
;
textEdit
.
setPlainText
(
qmlString2
);
QCOMPARE
(
rootModelNode
.
id
(),
QString
());
}
void
TestCore
::
testRewriterChangeValueProperty
()
{
const
char
*
qmlString
=
"import Qt 4.7
\n
Rectangle { x: 10; y: 10 }"
;
...
...
tests/auto/qml/qmldesigner/coretests/testcore.h
View file @
190fdf36
...
...
@@ -87,6 +87,7 @@ private slots:
void
testRewriterView
();
void
testRewriterErrors
();
void
testRewriterChangeId
();
void
testRewriterRemoveId
();
void
testRewriterChangeValueProperty
();
void
testRewriterRemoveValueProperty
();
void
testRewriterSignalProperty
();
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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