forked from qt-creator/qt-creator
Unittest: Fix crash in Linux
Change-Id: I1e8dc10bd9f0f9d11b0f18716e284ffadef7c6c5 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -65,6 +65,12 @@ class StringCache : public testing::Test
|
||||
protected:
|
||||
void SetUp()
|
||||
{
|
||||
mockStorageFetchDirectyId = [&](Utils::SmallStringView string) {
|
||||
return mockStorage.fetchDirectoryId(string);
|
||||
};
|
||||
mockStorageFetchDirectyPath = [&](int id) {
|
||||
return mockStorage.fetchDirectoryPath(id);
|
||||
};
|
||||
std::sort(filePaths.begin(), filePaths.end(), [](auto &f, auto &l) {
|
||||
return compare(f, l) < 0;
|
||||
});
|
||||
@@ -82,12 +88,8 @@ protected:
|
||||
protected:
|
||||
NiceMock<MockSqliteDatabase> mockDatabase;
|
||||
NiceMock<MockFilePathStorage> mockStorage{mockDatabase};
|
||||
StorageIdFunction mockStorageFetchDirectyId = [&](Utils::SmallStringView string) {
|
||||
return mockStorage.fetchDirectoryId(string);
|
||||
};
|
||||
StorageStringFunction mockStorageFetchDirectyPath = [&](int id) {
|
||||
return mockStorage.fetchDirectoryPath(id);
|
||||
};
|
||||
StorageIdFunction mockStorageFetchDirectyId;
|
||||
StorageStringFunction mockStorageFetchDirectyPath;
|
||||
Cache cache;
|
||||
typename Cache::MutexType &mockMutex = cache.mutex();
|
||||
Utils::PathString filePath1{"/file/pathOne"};
|
||||
|
Reference in New Issue
Block a user