From: Philippe Proulx Date: Thu, 4 Jul 2019 06:16:33 +0000 (-0400) Subject: tests: call bt_current_thread_clear_error() when handling an error X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=758932ce2630ba83f7308b8b0014be082ed959fa tests: call bt_current_thread_clear_error() when handling an error Signed-off-by: Philippe Proulx Change-Id: I5e0774fc50936e74320d27313738ce673f5d3c44 Reviewed-on: https://review.lttng.org/c/babeltrace/+/1615 Tested-by: jenkins Reviewed-by: Francis Deslauriers Reviewed-by: Simon Marchi --- diff --git a/tests/lib/plugin.c b/tests/lib/plugin.c index 1f0d783a..9c58fd99 100644 --- a/tests/lib/plugin.c +++ b/tests/lib/plugin.c @@ -225,6 +225,7 @@ static void test_create_all_from_dir(const char *plugin_dir) BT_FALSE, &plugin_set); ok(status == BT_PLUGIN_FIND_ALL_FROM_DIR_STATUS_ERROR, "bt_plugin_find_all_from_dir() fails with an invalid path"); + bt_current_thread_clear_error(); plugin_set = NULL; status = bt_plugin_find_all_from_dir(plugin_dir, BT_FALSE, BT_FALSE, diff --git a/tests/lib/test_graph_topo.c b/tests/lib/test_graph_topo.c index b4ea1cb0..5efffde9 100644 --- a/tests/lib/test_graph_topo.c +++ b/tests/lib/test_graph_topo.c @@ -699,6 +699,7 @@ void test_src_port_connected_error(void) sink_def_port, &conn); ok(status != BT_GRAPH_CONNECT_PORTS_STATUS_OK, "bt_graph_connect_ports() returns an error"); + bt_current_thread_clear_error(); ok(!conn, "returned connection is still NULL"); gsrc = bt_component_source_as_component_const(src); gsink = bt_component_sink_as_component_const(sink); @@ -764,6 +765,7 @@ void test_sink_port_connected_error(void) sink_def_port, &conn); ok(status != BT_GRAPH_CONNECT_PORTS_STATUS_OK, "bt_graph_connect_ports() returns an error"); + bt_current_thread_clear_error(); ok(!conn, "returned connection is still NULL"); gsrc = bt_component_source_as_component_const(src); gsink = bt_component_sink_as_component_const(sink);