Skip to content

Commit

Permalink
community/snapcast: fix test failure
Browse files Browse the repository at this point in the history
  • Loading branch information
nmeum committed Dec 25, 2021
1 parent 0e7755f commit f788e4c
Show file tree
Hide file tree
Showing 2 changed files with 77 additions and 0 deletions.
3 changes: 3 additions & 0 deletions community/snapcast/APKBUILD
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -70,4 +72,5 @@ bc2219f00fa70890be0c12f6fb8da0ac86949f65c1714648d20f6e83a80e075b8482bafd65ebadcc
fa353d7974d3a8b3b22ff009b762c7c4ee318f9f83e22762a9ebf550484b9fc3cc4dffd389b6d756630dc035cb86d5c5643541957785f8bbf71fe4915691c337 snapcast-client.confd
47feaf72d96ccab6996d24619b1d36a89a74e50d402fb6760792ee62d5c2460718324ef8f437ce2be121488f164372c2c0883b9ff0e45d484b5b0e3778d6d99b snapcast-server.initd
48d494143d044a413b414b32cd8be51d4242234b6d7cb03102914a42b1ea6b1913c2c31b223c23c6be316918e731875149a2505daa03165659d0a1be3ca7e75c snapcast-server.confd
16682578b12bc0d76af88cd09a24523498aac3a1108b691046b54d7f96bc92d6f96d2af38a7e9ddb7a3da57ae46fbc83adf29e04142332952d284f5961b432c8 fix-tests.patch
"
74 changes: 74 additions & 0 deletions community/snapcast/fix-tests.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
From 411d98f5628f190fa481e86a13e0be184693f095 Mon Sep 17 00:00:00 2001
From: badaix <johannes.pohl@badaix.de>
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 <regex>
+// 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 <regex>
+
+
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
}
)");

0 comments on commit f788e4c

Please sign in to comment.