From f788e4c403a48768862960ba9ae9de7fb74099e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6ren=20Tempel?= Date: Sat, 25 Dec 2021 11:58:00 +0100 Subject: [PATCH] community/snapcast: fix test failure See https://github.com/badaix/snapcast/issues/961 --- community/snapcast/APKBUILD | 3 ++ community/snapcast/fix-tests.patch | 74 ++++++++++++++++++++++++++++++ 2 files changed, 77 insertions(+) create mode 100644 community/snapcast/fix-tests.patch diff --git a/community/snapcast/APKBUILD b/community/snapcast/APKBUILD index 10603288bef9..1469c2534a74 100644 --- a/community/snapcast/APKBUILD +++ b/community/snapcast/APKBUILD @@ -18,6 +18,8 @@ source="$pkgname-$pkgver.tar.gz::https://github.com/badaix/snapcast/archive/v$pk $pkgname-client.confd $pkgname-server.initd $pkgname-server.confd + + fix-tests.patch " [ "$CARCH" = "riscv64" ] && options="$options textrels" @@ -70,4 +72,5 @@ bc2219f00fa70890be0c12f6fb8da0ac86949f65c1714648d20f6e83a80e075b8482bafd65ebadcc fa353d7974d3a8b3b22ff009b762c7c4ee318f9f83e22762a9ebf550484b9fc3cc4dffd389b6d756630dc035cb86d5c5643541957785f8bbf71fe4915691c337 snapcast-client.confd 47feaf72d96ccab6996d24619b1d36a89a74e50d402fb6760792ee62d5c2460718324ef8f437ce2be121488f164372c2c0883b9ff0e45d484b5b0e3778d6d99b snapcast-server.initd 48d494143d044a413b414b32cd8be51d4242234b6d7cb03102914a42b1ea6b1913c2c31b223c23c6be316918e731875149a2505daa03165659d0a1be3ca7e75c snapcast-server.confd +16682578b12bc0d76af88cd09a24523498aac3a1108b691046b54d7f96bc92d6f96d2af38a7e9ddb7a3da57ae46fbc83adf29e04142332952d284f5961b432c8 fix-tests.patch " diff --git a/community/snapcast/fix-tests.patch b/community/snapcast/fix-tests.patch new file mode 100644 index 000000000000..322b24d605ed --- /dev/null +++ b/community/snapcast/fix-tests.patch @@ -0,0 +1,74 @@ +From 411d98f5628f190fa481e86a13e0be184693f095 Mon Sep 17 00:00:00 2001 +From: badaix +Date: Fri, 24 Dec 2021 10:24:21 +0100 +Subject: [PATCH] Fix unit tests + +--- + test/test_main.cpp | 25 ++++++++++++++++++++++--- + 1 file changed, 22 insertions(+), 3 deletions(-) + +diff --git a/test/test_main.cpp b/test/test_main.cpp +index 53ae2e3a..926de335 100644 +--- a/test/test_main.cpp ++++ b/test/test_main.cpp +@@ -17,16 +17,23 @@ + ***/ + + #define CATCH_CONFIG_MAIN +-#include "catch.hpp" + +-#include ++// prototype/interface header file ++#include "catch.hpp" + ++// local headers + #include "common/aixlog.hpp" + #include "common/utils/string_utils.hpp" + #include "server/streamreader/control_error.hpp" + #include "server/streamreader/properties.hpp" + #include "server/streamreader/stream_uri.hpp" + ++// 3rd party headers ++ ++// standard headers ++#include ++ ++ + using namespace std; + + +@@ -129,7 +136,7 @@ TEST_CASE("Metadata") + "contentCreated": "2017-04-07", + "discNumber": 1, + "duration": 247.0, +- "file": "The Chainsmokers - Memories...Do Not Open (2017)/05 - Something Just Like This.mp3", ++ "url": "The Chainsmokers - Memories...Do Not Open (2017)/05 - Something Just Like This.mp3", + "genre": [ + "Dance/Electronic" + ], +@@ -173,6 +180,12 @@ TEST_CASE("Properties") + REQUIRE(to_string(PlaybackStatus::kPaused) == "paused"); + auto in_json = json::parse(R"( + { ++ "canControl": false, ++ "canGoNext": false, ++ "canGoPrevious": false, ++ "canPause": false, ++ "canPlay": false, ++ "canSeek": false, + "playbackStatus": "playing", + "loopStatus": "track", + "shuffle": false, +@@ -193,6 +206,12 @@ TEST_CASE("Properties") + + in_json = json::parse(R"( + { ++ "canControl": true, ++ "canGoNext": true, ++ "canGoPrevious": true, ++ "canPause": true, ++ "canPlay": true, ++ "canSeek": true, + "volume": 42 + } + )");