From a889b89f1be9211d3de2d1e50a26c366e772f3b3 Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Tue, 7 Feb 2017 19:56:36 -0500 Subject: [PATCH] Add shared object comp. class help attribute test MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau --- tests/lib/test-plugin-plugins/sfs.c | 6 ++++++ tests/lib/test_plugin.c | 11 ++++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/tests/lib/test-plugin-plugins/sfs.c b/tests/lib/test-plugin-plugins/sfs.c index cb1e7e47..dbda1d7e 100644 --- a/tests/lib/test-plugin-plugins/sfs.c +++ b/tests/lib/test-plugin-plugins/sfs.c @@ -72,6 +72,12 @@ BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_SEEK_TIME_METHOD(source, BT_PLUGIN_SINK_COMPONENT_CLASS(sink, sink_consume); BT_PLUGIN_SINK_COMPONENT_CLASS_DESCRIPTION(sink, "A sink."); +BT_PLUGIN_SINK_COMPONENT_CLASS_HELP(sink, + "Bacon ipsum dolor amet strip steak cupim pastrami venison shoulder.\n" + "Prosciutto beef ribs flank meatloaf pancetta brisket kielbasa drumstick\n" + "venison tenderloin cow tail. Beef short loin shoulder meatball, sirloin\n" + "ground round brisket salami cupim pork bresaola turkey bacon boudin.\n" +); BT_PLUGIN_FILTER_COMPONENT_CLASS(filter, dummy_iterator_get_method, dummy_iterator_next_method); diff --git a/tests/lib/test_plugin.c b/tests/lib/test_plugin.c index 426cea48..7fa338f6 100644 --- a/tests/lib/test_plugin.c +++ b/tests/lib/test_plugin.c @@ -31,7 +31,7 @@ #include "tap/tap.h" #include "common.h" -#define NR_TESTS 44 +#define NR_TESTS 45 #define NON_EXISTING_PATH "/this/hopefully/does/not/exist/5bc75f8d-0dba-4043-a509-d7984b97e42b.so" /* Those symbols are written to by some test plugins */ @@ -170,12 +170,17 @@ static void test_sfs(const char *plugin_dir) sink_comp_class = bt_plugin_get_component_class_by_name_and_type( plugin, "sink", BT_COMPONENT_CLASS_TYPE_SINK); - ok(sink_comp_class, "bt_plugin_get_component_class_by_name_and_type() finds a sink component class"); + ok(strcmp(bt_component_class_get_help(sink_comp_class), + "Bacon ipsum dolor amet strip steak cupim pastrami venison shoulder.\n" + "Prosciutto beef ribs flank meatloaf pancetta brisket kielbasa drumstick\n" + "venison tenderloin cow tail. Beef short loin shoulder meatball, sirloin\n" + "ground round brisket salami cupim pork bresaola turkey bacon boudin.\n") == 0, + "bt_component_class_get_help() returns the expected help text"); + filter_comp_class = bt_plugin_get_component_class_by_name_and_type( plugin, "filter", BT_COMPONENT_CLASS_TYPE_FILTER); - ok(filter_comp_class, "bt_plugin_get_component_class_by_name_and_type() finds a filter component class"); ok(!bt_plugin_get_component_class_by_name_and_type(plugin, "filter", -- 2.34.1