2017-07-24 14:55:51 +02:00
|
|
|
/****************************************************************************
|
|
|
|
**
|
|
|
|
** Copyright (C) 2017 The Qt Company Ltd.
|
|
|
|
** Contact: https://www.qt.io/licensing/
|
|
|
|
**
|
|
|
|
** This file is part of Qt Creator.
|
|
|
|
**
|
|
|
|
** Commercial License Usage
|
|
|
|
** Licensees holding valid commercial Qt licenses may use this file in
|
|
|
|
** accordance with the commercial license agreement provided with the
|
|
|
|
** Software or, alternatively, in accordance with the terms contained in
|
|
|
|
** a written agreement between you and The Qt Company. For licensing terms
|
|
|
|
** and conditions see https://www.qt.io/terms-conditions. For further
|
|
|
|
** information use the contact form at https://www.qt.io/contact-us.
|
|
|
|
**
|
|
|
|
** GNU General Public License Usage
|
|
|
|
** Alternatively, this file may be used under the terms of the GNU
|
|
|
|
** General Public License version 3 as published by the Free Software
|
|
|
|
** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
|
|
|
|
** included in the packaging of this file. Please review the following
|
|
|
|
** information to ensure the GNU General Public License requirements will
|
|
|
|
** be met: https://www.gnu.org/licenses/gpl-3.0.html.
|
|
|
|
**
|
|
|
|
****************************************************************************/
|
|
|
|
|
2017-09-21 11:43:59 +02:00
|
|
|
#pragma once
|
2017-07-24 14:55:51 +02:00
|
|
|
|
2017-09-21 11:43:59 +02:00
|
|
|
#include "googletest.h"
|
2017-07-24 14:55:51 +02:00
|
|
|
|
2021-03-24 18:10:55 +01:00
|
|
|
#include "sqlitedatabasemock.h"
|
2019-08-08 14:47:33 +02:00
|
|
|
|
2018-11-06 19:02:00 +01:00
|
|
|
#include <filepathstoragesources.h>
|
|
|
|
|
2017-09-21 11:43:59 +02:00
|
|
|
class MockFilePathStorage
|
2017-07-24 14:55:51 +02:00
|
|
|
{
|
2017-09-21 11:43:59 +02:00
|
|
|
public:
|
2021-03-24 18:10:55 +01:00
|
|
|
MockFilePathStorage(SqliteDatabaseMock &databaseMock)
|
|
|
|
: databaseMock{databaseMock}
|
2019-08-08 14:47:33 +02:00
|
|
|
{}
|
|
|
|
|
|
|
|
MOCK_METHOD1(fetchDirectoryId, int(Utils::SmallStringView directoryPath));
|
2017-09-21 11:43:59 +02:00
|
|
|
MOCK_METHOD2(fetchSourceId,
|
|
|
|
int (int directoryId, Utils::SmallStringView sourceName));
|
2019-08-07 18:45:55 +02:00
|
|
|
MOCK_METHOD1(fetchDirectoryIdUnguarded, int(Utils::SmallStringView directoryPath));
|
|
|
|
MOCK_METHOD2(fetchSourceIdUnguarded, int(int directoryId, Utils::SmallStringView sourceName));
|
2017-09-21 11:43:59 +02:00
|
|
|
MOCK_METHOD1(fetchDirectoryPath,
|
|
|
|
Utils::PathString (int directoryId));
|
2018-11-06 19:02:00 +01:00
|
|
|
MOCK_METHOD1(fetchSourceNameAndDirectoryId,
|
|
|
|
ClangBackEnd::Sources::SourceNameAndDirectoryId (int sourceId));
|
2019-08-06 13:12:03 +02:00
|
|
|
MOCK_METHOD0(fetchAllDirectories, std::vector<ClangBackEnd::Sources::Directory>());
|
|
|
|
MOCK_METHOD0(fetchAllSources, std::vector<ClangBackEnd::Sources::Source>());
|
2019-08-08 14:47:33 +02:00
|
|
|
|
2021-03-24 18:10:55 +01:00
|
|
|
SqliteDatabaseMock &database() { return databaseMock; }
|
2019-08-08 14:47:33 +02:00
|
|
|
|
2021-03-24 18:10:55 +01:00
|
|
|
SqliteDatabaseMock &databaseMock;
|
2017-09-21 11:43:59 +02:00
|
|
|
};
|
2017-07-24 14:55:51 +02:00
|
|
|
|