From dd15498078a58c2fe9f71e1ceef1eb326c82d9e6 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Wed, 15 Jul 2020 00:08:27 +0200 Subject: Use standard assert for test expectations The old one aborted anyway, and I've been using assert for tests in other projects for a while now, and never really missed having something more complex. The lack of a dependency or repetitive code is nice. Since the unit tests are about to be split up, the abort thing will become less of an issue anyway. --- test/bad_syntax.lv2/test_bad_syntax.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'test/bad_syntax.lv2') diff --git a/test/bad_syntax.lv2/test_bad_syntax.c b/test/bad_syntax.lv2/test_bad_syntax.c index 80d9e3c..90d789b 100644 --- a/test/bad_syntax.lv2/test_bad_syntax.c +++ b/test/bad_syntax.lv2/test_bad_syntax.c @@ -1,8 +1,11 @@ +#undef NDEBUG + #include "../src/lilv_internal.h" #include "serd/serd.h" #include "lilv/lilv.h" +#include #include #include #include @@ -10,13 +13,6 @@ #define PLUGIN_URI "http://example.org/bad-syntax" -#define TEST_ASSERT(check) do {\ - if (!(check)) {\ - fprintf(stderr, "%s:%d: failed test: %s\n", __FILE__, __LINE__, #check);\ - return 1;\ - }\ -} while (0) - int main(int argc, char** argv) { @@ -41,8 +37,8 @@ main(int argc, char** argv) const LilvPlugins* plugins = lilv_world_get_all_plugins(world); const LilvPlugin* plugin = lilv_plugins_get_by_uri(plugins, plugin_uri); - TEST_ASSERT(!lilv_plugin_get_name(plugin)); - TEST_ASSERT(!lilv_plugin_instantiate(plugin, 48000, NULL)); + assert(!lilv_plugin_get_name(plugin)); + assert(!lilv_plugin_instantiate(plugin, 48000, NULL)); lilv_node_free(plugin_uri); lilv_world_free(world); -- cgit v1.2.1