Skip to content

Commit af60b54

Browse files
committed
b-169 tests for reset
1 parent 2d51803 commit af60b54

File tree

4 files changed

+33
-2
lines changed

4 files changed

+33
-2
lines changed

src/applicationdata.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -501,7 +501,6 @@ void ApplicationData::resetBehaviorData()
501501
Config::saveBool(Config::KEY_ELEMENT_EDIT_SHORTCUT_USED, false);
502502
Config::saveBool(Config::KEY_ELEMENT_EDIT_MODEFORM_MODIFIED, false);
503503
Config::saveBool(Config::KEY_ELEMENT_EDIT_TYPE_DIALOG_SHOWN, false);
504-
Utils::TEST_ME("");
505504
_elementDoubleClickedInSessionCount = 0 ;
506505
_elementEditedAsTextCount = 0 ;
507506
_elementEditedAsFormCount = 0 ;

test/testconfig.cpp

+27-1
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ TestConfig::~TestConfig()
3131
{
3232
}
3333

34+
bool TestConfig::testFast()
35+
{
36+
return testResetBeahviorData();
37+
}
38+
3439
bool TestConfig::testUnit()
3540
{
3641
_testName = "testUnit" ;
@@ -174,6 +179,11 @@ bool TestConfig::testResetBeahviorData()
174179
Config::saveBool(Config::KEY_ELEMENT_EDIT_SHORTCUT_USED, true);
175180
Config::saveBool(Config::KEY_ELEMENT_EDIT_MODEFORM_MODIFIED, true);
176181
Config::saveBool(Config::KEY_ELEMENT_EDIT_TYPE_DIALOG_SHOWN, true);
182+
Config::saveBool(Config::KEY_USERPROFILING_GUIDED, true);
183+
Config::saveBool(Config::KEY_USERPROFILING_FIRSTUSE, false);
184+
app.data()->incrementElementDoubleClickedCount();
185+
app.data()->setElementEditedAsTextCount(1);
186+
app.data()->setElementEditedAsFormCount(1);
177187

178188
app.data()->resetBehaviorData();
179189
if(!checkBoolSetting(Config::KEY_ELEMENT_EDIT_SHORTCUT_DIALOG_SHOWN, false) ) {
@@ -188,6 +198,22 @@ bool TestConfig::testResetBeahviorData()
188198
if(!checkBoolSetting(Config::KEY_ELEMENT_EDIT_TYPE_DIALOG_SHOWN, false) ) {
189199
return false;
190200
}
201+
if(!checkBoolSetting(Config::KEY_USERPROFILING_GUIDED, false) ) {
202+
return false;
203+
}
204+
if(!checkBoolSetting(Config::KEY_USERPROFILING_FIRSTUSE, true) ) {
205+
return false;
206+
}
207+
if(app.data()->getElementDoubleClickedInSessionCount()!=0) {
208+
return error(QString("_elementDoubleClickedInSessionCount %1").arg(app.data()->getElementDoubleClickedInSessionCount()));
209+
}
210+
if(app.data()->getElementEditedAsTextCount()!=0) {
211+
return error(QString("_elementEditedAsTextCount %1").arg(app.data()->getElementEditedAsTextCount()));
212+
}
213+
if(app.data()->getElementEditedAsFormCount()!=0) {
214+
return error(QString("_elementEditedAsFormCount %1").arg(app.data()->getElementEditedAsFormCount()));
215+
}
216+
191217
return true;
192218
}
193219

@@ -312,6 +338,6 @@ bool TestConfig::testResetData()
312338
if(!testOpenChooseEditTypeDialog()) {
313339
return false;
314340
}
315-
return error("nyi");
341+
return true;
316342
}
317343

test/testconfig.h

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ class TestConfig : public TestBase
4545
~TestConfig();
4646

4747
bool testUnit();
48+
bool testFast();
4849
};
4950

5051
#endif // TESTCONFIG_H

test/tst_qxmledit.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -1397,6 +1397,11 @@ void TestQXmlEdit::testConfig()
13971397
{
13981398
bool result ;
13991399

1400+
{
1401+
TestConfig test1;
1402+
result = test1.testFast();
1403+
QVERIFY2(result, (QString("test TestConfig: testFast '%1'").arg(test1.errorString())).toLatin1().data());
1404+
}
14001405
{
14011406
TestConfig test1;
14021407
result = test1.testUnit();

0 commit comments

Comments
 (0)