diff options
author | 2024-07-14 19:49:32 +0200 | |
---|---|---|
committer | 2024-11-22 20:48:29 +0300 | |
commit | e976e347efe94af2aaf131aeda7bde211e5eddf9 (patch) | |
tree | 74e235bdf028232a86f5e5474922cf248c7bb282 /test/rssparser.cpp | |
parent | d91fce43ad720ff0a690d0cdbedd99f756030793 (diff) | |
download | newsboat-e976e347efe94af2aaf131aeda7bde211e5eddf9.tar.gz newsboat-e976e347efe94af2aaf131aeda7bde211e5eddf9.tar.zst newsboat-e976e347efe94af2aaf131aeda7bde211e5eddf9.zip |
Create separate method for creating cache in-memory
Diffstat (limited to 'test/rssparser.cpp')
-rw-r--r-- | test/rssparser.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/test/rssparser.cpp b/test/rssparser.cpp index ca68518b..418586f2 100644 --- a/test/rssparser.cpp +++ b/test/rssparser.cpp @@ -1,5 +1,3 @@ -#define ENABLE_IMPLICIT_FILEPATH_CONVERSIONS - #include "rssparser.h" #include "3rd-party/catch.hpp" @@ -15,9 +13,9 @@ using namespace newsboat; TEST_CASE("parse() ignores uninitialized upstream feed", "[RssParser]") { ConfigContainer cfg; - Cache rsscache(":memory:", cfg); + auto rsscache = Cache::in_memory(cfg); RssIgnores ignores; - RssParser parser("http://example.com", rsscache, cfg, &ignores); + RssParser parser("http://example.com", *rsscache, cfg, &ignores); rsspp::Feed upstream_feed; const auto feed = parser.parse(upstream_feed); @@ -28,9 +26,9 @@ TEST_CASE("parse() with no item GUID falls back to link+pubdate, link, and title "[RssParser]") { ConfigContainer cfg; - Cache rsscache(":memory:", cfg); + auto rsscache = Cache::in_memory(cfg); RssIgnores ignores; - RssParser parser("http://example.com", rsscache, cfg, &ignores); + RssParser parser("http://example.com", *rsscache, cfg, &ignores); rsspp::Feed upstream_feed; upstream_feed.rss_version = rsspp::Feed::ATOM_1_0; @@ -83,9 +81,9 @@ TEST_CASE("parse() renders html titles into plaintext if type indicates html", "[RssParser]") { ConfigContainer cfg; - Cache rsscache(":memory:", cfg); + auto rsscache = Cache::in_memory(cfg); RssIgnores ignores; - RssParser parser("http://example.com", rsscache, cfg, &ignores); + RssParser parser("http://example.com", *rsscache, cfg, &ignores); rsspp::Feed upstream_feed; upstream_feed.rss_version = rsspp::Feed::ATOM_1_0; @@ -128,9 +126,9 @@ TEST_CASE("parse() generates a title when title element is missing", "[RssParser]") { ConfigContainer cfg; - Cache rsscache(":memory:", cfg); + auto rsscache = Cache::in_memory(cfg); RssIgnores ignores; - RssParser parser("http://example.com", rsscache, cfg, &ignores); + RssParser parser("http://example.com", *rsscache, cfg, &ignores); rsspp::Feed upstream_feed; upstream_feed.rss_version = rsspp::Feed::ATOM_1_0; @@ -167,9 +165,9 @@ TEST_CASE("parse() generates a title when title element is missing", TEST_CASE("parse() extracts best enclosure", "[RssParser]") { ConfigContainer cfg; - Cache rsscache(":memory:", cfg); + auto rsscache = Cache::in_memory(cfg); RssIgnores ignores; - RssParser parser("http://example.com", rsscache, cfg, &ignores); + RssParser parser("http://example.com", *rsscache, cfg, &ignores); rsspp::Feed upstream_feed; upstream_feed.rss_version = rsspp::Feed::ATOM_1_0; |