From: Philippe Proulx Date: Wed, 8 Feb 2017 00:56:36 +0000 (-0500) Subject: Add shared object comp. class help attribute test X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=a889b89f1be9211d3de2d1e50a26c366e772f3b3;p=deliverable%2Fbabeltrace.git Add shared object comp. class help attribute test Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau --- diff --git a/tests/lib/test-plugin-plugins/sfs.c b/tests/lib/test-plugin-plugins/sfs.c index cb1e7e475..dbda1d7eb 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 426cea48b..7fa338f60 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",