From a96be34437eb66649a1b5b169b8ee2b774573dbb Mon Sep 17 00:00:00 2001 From: "alexey.lysiuk" Date: Sun, 16 May 2021 10:05:31 +0300 Subject: [PATCH] check return values in mpg123 test --- test/libmpg123.cpp | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/test/libmpg123.cpp b/test/libmpg123.cpp index 05b33027..75aa0c25 100644 --- a/test/libmpg123.cpp +++ b/test/libmpg123.cpp @@ -2,10 +2,25 @@ int main(int argc, char **argv) { - mpg123_init(); + if (mpg123_init() != MPG123_OK) + { + return 1; + } + mpg123_handle* mh = mpg123_new(NULL, NULL); - mpg123_param(mh, MPG123_VERBOSE, 1, 0.); + + if (mh == nullptr) + { + return 1; + } + + if (mpg123_param(mh, MPG123_VERBOSE, 1, 0.) != MPG123_OK) + { + return 1; + } + mpg123_delete(mh); mpg123_exit(); + return 0; }