diff options
author | Max Kellermann <max@musicpd.org> | 2016-11-07 09:20:12 +0100 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2016-11-07 09:25:51 +0100 |
commit | d8b6aff23aa01fb26dfe52a0e0c6fbd485b87f39 (patch) | |
tree | dd935d5b843dcf7a921e789253993c1d258bb2c5 /test/test_vorbis_encoder.cxx | |
parent | b8aac3f8fc27dbdc503aeb078b4d57f6a5a70266 (diff) |
encoder: migrate from class Error to C++ exceptions
Diffstat (limited to 'test/test_vorbis_encoder.cxx')
-rw-r--r-- | test/test_vorbis_encoder.cxx | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/test/test_vorbis_encoder.cxx b/test/test_vorbis_encoder.cxx index 054700c2e..71366460e 100644 --- a/test/test_vorbis_encoder.cxx +++ b/test/test_vorbis_encoder.cxx @@ -27,7 +27,6 @@ #include "fs/io/StdioOutputStream.hxx" #include "tag/Tag.hxx" #include "tag/TagBuilder.hxx" -#include "util/Error.hxx" #include "Log.hxx" #include <memory> @@ -40,8 +39,6 @@ static uint8_t zero[256]; int main(gcc_unused int argc, gcc_unused char **argv) try { - gcc_unused bool success; - /* create the encoder */ const auto plugin = encoder_plugin_get("vorbis"); @@ -56,8 +53,7 @@ try { /* open the encoder */ AudioFormat audio_format(44100, SampleFormat::S16, 2); - std::unique_ptr<Encoder> encoder(p_encoder->Open(audio_format, - IgnoreError())); + std::unique_ptr<Encoder> encoder(p_encoder->Open(audio_format)); assert(encoder != nullptr); StdioOutputStream os(stdout); @@ -66,15 +62,13 @@ try { /* write a block of data */ - success = encoder->Write(zero, sizeof(zero), IgnoreError()); - assert(success); + encoder->Write(zero, sizeof(zero)); EncoderToOutputStream(os, *encoder); /* write a tag */ - success = encoder->PreTag(IgnoreError()); - assert(success); + encoder->PreTag(); EncoderToOutputStream(os, *encoder); @@ -87,21 +81,17 @@ try { tag_builder.Commit(tag); } - success = encoder->SendTag(tag, IgnoreError()); - assert(success); + encoder->SendTag(tag); EncoderToOutputStream(os, *encoder); /* write another block of data */ - success = encoder->Write(zero, sizeof(zero), IgnoreError()); - assert(success); + encoder->Write(zero, sizeof(zero)); /* finish */ - success = encoder->End(IgnoreError()); - assert(success); - + encoder->End(); EncoderToOutputStream(os, *encoder); return EXIT_SUCCESS; |