Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/owncloud/client.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Kamm <mail@ckamm.de>2018-12-21 12:35:07 +0300
committerckamm <mail@ckamm.de>2019-01-07 12:15:37 +0300
commiteeff9ccb691ac4367fd924b6ff0d6c4a10bdaf86 (patch)
tree0d61bde863bb007dffa6c8a6af9a6806a076f1c4 /test/testsyncjournaldb.cpp
parentdf1723c9b296f5446572b92887eb5bca24bb7c12 (diff)
Db: Add wiping of pin state for subtrees
Diffstat (limited to 'test/testsyncjournaldb.cpp')
-rw-r--r--test/testsyncjournaldb.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/testsyncjournaldb.cpp b/test/testsyncjournaldb.cpp
index 9e5b9a9f2..96e73c1b2 100644
--- a/test/testsyncjournaldb.cpp
+++ b/test/testsyncjournaldb.cpp
@@ -343,6 +343,14 @@ private slots:
}
return *state;
};
+ auto getRaw = [&](const QByteArray &path) -> PinState {
+ auto state = _db.rawPinStateForPath(path);
+ if (!state) {
+ QTest::qFail("couldn't read pin state", __FILE__, __LINE__);
+ return PinState::Inherited;
+ }
+ return *state;
+ };
// Make a thrice-nested setup
make("local", PinState::AlwaysLocal);
@@ -401,6 +409,14 @@ private slots:
QCOMPARE(get("online"), PinState::OnlineOnly);
QCOMPARE(get("inherit"), PinState::AlwaysLocal);
QCOMPARE(get("nonexistant"), PinState::AlwaysLocal);
+
+ // Wiping
+ QCOMPARE(getRaw("local/local"), PinState::AlwaysLocal);
+ _db.wipePinStateForPathAndBelow("local/local");
+ QCOMPARE(getRaw("local"), PinState::AlwaysLocal);
+ QCOMPARE(getRaw("local/local"), PinState::Inherited);
+ QCOMPARE(getRaw("local/local/local"), PinState::Inherited);
+ QCOMPARE(getRaw("local/local/online"), PinState::Inherited);
}
private: