mirror of
https://github.com/badaix/snapcast.git
synced 2025-07-20 01:47:36 +02:00
Add control functions to PcmStream
-move json parsing to Server class -improve error handling with the new ErrorCode object
This commit is contained in:
parent
78c78370ab
commit
077a6fc1a4
12 changed files with 629 additions and 152 deletions
|
@ -25,6 +25,7 @@
|
|||
#include "common/metatags.hpp"
|
||||
#include "common/properties.hpp"
|
||||
#include "common/utils/string_utils.hpp"
|
||||
#include "server/streamreader/control_error.hpp"
|
||||
#include "server/streamreader/stream_uri.hpp"
|
||||
|
||||
using namespace std;
|
||||
|
@ -237,3 +238,17 @@ TEST_CASE("Librespot")
|
|||
for (const auto& match : m)
|
||||
std::cerr << "Match: '" << match << "'\n";
|
||||
}
|
||||
|
||||
|
||||
TEST_CASE("Error")
|
||||
{
|
||||
std::error_code ec = ControlErrc::can_not_control;
|
||||
REQUIRE(ec);
|
||||
REQUIRE(ec == ControlErrc::can_not_control);
|
||||
REQUIRE(ec != ControlErrc::success);
|
||||
std::cout << ec << std::endl;
|
||||
|
||||
ec = make_error_code(ControlErrc::can_not_control);
|
||||
REQUIRE(ec.category() == snapcast::error::control::category());
|
||||
std::cout << "Category: " << ec.category().name() << ", " << ec.message() << std::endl;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue