projects
/
babeltrace.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
lib: add internal object pool API and use it; adapt plugins/tests
[babeltrace.git]
/
tests
/
lib
/
test_bt_notification_iterator.c
diff --git
a/tests/lib/test_bt_notification_iterator.c
b/tests/lib/test_bt_notification_iterator.c
index 2398d4e3245b2bbf6867e4c93e7bbea47c8264c7..8f889fcda1dad29677dc0a66517b1e1df61d0752 100644
(file)
--- a/
tests/lib/test_bt_notification_iterator.c
+++ b/
tests/lib/test_bt_notification_iterator.c
@@
-401,18
+401,6
@@
enum bt_notification_iterator_status src_iter_init(
return BT_NOTIFICATION_ITERATOR_STATUS_OK;
}
return BT_NOTIFICATION_ITERATOR_STATUS_OK;
}
-static
-struct bt_event *src_create_event(struct bt_packet *packet)
-{
- struct bt_event *event = bt_event_create(src_event_class);
- int ret;
-
- assert(event);
- ret = bt_event_set_packet(event, packet);
- assert(ret == 0);
- return event;
-}
-
static
struct bt_notification_iterator_next_method_return src_iter_next_seq(
struct src_iter_user_data *user_data)
static
struct bt_notification_iterator_next_method_return src_iter_next_seq(
struct src_iter_user_data *user_data)
@@
-513,12
+501,10
@@
struct bt_notification_iterator_next_method_return src_iter_next_seq(
}
if (event_packet) {
}
if (event_packet) {
- struct bt_event *event = src_create_event(event_packet);
-
- assert(event);
- next_return.notification = bt_notification_event_create(event,
+ next_return.notification =
+ bt_notification_event_create(src_event_class,
+ event_packet,
src_empty_cc_prio_map);
src_empty_cc_prio_map);
- bt_put(event);
assert(next_return.notification);
}
assert(next_return.notification);
}
@@
-599,12
+585,10
@@
enum bt_notification_iterator_status common_consume(
struct bt_event *event;
test_event.type = TEST_EV_TYPE_NOTIF_EVENT;
struct bt_event *event;
test_event.type = TEST_EV_TYPE_NOTIF_EVENT;
- event = bt_notification_event_
get
_event(notification);
+ event = bt_notification_event_
borrow
_event(notification);
assert(event);
assert(event);
- test_event.packet = bt_event_get_packet(event);
- bt_put(event);
+ test_event.packet = bt_event_borrow_packet(event);
assert(test_event.packet);
assert(test_event.packet);
- bt_put(test_event.packet);
break;
}
case BT_NOTIFICATION_TYPE_INACTIVITY:
break;
}
case BT_NOTIFICATION_TYPE_INACTIVITY:
@@
-613,30
+597,26
@@
enum bt_notification_iterator_status common_consume(
case BT_NOTIFICATION_TYPE_STREAM_BEGIN:
test_event.type = TEST_EV_TYPE_NOTIF_STREAM_BEGIN;
test_event.stream =
case BT_NOTIFICATION_TYPE_STREAM_BEGIN:
test_event.type = TEST_EV_TYPE_NOTIF_STREAM_BEGIN;
test_event.stream =
- bt_notification_stream_begin_
get
_stream(notification);
+ bt_notification_stream_begin_
borrow
_stream(notification);
assert(test_event.stream);
assert(test_event.stream);
- bt_put(test_event.stream);
break;
case BT_NOTIFICATION_TYPE_STREAM_END:
test_event.type = TEST_EV_TYPE_NOTIF_STREAM_END;
test_event.stream =
break;
case BT_NOTIFICATION_TYPE_STREAM_END:
test_event.type = TEST_EV_TYPE_NOTIF_STREAM_END;
test_event.stream =
- bt_notification_stream_end_
get
_stream(notification);
+ bt_notification_stream_end_
borrow
_stream(notification);
assert(test_event.stream);
assert(test_event.stream);
- bt_put(test_event.stream);
break;
case BT_NOTIFICATION_TYPE_PACKET_BEGIN:
test_event.type = TEST_EV_TYPE_NOTIF_PACKET_BEGIN;
test_event.packet =
break;
case BT_NOTIFICATION_TYPE_PACKET_BEGIN:
test_event.type = TEST_EV_TYPE_NOTIF_PACKET_BEGIN;
test_event.packet =
- bt_notification_packet_begin_
get
_packet(notification);
+ bt_notification_packet_begin_
borrow
_packet(notification);
assert(test_event.packet);
assert(test_event.packet);
- bt_put(test_event.packet);
break;
case BT_NOTIFICATION_TYPE_PACKET_END:
test_event.type = TEST_EV_TYPE_NOTIF_PACKET_END;
test_event.packet =
break;
case BT_NOTIFICATION_TYPE_PACKET_END:
test_event.type = TEST_EV_TYPE_NOTIF_PACKET_END;
test_event.packet =
- bt_notification_packet_end_
get
_packet(notification);
+ bt_notification_packet_end_
borrow
_packet(notification);
assert(test_event.packet);
assert(test_event.packet);
- bt_put(test_event.packet);
break;
default:
test_event.type = TEST_EV_TYPE_NOTIF_UNEXPECTED;
break;
default:
test_event.type = TEST_EV_TYPE_NOTIF_UNEXPECTED;
@@
-644,9
+624,8
@@
enum bt_notification_iterator_status common_consume(
}
if (test_event.packet) {
}
if (test_event.packet) {
- test_event.stream = bt_packet_
get
_stream(test_event.packet);
+ test_event.stream = bt_packet_
borrow
_stream(test_event.packet);
assert(test_event.stream);
assert(test_event.stream);
- bt_put(test_event.stream);
}
end:
}
end:
This page took
0.025795 seconds
and
4
git commands to generate.