summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorMax Kellermann <max@musicpd.org>2016-09-04 14:32:09 +0200
committerMax Kellermann <max@musicpd.org>2016-09-04 19:38:41 +0200
commit13c32111a01420e426ad7153973686694cf0bee2 (patch)
tree8f634d9194b86b0980123d7ad1bb603faa866398 /test
parent28c69757320936adac8b9c0d6bd5c592f40a5ec1 (diff)
Filter/Internal: migrate from class Error to C++ exceptions
Diffstat (limited to 'test')
-rw-r--r--test/run_filter.cxx19
1 files changed, 4 insertions, 15 deletions
diff --git a/test/run_filter.cxx b/test/run_filter.cxx
index 0fa414e39..58f235956 100644
--- a/test/run_filter.cxx
+++ b/test/run_filter.cxx
@@ -105,13 +105,7 @@ try {
/* open the filter */
- Error error;
- std::unique_ptr<Filter> filter(prepared_filter->Open(audio_format,
- error));
- if (!filter) {
- LogError(error, "Failed to open filter");
- return EXIT_FAILURE;
- }
+ std::unique_ptr<Filter> filter(prepared_filter->Open(audio_format));
const AudioFormat out_audio_format = filter->GetOutAudioFormat();
@@ -127,12 +121,7 @@ try {
if (nbytes <= 0)
break;
- auto dest = filter->FilterPCM({(const void *)buffer, (size_t)nbytes},
- error);
- if (dest.IsNull()) {
- LogError(error, "filter/Filter failed");
- return EXIT_FAILURE;
- }
+ auto dest = filter->FilterPCM({(const void *)buffer, (size_t)nbytes});
nbytes = write(1, dest.data, dest.size);
if (nbytes < 0) {
@@ -147,7 +136,7 @@ try {
config_global_finish();
return EXIT_SUCCESS;
- } catch (const std::exception &e) {
+} catch (const std::exception &e) {
LogError(e);
return EXIT_FAILURE;
- }
+}