From 0576870ebdbe813b5a084e1a279cb77077e6373e Mon Sep 17 00:00:00 2001 From: aqua Date: Tue, 13 Sep 2022 10:08:28 +0300 Subject: Rename BookmarkModel to BookmarksTreeModel - remove BookmarkManager - remove BookmarkOwner --- src/bookmarks/test/bookmarkmanager.cpp | 21 --------------------- src/bookmarks/test/test_bookmarkstreemodel.cpp | 25 +++++++++++++++++++++++++ 2 files changed, 25 insertions(+), 21 deletions(-) delete mode 100644 src/bookmarks/test/bookmarkmanager.cpp create mode 100644 src/bookmarks/test/test_bookmarkstreemodel.cpp (limited to 'src/bookmarks/test') diff --git a/src/bookmarks/test/bookmarkmanager.cpp b/src/bookmarks/test/bookmarkmanager.cpp deleted file mode 100644 index 5bfaf649..00000000 --- a/src/bookmarks/test/bookmarkmanager.cpp +++ /dev/null @@ -1,21 +0,0 @@ -#include "../bookmarkmanager.hpp" -#include -#include - -// clazy:excludeall=non-pod-global-static - -namespace { -TEST(BookmarkManager, QStandardPaths) -{ - const auto file = QStandardPaths::locate(QStandardPaths::AppLocalDataLocation, QString::fromLatin1("bookmarks.xbel")); - EXPECT_TRUE(file.isEmpty()) << qUtf8Printable(file); -} - -TEST(BookmarkManager, Manager) -{ - BookmarkManager manager("bookmarks.xbel"); - - const auto load_errors = manager.errors(); - EXPECT_EQ(load_errors.length(), 0) << qUtf8Printable(load_errors.join('\n')); -} -} // namespace \ No newline at end of file diff --git a/src/bookmarks/test/test_bookmarkstreemodel.cpp b/src/bookmarks/test/test_bookmarkstreemodel.cpp new file mode 100644 index 00000000..febd4cd4 --- /dev/null +++ b/src/bookmarks/test/test_bookmarkstreemodel.cpp @@ -0,0 +1,25 @@ +#include +#include +#include + +#include "../bookmarkstreemodel.hpp" + +// clazy:excludeall=non-pod-global-static + +namespace { +TEST(bookmarks, QStandardPaths) +{ + const auto file = QStandardPaths::locate(QStandardPaths::AppLocalDataLocation, QString::fromLatin1("bookmarks.xbel")); + EXPECT_TRUE(file.isEmpty()) << qUtf8Printable(file); +} + +TEST(bookmarks, BookmarksTreeModel) +{ + BookmarksTreeModel model; + QFile f("bookmarks.xbel"); + ASSERT_TRUE(f.open(QIODevice::ReadOnly | QIODevice::Text)); + + EXPECT_TRUE(model.load(&f).isEmpty()); + f.close(); +} +} // namespace -- cgit v1.2.1