8811cf90ab6cfb0b21e320ff1d4f3b41de26ae06
[babeltrace.git] / tests / lib / test_trace_ir_ref.c
1 /*
2 * test_trace_ir_ref.c
3 *
4 * Trace IR Reference Count test
5 *
6 * Copyright 2016 - Jérémie Galarneau <jeremie.galarneau@efficios.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; under version 2 of the License.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 */
21
22 #include <stdio.h>
23 #include "tap/tap.h"
24 #include <babeltrace2/babeltrace.h>
25 #include "lib/object.h"
26 #include "compat/stdlib.h"
27 #include "common/assert.h"
28 #include <babeltrace2-ctf-writer/writer.h>
29 #include <babeltrace2-ctf-writer/clock.h>
30 #include <babeltrace2-ctf-writer/clock-class.h>
31 #include <babeltrace2-ctf-writer/stream.h>
32 #include <babeltrace2-ctf-writer/event.h>
33 #include <babeltrace2-ctf-writer/event-types.h>
34 #include <babeltrace2-ctf-writer/event-fields.h>
35 #include <babeltrace2-ctf-writer/stream-class.h>
36 #include <babeltrace2-ctf-writer/trace.h>
37 #include "common.h"
38
39 #define NR_TESTS 37
40
41 struct user {
42 bt_trace_class *tc;
43 bt_stream_class *sc;
44 bt_event_class *ec;
45 bt_stream *stream;
46 bt_event *event;
47 };
48
49 struct writer_user {
50 struct bt_ctf_writer *writer;
51 struct bt_ctf_trace *tc;
52 struct bt_ctf_stream_class *sc;
53 struct bt_ctf_event_class *ec;
54 struct bt_ctf_stream *stream;
55 struct bt_ctf_event *event;
56 };
57
58 const char *writer_user_names[] = {
59 "writer",
60 "trace",
61 "stream class",
62 "event class",
63 "stream",
64 "event",
65 };
66
67 static const size_t WRITER_USER_NR_ELEMENTS =
68 sizeof(struct writer_user) / sizeof(void *);
69
70 /**
71 * Returns a structure containing the following fields:
72 * - uint8_t payload_8;
73 * - uint16_t payload_16;
74 * - uint32_t payload_32;
75 */
76 static bt_field_class *create_integer_struct(bt_trace_class *trace_class)
77 {
78 int ret;
79 bt_field_class *structure = NULL;
80 bt_field_class *ui8 = NULL, *ui16 = NULL, *ui32 = NULL;
81
82 structure = bt_field_class_structure_create(trace_class);
83 BT_ASSERT(structure);
84 ui8 = bt_field_class_integer_unsigned_create(trace_class);
85 BT_ASSERT(ui8);
86 bt_field_class_integer_set_field_value_range(ui8, 8);
87 ret = bt_field_class_structure_append_member(structure,
88 "payload_8", ui8);
89 BT_ASSERT(ret == 0);
90 ui16 = bt_field_class_integer_unsigned_create(trace_class);
91 BT_ASSERT(ui16);
92 bt_field_class_integer_set_field_value_range(ui16, 16);
93 ret = bt_field_class_structure_append_member(structure,
94 "payload_16", ui16);
95 BT_ASSERT(ret == 0);
96 ui32 = bt_field_class_integer_unsigned_create(trace_class);
97 BT_ASSERT(ui32);
98 bt_field_class_integer_set_field_value_range(ui32, 32);
99 ret = bt_field_class_structure_append_member(structure,
100 "payload_32", ui32);
101 BT_ASSERT(ret == 0);
102 BT_FIELD_CLASS_PUT_REF_AND_RESET(ui8);
103 BT_FIELD_CLASS_PUT_REF_AND_RESET(ui16);
104 BT_FIELD_CLASS_PUT_REF_AND_RESET(ui32);
105 return structure;
106 }
107
108 static struct bt_ctf_field_type *create_writer_integer_struct(void)
109 {
110 int ret;
111 struct bt_ctf_field_type *structure = NULL;
112 struct bt_ctf_field_type *ui8 = NULL, *ui16 = NULL, *ui32 = NULL;
113
114 structure = bt_ctf_field_type_structure_create();
115 BT_ASSERT(structure);
116 ui8 = bt_ctf_field_type_integer_create(8);
117 BT_ASSERT(ui8);
118 ret = bt_ctf_field_type_structure_add_field(structure, ui8,
119 "payload_8");
120 BT_ASSERT(ret == 0);
121 ui16 = bt_ctf_field_type_integer_create(16);
122 BT_ASSERT(ui16);
123 ret = bt_ctf_field_type_structure_add_field(structure, ui16,
124 "payload_16");
125 BT_ASSERT(ret == 0);
126 ui32 = bt_ctf_field_type_integer_create(32);
127 BT_ASSERT(ui32);
128 ret = bt_ctf_field_type_structure_add_field(structure, ui32,
129 "payload_32");
130 BT_ASSERT(ret == 0);
131 BT_OBJECT_PUT_REF_AND_RESET(ui8);
132 BT_OBJECT_PUT_REF_AND_RESET(ui16);
133 BT_OBJECT_PUT_REF_AND_RESET(ui32);
134 return structure;
135 }
136
137 /**
138 * A simple event has the following payload:
139 * - uint8_t payload_8;
140 * - uint16_t payload_16;
141 * - uint32_t payload_32;
142 */
143 static bt_event_class *create_simple_event(
144 bt_stream_class *sc, const char *name)
145 {
146 int ret;
147 bt_event_class *event = NULL;
148 bt_field_class *payload = NULL;
149
150 BT_ASSERT(name);
151 event = bt_event_class_create(sc);
152 BT_ASSERT(event);
153 ret = bt_event_class_set_name(event, name);
154 BT_ASSERT(ret == 0);
155 payload = create_integer_struct(bt_stream_class_borrow_trace_class(sc));
156 BT_ASSERT(payload);
157 ret = bt_event_class_set_payload_field_class(event, payload);
158 BT_ASSERT(ret == 0);
159 BT_FIELD_CLASS_PUT_REF_AND_RESET(payload);
160 return event;
161 }
162
163 /**
164 * A complex event has the following payload:
165 * - uint8_t payload_8;
166 * - uint16_t payload_16;
167 * - uint32_t payload_32;
168 * - struct payload_struct:
169 * - uint8_t payload_8;
170 * - uint16_t payload_16;
171 * - uint32_t payload_32;
172 */
173 static bt_event_class *create_complex_event(bt_stream_class *sc,
174 const char *name)
175 {
176 int ret;
177 bt_event_class *event = NULL;
178 bt_field_class *inner = NULL, *outer = NULL;
179 bt_trace_class *trace_class = bt_stream_class_borrow_trace_class(sc);
180
181 BT_ASSERT(name);
182 event = bt_event_class_create(sc);
183 BT_ASSERT(event);
184 ret = bt_event_class_set_name(event, name);
185 BT_ASSERT(ret == 0);
186 outer = create_integer_struct(trace_class);
187 BT_ASSERT(outer);
188 inner = create_integer_struct(trace_class);
189 BT_ASSERT(inner);
190 ret = bt_field_class_structure_append_member(outer,
191 "payload_struct", inner);
192 BT_ASSERT(ret == 0);
193 ret = bt_event_class_set_payload_field_class(event, outer);
194 BT_ASSERT(ret == 0);
195 BT_FIELD_CLASS_PUT_REF_AND_RESET(inner);
196 BT_FIELD_CLASS_PUT_REF_AND_RESET(outer);
197 return event;
198 }
199
200 static void create_sc1(bt_trace_class *trace_class)
201 {
202 int ret;
203 bt_event_class *ec1 = NULL, *ec2 = NULL;
204 bt_stream_class *sc1 = NULL, *ret_stream = NULL;
205
206 sc1 = bt_stream_class_create(trace_class);
207 BT_ASSERT(sc1);
208 ret = bt_stream_class_set_name(sc1, "sc1");
209 BT_ASSERT(ret == 0);
210 ec1 = create_complex_event(sc1, "ec1");
211 BT_ASSERT(ec1);
212 ec2 = create_simple_event(sc1, "ec2");
213 BT_ASSERT(ec2);
214 ret_stream = bt_event_class_borrow_stream_class(ec1);
215 ok(ret_stream == sc1, "Borrow parent stream SC1 from EC1");
216 ret_stream = bt_event_class_borrow_stream_class(ec2);
217 ok(ret_stream == sc1, "Borrow parent stream SC1 from EC2");
218 BT_EVENT_CLASS_PUT_REF_AND_RESET(ec1);
219 BT_EVENT_CLASS_PUT_REF_AND_RESET(ec2);
220 BT_STREAM_CLASS_PUT_REF_AND_RESET(sc1);
221 }
222
223 static void create_sc2(bt_trace_class *trace_class)
224 {
225 int ret;
226 bt_event_class *ec3 = NULL;
227 bt_stream_class *sc2 = NULL, *ret_stream = NULL;
228
229 sc2 = bt_stream_class_create(trace_class);
230 BT_ASSERT(sc2);
231 ret = bt_stream_class_set_name(sc2, "sc2");
232 BT_ASSERT(ret == 0);
233 ec3 = create_simple_event(sc2, "ec3");
234 ret_stream = bt_event_class_borrow_stream_class(ec3);
235 ok(ret_stream == sc2, "Borrow parent stream SC2 from EC3");
236 BT_EVENT_CLASS_PUT_REF_AND_RESET(ec3);
237 BT_STREAM_CLASS_PUT_REF_AND_RESET(sc2);
238 }
239
240 static bt_trace_class *create_tc1(bt_self_component_source *self_comp)
241 {
242 bt_trace_class *tc1 = NULL;
243
244 tc1 = bt_trace_class_create(
245 bt_self_component_source_as_self_component(self_comp));
246 BT_ASSERT(tc1);
247 create_sc1(tc1);
248 create_sc2(tc1);
249 return tc1;
250 }
251
252 static void init_weak_refs(bt_trace_class *tc,
253 bt_trace_class **tc1,
254 bt_stream_class **sc1,
255 bt_stream_class **sc2,
256 bt_event_class **ec1,
257 bt_event_class **ec2,
258 bt_event_class **ec3)
259 {
260 *tc1 = tc;
261 *sc1 = bt_trace_class_borrow_stream_class_by_index(tc, 0);
262 *sc2 = bt_trace_class_borrow_stream_class_by_index(tc, 1);
263 *ec1 = bt_stream_class_borrow_event_class_by_index(*sc1, 0);
264 *ec2 = bt_stream_class_borrow_event_class_by_index(*sc1, 1);
265 *ec3 = bt_stream_class_borrow_event_class_by_index(*sc2, 0);
266 }
267
268 static void test_example_scenario(bt_self_component_source *self_comp)
269 {
270 /*
271 * Weak pointers to trace IR objects are to be used very
272 * carefully. This is NOT a good practice and is strongly
273 * discouraged; this is only done to facilitate the validation
274 * of expected reference counts without affecting them by taking
275 * "real" references to the objects.
276 */
277 bt_trace_class *tc1 = NULL, *weak_tc1 = NULL;
278 bt_stream_class *weak_sc1 = NULL, *weak_sc2 = NULL;
279 bt_event_class *weak_ec1 = NULL, *weak_ec2 = NULL,
280 *weak_ec3 = NULL;
281 struct user user_a = { 0 }, user_b = { 0 }, user_c = { 0 };
282
283 /* The only reference which exists at this point is on TC1. */
284 tc1 = create_tc1(self_comp);
285 ok(tc1, "Initialize trace");
286 BT_ASSERT(tc1);
287 init_weak_refs(tc1, &weak_tc1, &weak_sc1, &weak_sc2, &weak_ec1,
288 &weak_ec2, &weak_ec3);
289 ok(bt_object_get_ref_count((void *) weak_sc1) == 0,
290 "Initial SC1 reference count is 0");
291 ok(bt_object_get_ref_count((void *) weak_sc2) == 0,
292 "Initial SC2 reference count is 0");
293 ok(bt_object_get_ref_count((void *) weak_ec1) == 0,
294 "Initial EC1 reference count is 0");
295 ok(bt_object_get_ref_count((void *) weak_ec2) == 0,
296 "Initial EC2 reference count is 0");
297 ok(bt_object_get_ref_count((void *) weak_ec3) == 0,
298 "Initial EC3 reference count is 0");
299
300 /* User A has ownership of the trace. */
301 BT_OBJECT_MOVE_REF(user_a.tc, tc1);
302 ok(bt_object_get_ref_count((void *) user_a.tc) == 1,
303 "TC1 reference count is 1");
304
305 /* User A acquires a reference to SC2 from TC1. */
306 user_a.sc = bt_trace_class_borrow_stream_class_by_index(
307 user_a.tc, 1);
308 bt_stream_class_get_ref(user_a.sc);
309 ok(user_a.sc, "User A acquires SC2 from TC1");
310 ok(bt_object_get_ref_count((void *) weak_tc1) == 2,
311 "TC1 reference count is 2");
312 ok(bt_object_get_ref_count((void *) weak_sc2) == 1,
313 "SC2 reference count is 1");
314
315 /* User A acquires a reference to EC3 from SC2. */
316 user_a.ec = bt_stream_class_borrow_event_class_by_index(
317 user_a.sc, 0);
318 bt_event_class_get_ref(user_a.ec);
319 ok(user_a.ec, "User A acquires EC3 from SC2");
320 ok(bt_object_get_ref_count((void *) weak_tc1) == 2,
321 "TC1 reference count is 2");
322 ok(bt_object_get_ref_count((void *) weak_sc2) == 2,
323 "SC2 reference count is 2");
324 ok(bt_object_get_ref_count((void *) weak_ec3) == 1,
325 "EC3 reference count is 1");
326
327 /* User A releases its reference to SC2. */
328 diag("User A releases SC2");
329 BT_STREAM_CLASS_PUT_REF_AND_RESET(user_a.sc);
330 /*
331 * We keep the pointer to SC2 around to validate its reference
332 * count.
333 */
334 ok(bt_object_get_ref_count((void *) weak_tc1) == 2,
335 "TC1 reference count is 2");
336 ok(bt_object_get_ref_count((void *) weak_sc2) == 1,
337 "SC2 reference count is 1");
338 ok(bt_object_get_ref_count((void *) weak_ec3) == 1,
339 "EC3 reference count is 1");
340
341 /* User A releases its reference to TC1. */
342 diag("User A releases TC1");
343 BT_TRACE_CLASS_PUT_REF_AND_RESET(user_a.tc);
344 /*
345 * We keep the pointer to TC1 around to validate its reference
346 * count.
347 */
348 ok(bt_object_get_ref_count((void *) weak_tc1) == 1,
349 "TC1 reference count is 1");
350 ok(bt_object_get_ref_count((void *) weak_sc2) == 1,
351 "SC2 reference count is 1");
352 ok(bt_object_get_ref_count((void *) weak_ec3) == 1,
353 "EC3 reference count is 1");
354
355 /* User B acquires a reference to SC1. */
356 diag("User B acquires a reference to SC1");
357 user_b.sc = weak_sc1;
358 bt_stream_class_get_ref(user_b.sc);
359 ok(bt_object_get_ref_count((void *) weak_tc1) == 2,
360 "TC1 reference count is 2");
361 ok(bt_object_get_ref_count((void *) weak_sc1) == 1,
362 "SC1 reference count is 1");
363
364 /* User C acquires a reference to EC1. */
365 diag("User C acquires a reference to EC1");
366 user_c.ec = bt_stream_class_borrow_event_class_by_index(
367 user_b.sc, 0);
368 bt_event_class_get_ref(user_c.ec);
369 ok(bt_object_get_ref_count((void *) weak_ec1) == 1,
370 "EC1 reference count is 1");
371 ok(bt_object_get_ref_count((void *) weak_sc1) == 2,
372 "SC1 reference count is 2");
373
374 /* User A releases its reference on EC3. */
375 diag("User A releases its reference on EC3");
376 BT_EVENT_CLASS_PUT_REF_AND_RESET(user_a.ec);
377 ok(bt_object_get_ref_count((void *) weak_ec3) == 0,
378 "EC3 reference count is 1");
379 ok(bt_object_get_ref_count((void *) weak_sc2) == 0,
380 "SC2 reference count is 0");
381 ok(bt_object_get_ref_count((void *) weak_tc1) == 1,
382 "TC1 reference count is 1");
383
384 /* User B releases its reference on SC1. */
385 diag("User B releases its reference on SC1");
386 BT_STREAM_CLASS_PUT_REF_AND_RESET(user_b.sc);
387 ok(bt_object_get_ref_count((void *) weak_sc1) == 1,
388 "SC1 reference count is 1");
389
390 /*
391 * User C is the sole owner of an object and is keeping the whole
392 * trace hierarchy "alive" by holding a reference to EC1.
393 */
394 ok(bt_object_get_ref_count((void *) weak_tc1) == 1,
395 "TC1 reference count is 1");
396 ok(bt_object_get_ref_count((void *) weak_sc1) == 1,
397 "SC1 reference count is 1");
398 ok(bt_object_get_ref_count((void *) weak_sc2) == 0,
399 "SC2 reference count is 0");
400 ok(bt_object_get_ref_count((void *) weak_ec1) == 1,
401 "EC1 reference count is 1");
402 ok(bt_object_get_ref_count((void *) weak_ec2) == 0,
403 "EC2 reference count is 0");
404 ok(bt_object_get_ref_count((void *) weak_ec3) == 0,
405 "EC3 reference count is 0");
406
407 /* Reclaim last reference held by User C. */
408 BT_EVENT_CLASS_PUT_REF_AND_RESET(user_c.ec);
409 }
410
411 static
412 bt_component_class_initialize_method_status src_init(
413 bt_self_component_source *self_comp,
414 bt_self_component_source_configuration *config,
415 const bt_value *params, void *init_method_data)
416 {
417 test_example_scenario(self_comp);
418 return BT_COMPONENT_CLASS_INITIALIZE_METHOD_STATUS_OK;
419 }
420
421 static
422 bt_message_iterator_class_next_method_status src_iter_next(
423 bt_self_message_iterator *self_iterator,
424 bt_message_array_const msgs, uint64_t capacity,
425 uint64_t *count)
426 {
427 return BT_MESSAGE_ITERATOR_CLASS_NEXT_METHOD_STATUS_ERROR;
428 }
429
430 static void test_example_scenario_in_graph(void)
431 {
432 bt_message_iterator_class *msg_iter_cls;
433 bt_component_class_source *comp_cls;
434 bt_graph *graph;
435 int ret;
436
437 msg_iter_cls = bt_message_iterator_class_create(src_iter_next);
438 BT_ASSERT(msg_iter_cls);
439
440 comp_cls = bt_component_class_source_create("src", msg_iter_cls);
441 BT_ASSERT(comp_cls);
442 ret = bt_component_class_source_set_initialize_method(comp_cls, src_init);
443 BT_ASSERT(ret == 0);
444 graph = bt_graph_create(0);
445 ret = bt_graph_add_source_component(graph, comp_cls, "src-comp",
446 NULL, BT_LOGGING_LEVEL_NONE, NULL);
447 BT_ASSERT(ret == 0);
448 bt_graph_put_ref(graph);
449 bt_component_class_source_put_ref(comp_cls);
450 bt_message_iterator_class_put_ref(msg_iter_cls);
451 }
452
453 static void create_writer_user_full(struct writer_user *user)
454 {
455 gchar *trace_path;
456 struct bt_ctf_field_type *ft;
457 struct bt_ctf_field *field;
458 struct bt_ctf_clock *clock;
459 int ret;
460
461 trace_path = g_build_filename(g_get_tmp_dir(), "ctfwriter_XXXXXX", NULL);
462 if (!bt_mkdtemp(trace_path)) {
463 perror("# perror");
464 }
465
466 user->writer = bt_ctf_writer_create(trace_path);
467 BT_ASSERT(user->writer);
468 ret = bt_ctf_writer_set_byte_order(user->writer,
469 BT_CTF_BYTE_ORDER_LITTLE_ENDIAN);
470 BT_ASSERT(ret == 0);
471 user->tc = bt_ctf_writer_get_trace(user->writer);
472 BT_ASSERT(user->tc);
473 user->sc = bt_ctf_stream_class_create("sc");
474 BT_ASSERT(user->sc);
475 clock = bt_ctf_clock_create("the_clock");
476 BT_ASSERT(clock);
477 ret = bt_ctf_writer_add_clock(user->writer, clock);
478 BT_ASSERT(!ret);
479 ret = bt_ctf_stream_class_set_clock(user->sc, clock);
480 BT_ASSERT(!ret);
481 BT_OBJECT_PUT_REF_AND_RESET(clock);
482 user->stream = bt_ctf_writer_create_stream(user->writer, user->sc);
483 BT_ASSERT(user->stream);
484 user->ec = bt_ctf_event_class_create("ec");
485 BT_ASSERT(user->ec);
486 ft = create_writer_integer_struct();
487 BT_ASSERT(ft);
488 ret = bt_ctf_event_class_set_payload_field_type(user->ec, ft);
489 BT_OBJECT_PUT_REF_AND_RESET(ft);
490 BT_ASSERT(!ret);
491 ret = bt_ctf_stream_class_add_event_class(user->sc, user->ec);
492 BT_ASSERT(!ret);
493 user->event = bt_ctf_event_create(user->ec);
494 BT_ASSERT(user->event);
495 field = bt_ctf_event_get_payload(user->event, "payload_8");
496 BT_ASSERT(field);
497 ret = bt_ctf_field_integer_unsigned_set_value(field, 10);
498 BT_ASSERT(!ret);
499 BT_OBJECT_PUT_REF_AND_RESET(field);
500 field = bt_ctf_event_get_payload(user->event, "payload_16");
501 BT_ASSERT(field);
502 ret = bt_ctf_field_integer_unsigned_set_value(field, 20);
503 BT_ASSERT(!ret);
504 BT_OBJECT_PUT_REF_AND_RESET(field);
505 field = bt_ctf_event_get_payload(user->event, "payload_32");
506 BT_ASSERT(field);
507 ret = bt_ctf_field_integer_unsigned_set_value(field, 30);
508 BT_ASSERT(!ret);
509 BT_OBJECT_PUT_REF_AND_RESET(field);
510 ret = bt_ctf_stream_append_event(user->stream, user->event);
511 BT_ASSERT(!ret);
512 recursive_rmdir(trace_path);
513 g_free(trace_path);
514 }
515
516 static void test_put_order_swap(size_t *array, size_t a, size_t b)
517 {
518 size_t temp = array[a];
519
520 array[a] = array[b];
521 array[b] = temp;
522 }
523
524 static void test_put_order_put_objects(size_t *array, size_t size)
525 {
526 size_t i;
527 struct writer_user user = { 0 };
528 void **objects = (void *) &user;
529
530 create_writer_user_full(&user);
531 printf("# ");
532
533 for (i = 0; i < size; ++i) {
534 void *obj = objects[array[i]];
535
536 printf("%s", writer_user_names[array[i]]);
537 BT_OBJECT_PUT_REF_AND_RESET(obj);
538
539 if (i < size - 1) {
540 printf(" -> ");
541 }
542 }
543
544 puts("");
545 }
546
547 static void test_put_order_permute(size_t *array, int k, size_t size)
548 {
549 if (k == 0) {
550 test_put_order_put_objects(array, size);
551 } else {
552 int i;
553
554 for (i = k - 1; i >= 0; i--) {
555 size_t next_k = k - 1;
556
557 test_put_order_swap(array, i, next_k);
558 test_put_order_permute(array, next_k, size);
559 test_put_order_swap(array, i, next_k);
560 }
561 }
562 }
563
564 static void test_put_order(void)
565 {
566 size_t i;
567 size_t array[WRITER_USER_NR_ELEMENTS];
568
569 /* Initialize array of indexes */
570 for (i = 0; i < WRITER_USER_NR_ELEMENTS; ++i) {
571 array[i] = i;
572 }
573
574 test_put_order_permute(array, WRITER_USER_NR_ELEMENTS,
575 WRITER_USER_NR_ELEMENTS);
576 }
577
578 /**
579 * The objective of this test is to implement and expand upon the scenario
580 * described in the reference counting documentation and ensure that any node of
581 * the Trace, Stream Class, Event Class, Stream and Event hiearchy keeps all
582 * other "alive" and reachable.
583 *
584 * External tools (e.g. valgrind) should be used to confirm that this
585 * known-good test does not leak memory.
586 */
587 int main(int argc, char **argv)
588 {
589 /* Initialize tap harness before any tests */
590 plan_tests(NR_TESTS);
591
592 test_example_scenario_in_graph();
593 test_put_order();
594
595 return exit_status();
596 }
This page took 0.0481 seconds and 3 git commands to generate.