projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Values API: split into private and public APIs
[babeltrace.git]
/
tests
/
lib
/
test-plugin-plugins
/
sfs.c
diff --git
a/tests/lib/test-plugin-plugins/sfs.c
b/tests/lib/test-plugin-plugins/sfs.c
index 735bf2ae19a84047d3c09afe51d9a96ceccf3314..92ee2ca2419dfa17f9225de60b1be31a22bbb1fe 100644
(file)
--- a/
tests/lib/test-plugin-plugins/sfs.c
+++ b/
tests/lib/test-plugin-plugins/sfs.c
@@
-18,8
+18,10
@@
#include <babeltrace/plugin/plugin-dev.h>
#include <babeltrace/graph/component-class.h>
#include <babeltrace/values.h>
#include <babeltrace/plugin/plugin-dev.h>
#include <babeltrace/graph/component-class.h>
#include <babeltrace/values.h>
-#include <babeltrace/ref.h>
-#include <assert.h>
+#include <babeltrace/private-values.h>
+#include <babeltrace/object.h>
+#include <babeltrace/assert-internal.h>
+#include <babeltrace/assert-internal.h>
static enum bt_component_status sink_consume(
struct bt_private_component *private_component)
static enum bt_component_status sink_consume(
struct bt_private_component *private_component)
@@
-28,50
+30,46
@@
static enum bt_component_status sink_consume(
}
static enum bt_notification_iterator_status dummy_iterator_init_method(
}
static enum bt_notification_iterator_status dummy_iterator_init_method(
- struct bt_private_notification_iterator *private_iterator,
+ struct bt_private_
connection_private_
notification_iterator *private_iterator,
struct bt_private_port *private_port)
{
return BT_NOTIFICATION_ITERATOR_STATUS_OK;
}
static void dummy_iterator_finalize_method(
struct bt_private_port *private_port)
{
return BT_NOTIFICATION_ITERATOR_STATUS_OK;
}
static void dummy_iterator_finalize_method(
- struct bt_private_notification_iterator *private_iterator)
+ struct bt_private_
connection_private_
notification_iterator *private_iterator)
{
}
{
}
-static struct bt_notification_iterator_next_return dummy_iterator_next_method(
- struct bt_private_notification_iterator *private_iterator)
+static enum bt_notification_iterator_status dummy_iterator_next_method(
+ struct bt_private_connection_private_notification_iterator *private_iterator,
+ bt_notification_array notifs, uint64_t capacity,
+ uint64_t *count)
{
{
- struct bt_notification_iterator_next_return next_return = {
- .notification = NULL,
- .status = BT_NOTIFICATION_ITERATOR_STATUS_OK,
- };
-
- return next_return;
+ return BT_NOTIFICATION_ITERATOR_STATUS_ERROR;
}
}
-static enum bt_notification_iterator_status dummy_iterator_seek_time_method(
- struct bt_private_notification_iterator *private_iterator,
- int64_t time)
-{
- return BT_NOTIFICATION_ITERATOR_STATUS_OK;
-}
-
-static struct bt_value *query_method(
+static struct bt_component_class_query_method_return query_method(
struct bt_component_class *component_class,
struct bt_component_class *component_class,
+ struct bt_query_executor *query_exec,
const char *object, struct bt_value *params)
{
const char *object, struct bt_value *params)
{
- int ret;
- struct bt_value *results = bt_value_array_create();
+ struct bt_private_value *results = bt_private_value_array_create();
+ struct bt_component_class_query_method_return ret = {
+ .status = BT_QUERY_STATUS_OK,
+ .result = bt_value_borrow_from_private(results),
+ };
+ int iret;
-
assert(results
);
-
ret = bt_value_array_append_string
(results, object);
-
assert(
ret == 0);
-
ret = bt_value_array_append
(results, params);
-
assert(
ret == 0);
- return re
sults
;
+
BT_ASSERT(ret.result
);
+
iret = bt_private_value_array_append_string_element
(results, object);
+
BT_ASSERT(i
ret == 0);
+
iret = bt_private_value_array_append_element
(results, params);
+
BT_ASSERT(i
ret == 0);
+ return re
t
;
}
}
+BT_PLUGIN_MODULE();
BT_PLUGIN(test_sfs);
BT_PLUGIN_DESCRIPTION("Babeltrace plugin with source, sink, and filter component classes");
BT_PLUGIN_AUTHOR("Janine Sutto");
BT_PLUGIN(test_sfs);
BT_PLUGIN_DESCRIPTION("Babeltrace plugin with source, sink, and filter component classes");
BT_PLUGIN_AUTHOR("Janine Sutto");
@@
-84,8
+82,6
@@
BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_INIT_METHOD(source,
dummy_iterator_init_method);
BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_FINALIZE_METHOD(source,
dummy_iterator_finalize_method);
dummy_iterator_init_method);
BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_FINALIZE_METHOD(source,
dummy_iterator_finalize_method);
-BT_PLUGIN_SOURCE_COMPONENT_CLASS_NOTIFICATION_ITERATOR_SEEK_TIME_METHOD(source,
- dummy_iterator_seek_time_method);
BT_PLUGIN_SINK_COMPONENT_CLASS(sink, sink_consume);
BT_PLUGIN_SINK_COMPONENT_CLASS_DESCRIPTION(sink, "A sink.");
BT_PLUGIN_SINK_COMPONENT_CLASS(sink, sink_consume);
BT_PLUGIN_SINK_COMPONENT_CLASS_DESCRIPTION(sink, "A sink.");
@@
-102,6
+98,4
@@
BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_INIT_METHOD(filter,
dummy_iterator_init_method);
BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_FINALIZE_METHOD(filter,
dummy_iterator_finalize_method);
dummy_iterator_init_method);
BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_FINALIZE_METHOD(filter,
dummy_iterator_finalize_method);
-BT_PLUGIN_FILTER_COMPONENT_CLASS_NOTIFICATION_ITERATOR_SEEK_TIME_METHOD(filter,
- dummy_iterator_seek_time_method);
BT_PLUGIN_FILTER_COMPONENT_CLASS_QUERY_METHOD(filter, query_method);
BT_PLUGIN_FILTER_COMPONENT_CLASS_QUERY_METHOD(filter, query_method);
This page took
0.024097 seconds
and
4
git commands to generate.