on xenial help sign in
Make tests not crash and pass :)
40e762bAlbert Astals
tests/mocks/Unity/fake_scopes.cpp+1
@@ -72,6 +72,7 @@ void Scopes::clear()
72 endRemoveRows();
72 endRemoveRows();
73 }
73 }
74 delete m_scopesOverview;
74 delete m_scopesOverview;
75+ m_scopesOverview = nullptr;
75
76
76 if (m_loaded) {
77 if (m_loaded) {
77 m_loaded = false;
78 m_loaded = false;
tests/qmltests/Dash/tst_Dash.qml+1−1
@@ -86,7 +86,7 @@ Item {
86 tryCompare(dashContentList, "count", 0);
86 tryCompare(dashContentList, "count", 0);
87 scopes.load();
87 scopes.load();
88 tryCompare(scopes, "loaded", true);
88 tryCompare(scopes, "loaded", true);
89− tryCompare(dashContentList, "count", 3);
89+ tryCompare(dashContentList, "count", 6);
90
90
91 verify(dashContentList != undefined);
91 verify(dashContentList != undefined);
92 tryCompare(dashContentList, "currentIndex", data.visualIndex);
92 tryCompare(dashContentList, "currentIndex", data.visualIndex);
tests/qmltests/Dash/tst_DashContent.qml+4−3
@@ -68,7 +68,7 @@ Item {
68 function loadScopes() {
68 function loadScopes() {
69 scopeLoadedSpy.clear();
69 scopeLoadedSpy.clear();
70 scopesModel.load();
70 scopesModel.load();
71− tryCompare(scopeLoadedSpy, "count", 4);
71+ tryCompare(scopeLoadedSpy, "count", 10);
72 }
72 }
73
73
74 function init() {
74 function init() {
@@ -111,7 +111,8 @@ Item {
111
111
112 loadScopes();
112 loadScopes();
113
113
114+ compare(dashContentList.count, 10);
114− verify(dashContentList.currentIndex >= 0 && dashContentList.currentIndex < 5);
115+ verify(dashContentList.currentIndex >= 0 && dashContentList.currentIndex < dashContentList.count);
115 }
116 }
116
117
117 function test_show_header_on_list_movement() {
118 function test_show_header_on_list_movement() {
@@ -164,7 +165,7 @@ Item {
164
165
165 // test greater than scope count.
166 // test greater than scope count.
166 var currentScopeIndex = dashContent.currentIndex;
167 var currentScopeIndex = dashContent.currentIndex;
167− dashContent.setCurrentScopeAtIndex(8, true, false);
168+ dashContent.setCurrentScopeAtIndex(18, true, false);
168 compare(dashContent.currentIndex, currentScopeIndex, "Scope should not change if changing to greater index than count");
169 compare(dashContent.currentIndex, currentScopeIndex, "Scope should not change if changing to greater index than count");
169 }
170 }
170
171