From fbea39cfa682f04cb52876a09d90bc5c544b01d7 Mon Sep 17 00:00:00 2001 From: Connor Olding Date: Sun, 7 Jun 2015 13:22:26 -0700 Subject: [PATCH] clean up bench a little --- util/bench.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/util/bench.cpp b/util/bench.cpp index 8a881a1..5996b41 100644 --- a/util/bench.cpp +++ b/util/bench.cpp @@ -26,12 +26,18 @@ INNER const LADSPA_Descriptor* load_ladspa(char *path) { plug = dlopen(path, RTLD_NOW); - assert(plug); + if (!plug) { + puts(dlerror()); + exit(1); + } atexit(cleanup); LADSPA_Descriptor_Function df; df = (decltype(df)) dlsym(plug, "ladspa_descriptor"); - assert(df); + if (!df) { + puts(dlerror()); + exit(1); + } const LADSPA_Descriptor *d = df(0); assert(d); @@ -88,7 +94,10 @@ get_default(LADSPA_PortRangeHint hint) int main(int argc, char **argv) { - assert(argc > 1); + if (argc < 2) { + fprintf(stderr, "Please supply a path to the plugin to test.\n"); + return 1; + } const LADSPA_Descriptor *d = load_ladspa(argv[1]);