Skip to content

Commit 8ec00aa

Browse files
mike0609kingmgallien
authored andcommitted
test(unifiedsearch): Restore old account state after test
Signed-off-by: Mike Mengjie Huang <[email protected]>
1 parent 3cc9dd1 commit 8ec00aa

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

test/testunifiedsearchlistmodel.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -697,6 +697,7 @@ private slots:
697697
resultClickedLocalFile.clear();
698698

699699
// Accountptr is invalid
700+
const auto prevAccountState = accountState.data();
700701
model.reset(new OCC::UnifiedSearchResultsListModel(nullptr));
701702
modelTester.reset(new QAbstractItemModelTester(model.data()));
702703
const auto providerIdTestNullptr = "file";
@@ -711,6 +712,9 @@ private slots:
711712

712713
resultClickedBrowser.clear();
713714
resultClickedLocalFile.clear();
715+
716+
model.reset(new OCC::UnifiedSearchResultsListModel(prevAccountState));
717+
modelTester.reset(new QAbstractItemModelTester(model.data()));
714718
}
715719

716720
void testSetSearchTermResultsError()

0 commit comments

Comments
 (0)