aports/community/snapcast/fix-tests.patch

75 lines
1.9 KiB
Diff

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
}
)");