mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Make TestGitStorage::testGitStorageLocal parametrizable
Make use of QTest "Data Driven Testing", allowing to test multiple repo base path values. Signed-off-by: Jeremie Guichard <djebrest@gmail.com>
This commit is contained in:
parent
56d31c9c1b
commit
5640a6a839
2 changed files with 9 additions and 1 deletions
|
@ -59,13 +59,20 @@ void TestGitStorage::testSetup()
|
||||||
QCOMPARE(localCacheDirectory.removeRecursively(), true);
|
QCOMPARE(localCacheDirectory.removeRecursively(), true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void TestGitStorage::testGitStorageLocal_data()
|
||||||
|
{
|
||||||
|
// test different path we may encounter (since storage depends on user name)
|
||||||
|
QTest::addColumn<QString>("testDirName");
|
||||||
|
QTest::newRow("ASCII path") << "./gittest";
|
||||||
|
}
|
||||||
|
|
||||||
void TestGitStorage::testGitStorageLocal()
|
void TestGitStorage::testGitStorageLocal()
|
||||||
{
|
{
|
||||||
// test writing and reading back from local git storage
|
// test writing and reading back from local git storage
|
||||||
git_repository *repo;
|
git_repository *repo;
|
||||||
git_libgit2_init();
|
git_libgit2_init();
|
||||||
QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/SampleDivesV2.ssrf"), 0);
|
QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/SampleDivesV2.ssrf"), 0);
|
||||||
QString testDirName("./gittest");
|
QFETCH(QString, testDirName);
|
||||||
QDir testDir(testDirName);
|
QDir testDir(testDirName);
|
||||||
QCOMPARE(testDir.removeRecursively(), true);
|
QCOMPARE(testDir.removeRecursively(), true);
|
||||||
QCOMPARE(QDir().mkdir(testDirName), true);
|
QCOMPARE(QDir().mkdir(testDirName), true);
|
||||||
|
|
|
@ -8,6 +8,7 @@ class TestGitStorage : public QObject
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
private slots:
|
private slots:
|
||||||
void testSetup();
|
void testSetup();
|
||||||
|
void testGitStorageLocal_data();
|
||||||
void testGitStorageLocal();
|
void testGitStorageLocal();
|
||||||
void testGitStorageCloud();
|
void testGitStorageCloud();
|
||||||
void testGitStorageCloudOfflineSync();
|
void testGitStorageCloudOfflineSync();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue