summaryrefslogtreecommitdiffstats
path: root/tests/testgitstorage.cpp
diff options
context:
space:
mode:
authorGravatar Jeremie Guichard <djebrest@gmail.com>2017-02-24 14:02:32 +0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-02-24 01:10:22 -0800
commit5640a6a83951faefda0f22594044a34cb385e9fd (patch)
tree3ae8a157a077c43b42678a31d4787b52b40140c7 /tests/testgitstorage.cpp
parent56d31c9c1b042997a9c91ef03dd606b4d3ca905a (diff)
downloadsubsurface-5640a6a83951faefda0f22594044a34cb385e9fd.tar.gz
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>
Diffstat (limited to 'tests/testgitstorage.cpp')
-rw-r--r--tests/testgitstorage.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/testgitstorage.cpp b/tests/testgitstorage.cpp
index 1fd2ffcba..080ba49c3 100644
--- a/tests/testgitstorage.cpp
+++ b/tests/testgitstorage.cpp
@@ -59,13 +59,20 @@ void TestGitStorage::testSetup()
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()
{
// test writing and reading back from local git storage
git_repository *repo;
git_libgit2_init();
QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/SampleDivesV2.ssrf"), 0);
- QString testDirName("./gittest");
+ QFETCH(QString, testDirName);
QDir testDir(testDirName);
QCOMPARE(testDir.removeRecursively(), true);
QCOMPARE(QDir().mkdir(testDirName), true);