ir: remove unused bt_ctf_event_copy()
authorPhilippe Proulx <eeppeliteloop@gmail.com>
Tue, 16 Feb 2016 21:48:08 +0000 (16:48 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Mon, 22 Feb 2016 17:49:16 +0000 (12:49 -0500)
Signed-off-by: Philippe Proulx <eeppeliteloop@gmail.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
formats/ctf/ir/event.c
include/babeltrace/ctf-ir/event.h
tests/lib/test_ctf_writer.c

index 0999f642901b64f053e4293ccd8fa87716ad565a..4202b8ff975dbb893ea733891cdcd8fa62697c6d 100644 (file)
@@ -738,59 +738,6 @@ end:
        return ret;
 }
 
-struct bt_ctf_event *bt_ctf_event_copy(struct bt_ctf_event *event)
-{
-       struct bt_ctf_event *copy = NULL;
-
-       if (!event) {
-               goto error;
-       }
-
-       copy = g_new0(struct bt_ctf_event, 1);
-       if (!copy) {
-               goto error;
-       }
-
-       bt_object_init(copy, bt_ctf_event_destroy);
-       copy->event_class = bt_get(event->event_class);
-
-       if (event->event_header) {
-               copy->event_header = bt_ctf_field_copy(event->event_header);
-               if (!copy->event_header) {
-                       goto error;
-               }
-       }
-
-       if (event->stream_event_context) {
-               copy->stream_event_context =
-                       bt_ctf_field_copy(event->stream_event_context);
-               if (!copy->stream_event_context) {
-                       goto error;
-               }
-       }
-
-       if (event->context_payload) {
-               copy->context_payload = bt_ctf_field_copy(
-                       event->context_payload);
-               if (!copy->context_payload) {
-                       goto error;
-               }
-       }
-
-       if (event->fields_payload) {
-               copy->fields_payload = bt_ctf_field_copy(event->fields_payload);
-               if (!copy->fields_payload) {
-                       goto error;
-               }
-       }
-
-       return copy;
-
-error:
-       BT_PUT(copy);
-       return copy;
-}
-
 int bt_ctf_event_set_packet(struct bt_ctf_event *event,
                struct bt_ctf_packet *packet)
 {
index f2e809e98fbc9ad5f49cd8f778d817b90339542c..b9d813e4b815f26f6d295d42eaf9e53b808f70a4 100644 (file)
@@ -242,19 +242,6 @@ extern struct bt_ctf_field *bt_ctf_event_get_stream_event_context(
 extern int bt_ctf_event_set_stream_event_context(struct bt_ctf_event *event,
                struct bt_ctf_field *context);
 
-/*
- * bt_ctf_event_copy: Deep-copy an event.
- *
- * Get an event's deep copy.
- *
- * On success, the returned copy has its reference count set to 1.
- *
- * @param event Event to copy.
- *
- * Returns the deep-copied event on success, NULL on error.
- */
-extern struct bt_ctf_event *bt_ctf_event_copy(struct bt_ctf_event *event);
-
 extern int bt_ctf_event_set_packet(struct bt_ctf_event *event,
                struct bt_ctf_packet *packet);
 
index 1e7393a34a660aa281e870b0bfbd8f8ae0cbee75..22a7c3e6b44e18630d57199bd46e90b5dc646648 100644 (file)
@@ -58,7 +58,7 @@
 #define DEFAULT_CLOCK_TIME 0
 #define DEFAULT_CLOCK_VALUE 0
 
-#define NR_TESTS 591
+#define NR_TESTS 584
 
 static int64_t current_time = 42;
 
@@ -281,89 +281,6 @@ close_fp:
        }
 }
 
-void event_copy_tests(struct bt_ctf_event *event)
-{
-       struct bt_ctf_event *copy;
-       struct bt_ctf_event_class *orig_event_class;
-       struct bt_ctf_event_class *copy_event_class;
-       struct bt_ctf_stream *orig_stream;
-       struct bt_ctf_stream *copy_stream;
-       struct bt_ctf_field *orig_field;
-       struct bt_ctf_field *copy_field;
-
-       /* copy */
-       ok(!bt_ctf_event_copy(NULL),
-               "bt_ctf_event_copy handles NULL correctly");
-       copy = bt_ctf_event_copy(event);
-       ok(copy, "bt_ctf_event_copy returns a valid pointer");
-
-       /* validate event class */
-       orig_event_class = bt_ctf_event_get_class(event);
-       assert(orig_event_class);
-       copy_event_class = bt_ctf_event_get_class(copy);
-       ok(orig_event_class == copy_event_class,
-               "original and copied events share the same event class pointer");
-       bt_put(orig_event_class);
-       bt_put(copy_event_class);
-
-       /* validate stream */
-       orig_stream = bt_ctf_event_get_stream(event);
-       copy_stream = bt_ctf_event_get_stream(copy);
-
-       if (!orig_stream) {
-               ok(!copy_stream, "original and copied events have no stream");
-       } else {
-               ok(orig_stream == copy_stream,
-                       "original and copied events share the same stream pointer");
-       }
-       bt_put(orig_stream);
-       bt_put(copy_stream);
-
-       /* header */
-       orig_field = bt_ctf_event_get_header(event);
-       copy_field = bt_ctf_event_get_header(copy);
-
-       if (!orig_field) {
-               ok(!copy_field, "original and copied events have no header");
-       } else {
-               ok(orig_field != copy_field,
-                       "original and copied events headers are different pointers");
-       }
-
-       bt_put(orig_field);
-       bt_put(copy_field);
-
-       /* context */
-       orig_field = bt_ctf_event_get_event_context(event);
-       copy_field = bt_ctf_event_get_event_context(copy);
-
-       if (!orig_field) {
-               ok(!copy_field, "original and copied events have no context");
-       } else {
-               ok(orig_field != copy_field,
-                       "original and copied events contexts are different pointers");
-       }
-
-       bt_put(orig_field);
-       bt_put(copy_field);
-
-       /* payload */
-       orig_field = bt_ctf_event_get_payload_field(event);
-       copy_field = bt_ctf_event_get_payload_field(copy);
-
-       if (!orig_field) {
-               ok(!copy_field, "original and copied events have no payload");
-       } else {
-               ok(orig_field != copy_field,
-                       "original and copied events payloads are different pointers");
-       }
-
-       bt_put(orig_field);
-       bt_put(copy_field);
-
-       bt_put(copy);
-}
-
 void append_simple_event(struct bt_ctf_stream_class *stream_class,
                struct bt_ctf_stream *stream, struct bt_ctf_clock *clock)
 {
@@ -724,7 +641,6 @@ void append_simple_event(struct bt_ctf_stream_class *stream_class,
        ok(!bt_ctf_event_set_event_context(simple_event, event_context),
                "Set an event context successfully");
 
-       event_copy_tests(simple_event);
        ok(bt_ctf_stream_append_event(stream, simple_event) == 0,
                "Append simple event to trace stream");
 
This page took 0.028322 seconds and 4 git commands to generate.