diff options
22 files changed, 132 insertions, 114 deletions
diff --git a/src/include/gnunet_core_testing_lib.h b/src/include/gnunet_core_testing_lib.h index afb71b2cf..bf6f416d9 100644 --- a/src/include/gnunet_core_testing_lib.h +++ b/src/include/gnunet_core_testing_lib.h | |||
@@ -148,10 +148,10 @@ GNUNET_CORE_cmd_connect_peers ( | |||
148 | /** | 148 | /** |
149 | * Call #op on all simple traits. | 149 | * Call #op on all simple traits. |
150 | */ | 150 | */ |
151 | #define GNUNET_CORE_TESTING_SIMPLE_TRAITS(op) \ | 151 | #define GNUNET_CORE_TESTING_SIMPLE_TRAITS(op, prefix) \ |
152 | op (connect_peer_state, const struct GNUNET_TESTING_ConnectPeersState) | 152 | op (prefix, connect_peer_state, const struct GNUNET_TESTING_ConnectPeersState) |
153 | 153 | ||
154 | GNUNET_CORE_TESTING_SIMPLE_TRAITS (GNUNET_TESTING_MAKE_DECL_SIMPLE_TRAIT) | 154 | GNUNET_CORE_TESTING_SIMPLE_TRAITS (GNUNET_TESTING_MAKE_DECL_SIMPLE_TRAIT, GNUNET_CORE_TESTING) |
155 | 155 | ||
156 | 156 | ||
157 | 157 | ||
diff --git a/src/include/gnunet_testing_loop_lib.h b/src/include/gnunet_testing_loop_lib.h index e4a7653e8..7e13edfab 100644 --- a/src/include/gnunet_testing_loop_lib.h +++ b/src/include/gnunet_testing_loop_lib.h | |||
@@ -571,24 +571,32 @@ GNUNET_TESTING_get_trait (const struct GNUNET_TESTING_Trait *traits, | |||
571 | /** | 571 | /** |
572 | * Create headers for a trait with name @a name for | 572 | * Create headers for a trait with name @a name for |
573 | * statically allocated data of type @a type. | 573 | * statically allocated data of type @a type. |
574 | * | ||
575 | * @param prefix symbol prefix to use | ||
576 | * @param name name of the trait | ||
577 | * @param type data type for the trait | ||
574 | */ | 578 | */ |
575 | #define GNUNET_TESTING_MAKE_DECL_SIMPLE_TRAIT(name,type) \ | 579 | #define GNUNET_TESTING_MAKE_DECL_SIMPLE_TRAIT(prefix,name,type) \ |
576 | enum GNUNET_GenericReturnValue \ | 580 | enum GNUNET_GenericReturnValue \ |
577 | GNUNET_TESTING_get_trait_ ## name ( \ | 581 | prefix ## _get_trait_ ## name ( \ |
578 | const struct GNUNET_TESTING_Command *cmd, \ | 582 | const struct GNUNET_TESTING_Command *cmd, \ |
579 | type **ret); \ | 583 | type **ret); \ |
580 | struct GNUNET_TESTING_Trait \ | 584 | struct GNUNET_TESTING_Trait \ |
581 | GNUNET_TESTING_make_trait_ ## name ( \ | 585 | prefix ## _make_trait_ ## name ( \ |
582 | type * value); | 586 | type * value); |
583 | 587 | ||
584 | 588 | ||
585 | /** | 589 | /** |
586 | * Create C implementation for a trait with name @a name for statically | 590 | * Create C implementation for a trait with name @a name for statically |
587 | * allocated data of type @a type. | 591 | * allocated data of type @a type. |
592 | * | ||
593 | * @param prefix symbol prefix to use | ||
594 | * @param name name of the trait | ||
595 | * @param type data type for the trait | ||
588 | */ | 596 | */ |
589 | #define GNUNET_TESTING_MAKE_IMPL_SIMPLE_TRAIT(name,type) \ | 597 | #define GNUNET_TESTING_MAKE_IMPL_SIMPLE_TRAIT(prefix,name,type) \ |
590 | enum GNUNET_GenericReturnValue \ | 598 | enum GNUNET_GenericReturnValue \ |
591 | GNUNET_TESTING_get_trait_ ## name ( \ | 599 | prefix ## _get_trait_ ## name ( \ |
592 | const struct GNUNET_TESTING_Command *cmd, \ | 600 | const struct GNUNET_TESTING_Command *cmd, \ |
593 | type * *ret) \ | 601 | type * *ret) \ |
594 | { \ | 602 | { \ |
@@ -599,7 +607,7 @@ GNUNET_TESTING_get_trait (const struct GNUNET_TESTING_Trait *traits, | |||
599 | 0); \ | 607 | 0); \ |
600 | } \ | 608 | } \ |
601 | struct GNUNET_TESTING_Trait \ | 609 | struct GNUNET_TESTING_Trait \ |
602 | GNUNET_TESTING_make_trait_ ## name ( \ | 610 | prefix ## _make_trait_ ## name ( \ |
603 | type * value) \ | 611 | type * value) \ |
604 | { \ | 612 | { \ |
605 | struct GNUNET_TESTING_Trait ret = { \ | 613 | struct GNUNET_TESTING_Trait ret = { \ |
@@ -613,15 +621,19 @@ GNUNET_TESTING_get_trait (const struct GNUNET_TESTING_Trait *traits, | |||
613 | /** | 621 | /** |
614 | * Create headers for a trait with name @a name for | 622 | * Create headers for a trait with name @a name for |
615 | * statically allocated data of type @a type. | 623 | * statically allocated data of type @a type. |
624 | * | ||
625 | * @param prefix symbol prefix to use | ||
626 | * @param name name of the trait | ||
627 | * @param type data type for the trait | ||
616 | */ | 628 | */ |
617 | #define GNUNET_TESTING_MAKE_DECL_INDEXED_TRAIT(name,type) \ | 629 | #define GNUNET_TESTING_MAKE_DECL_INDEXED_TRAIT(prefix,name,type) \ |
618 | enum GNUNET_GenericReturnValue \ | 630 | enum GNUNET_GenericReturnValue \ |
619 | GNUNET_TESTING_get_trait_ ## name ( \ | 631 | prefix ## _get_trait_ ## name ( \ |
620 | const struct GNUNET_TESTING_Command *cmd, \ | 632 | const struct GNUNET_TESTING_Command *cmd, \ |
621 | unsigned int index, \ | 633 | unsigned int index, \ |
622 | type **ret); \ | 634 | type **ret); \ |
623 | struct GNUNET_TESTING_Trait \ | 635 | struct GNUNET_TESTING_Trait \ |
624 | GNUNET_TESTING_make_trait_ ## name ( \ | 636 | prefix ## _make_trait_ ## name ( \ |
625 | unsigned int index, \ | 637 | unsigned int index, \ |
626 | type *value); | 638 | type *value); |
627 | 639 | ||
@@ -630,9 +642,9 @@ GNUNET_TESTING_get_trait (const struct GNUNET_TESTING_Trait *traits, | |||
630 | * Create C implementation for a trait with name @a name for statically | 642 | * Create C implementation for a trait with name @a name for statically |
631 | * allocated data of type @a type. | 643 | * allocated data of type @a type. |
632 | */ | 644 | */ |
633 | #define GNUNET_TESTING_MAKE_IMPL_INDEXED_TRAIT(name,type) \ | 645 | #define GNUNET_TESTING_MAKE_IMPL_INDEXED_TRAIT(prefix,name,type) \ |
634 | enum GNUNET_GenericReturnValue \ | 646 | enum GNUNET_GenericReturnValue \ |
635 | GNUNET_TESTING_get_trait_ ## name ( \ | 647 | prefix ## _get_trait_ ## name ( \ |
636 | const struct GNUNET_TESTING_Command *cmd, \ | 648 | const struct GNUNET_TESTING_Command *cmd, \ |
637 | unsigned int index, \ | 649 | unsigned int index, \ |
638 | type * *ret) \ | 650 | type * *ret) \ |
@@ -644,7 +656,7 @@ GNUNET_TESTING_get_trait (const struct GNUNET_TESTING_Trait *traits, | |||
644 | index); \ | 656 | index); \ |
645 | } \ | 657 | } \ |
646 | struct GNUNET_TESTING_Trait \ | 658 | struct GNUNET_TESTING_Trait \ |
647 | GNUNET_TESTING_make_trait_ ## name ( \ | 659 | prefix ## _make_trait_ ## name ( \ |
648 | unsigned int index, \ | 660 | unsigned int index, \ |
649 | type * value) \ | 661 | type * value) \ |
650 | { \ | 662 | { \ |
@@ -659,21 +671,27 @@ GNUNET_TESTING_get_trait (const struct GNUNET_TESTING_Trait *traits, | |||
659 | 671 | ||
660 | /** | 672 | /** |
661 | * Call #op on all simple traits needed by loop logic. | 673 | * Call #op on all simple traits needed by loop logic. |
674 | * | ||
675 | * @param op operation to perform | ||
676 | * @param prefix prefix to pass to @e op | ||
662 | */ | 677 | */ |
663 | #define GNUNET_TESTING_LOOP_SIMPLE_TRAITS(op) \ | 678 | #define GNUNET_TESTING_LOOP_SIMPLE_TRAITS(op,prefix) \ |
664 | op (batch_cmds, struct GNUNET_TESTING_Command *) | 679 | op (prefix, batch_cmds, struct GNUNET_TESTING_Command *) |
665 | 680 | ||
666 | 681 | ||
667 | GNUNET_TESTING_LOOP_SIMPLE_TRAITS (GNUNET_TESTING_MAKE_DECL_SIMPLE_TRAIT) | 682 | GNUNET_TESTING_LOOP_SIMPLE_TRAITS(GNUNET_TESTING_MAKE_DECL_SIMPLE_TRAIT, GNUNET_TESTING) |
668 | 683 | ||
669 | 684 | ||
670 | /** | 685 | /** |
671 | * Call #op on all indexed traits needed by loop logic. | 686 | * Call #op on all indexed traits needed by loop logic. |
687 | * | ||
688 | * @param op operation to perform | ||
689 | * @param prefix prefix to pass to @e op | ||
672 | */ | 690 | */ |
673 | #define GNUNET_TESTING_LOOP_INDEXED_TRAITS(op) \ | 691 | #define GNUNET_TESTING_LOOP_INDEXED_TRAITS(op,prefix) \ |
674 | op (cmd, const struct GNUNET_TESTING_Command) | 692 | op (prefix, cmd, const struct GNUNET_TESTING_Command) |
675 | 693 | ||
676 | GNUNET_TESTING_LOOP_INDEXED_TRAITS (GNUNET_TESTING_MAKE_DECL_INDEXED_TRAIT) | 694 | GNUNET_TESTING_LOOP_INDEXED_TRAITS (GNUNET_TESTING_MAKE_DECL_INDEXED_TRAIT, GNUNET_TESTING) |
677 | 695 | ||
678 | 696 | ||
679 | #endif | 697 | #endif |
diff --git a/src/include/gnunet_testing_netjail_lib.h b/src/include/gnunet_testing_netjail_lib.h index 0d58e0f62..843fce0d5 100644 --- a/src/include/gnunet_testing_netjail_lib.h +++ b/src/include/gnunet_testing_netjail_lib.h | |||
@@ -520,11 +520,11 @@ GNUNET_TESTING_cmd_local_test_prepared (const char *label, | |||
520 | */ | 520 | */ |
521 | struct GNUNET_TESTING_Command | 521 | struct GNUNET_TESTING_Command |
522 | GNUNET_TESTING_cmd_start_peer (const char *label, | 522 | GNUNET_TESTING_cmd_start_peer (const char *label, |
523 | const char *system_label, | 523 | const char *system_label, |
524 | uint32_t no, | 524 | uint32_t no, |
525 | const char *node_ip, | 525 | const char *node_ip, |
526 | const char *cfgname, | 526 | const char *cfgname, |
527 | unsigned int broadcast); | 527 | unsigned int broadcast); |
528 | 528 | ||
529 | 529 | ||
530 | /* ***** Netjail trait support ***** */ | 530 | /* ***** Netjail trait support ***** */ |
@@ -533,14 +533,14 @@ GNUNET_TESTING_cmd_start_peer (const char *label, | |||
533 | /** | 533 | /** |
534 | * Call #op on all simple traits. | 534 | * Call #op on all simple traits. |
535 | */ | 535 | */ |
536 | #define GNUNET_TESTING_SIMPLE_NETJAIL_TRAITS(op) \ | 536 | #define GNUNET_TESTING_SIMPLE_NETJAIL_TRAITS(op, prefix) \ |
537 | op (test_system, const struct GNUNET_TESTING_System) \ | 537 | op (prefix, test_system, const struct GNUNET_TESTING_System) \ |
538 | op (async_context, struct GNUNET_TESTING_AsyncContext) \ | 538 | op (prefix, async_context, struct GNUNET_TESTING_AsyncContext) \ |
539 | op (helper_handles, const struct GNUNET_HELPER_Handle *) \ | 539 | op (prefix, helper_handles, const struct GNUNET_HELPER_Handle *) \ |
540 | op (local_prepared_state, const struct GNUNET_TESTING_LocalPreparedState) \ | 540 | op (prefix, local_prepared_state, const struct GNUNET_TESTING_LocalPreparedState) \ |
541 | op (block_state, struct GNUNET_TESTING_BlockState) | 541 | op (prefix, block_state, struct GNUNET_TESTING_BlockState) |
542 | 542 | ||
543 | GNUNET_TESTING_SIMPLE_NETJAIL_TRAITS (GNUNET_TESTING_MAKE_DECL_SIMPLE_TRAIT) | 543 | GNUNET_TESTING_SIMPLE_NETJAIL_TRAITS (GNUNET_TESTING_MAKE_DECL_SIMPLE_TRAIT, GNUNET_TESTING) |
544 | 544 | ||
545 | 545 | ||
546 | #endif | 546 | #endif |
diff --git a/src/include/gnunet_testing_ng_lib.h b/src/include/gnunet_testing_ng_lib.h index 7b19a0ab4..407f50bb7 100644 --- a/src/include/gnunet_testing_ng_lib.h +++ b/src/include/gnunet_testing_ng_lib.h | |||
@@ -89,27 +89,27 @@ GNUNET_TESTING_cmd_exec_bash_script (const char *label, | |||
89 | /** | 89 | /** |
90 | * Call #op on all simple traits. | 90 | * Call #op on all simple traits. |
91 | */ | 91 | */ |
92 | #define GNUNET_TESTING_SIMPLE_TRAITS(op) \ | 92 | #define GNUNET_TESTING_SIMPLE_TRAITS(op, prefix) \ |
93 | op (process, struct GNUNET_OS_Process *) | 93 | op (prefix, process, struct GNUNET_OS_Process *) |
94 | 94 | ||
95 | 95 | ||
96 | GNUNET_TESTING_SIMPLE_TRAITS (GNUNET_TESTING_MAKE_DECL_SIMPLE_TRAIT) | 96 | GNUNET_TESTING_SIMPLE_TRAITS (GNUNET_TESTING_MAKE_DECL_SIMPLE_TRAIT, GNUNET_TESTING) |
97 | 97 | ||
98 | /** | 98 | /** |
99 | * Call #op on all indexed traits. | 99 | * Call #op on all indexed traits. |
100 | */ | 100 | */ |
101 | #define GNUNET_TESTING_INDEXED_TRAITS(op) \ | 101 | #define GNUNET_TESTING_INDEXED_TRAITS(op, prefix) \ |
102 | op (uint32, const uint32_t) \ | 102 | op (prefix, uint32, const uint32_t) \ |
103 | op (uint64, const uint64_t) \ | 103 | op (prefix, uint64, const uint64_t) \ |
104 | op (int64, const int64_t) \ | 104 | op (prefix, int64, const int64_t) \ |
105 | op (uint, const unsigned int) \ | 105 | op (prefix, uint, const unsigned int) \ |
106 | op (string, const char) \ | 106 | op (prefix, string, const char) \ |
107 | op (uuid, const struct GNUNET_Uuid) \ | 107 | op (prefix, uuid, const struct GNUNET_Uuid) \ |
108 | op (time, const struct GNUNET_TIME_Absolute) \ | 108 | op (prefix, time, const struct GNUNET_TIME_Absolute) \ |
109 | op (absolute_time, const struct GNUNET_TIME_Absolute) \ | 109 | op (prefix, absolute_time, const struct GNUNET_TIME_Absolute) \ |
110 | op (relative_time, const struct GNUNET_TIME_Relative) | 110 | op (prefix, relative_time, const struct GNUNET_TIME_Relative) |
111 | 111 | ||
112 | GNUNET_TESTING_INDEXED_TRAITS (GNUNET_TESTING_MAKE_DECL_INDEXED_TRAIT) | 112 | GNUNET_TESTING_INDEXED_TRAITS (GNUNET_TESTING_MAKE_DECL_INDEXED_TRAIT, GNUNET_TESTING) |
113 | 113 | ||
114 | 114 | ||
115 | #endif | 115 | #endif |
diff --git a/src/include/gnunet_transport_testing_ng_lib.h b/src/include/gnunet_transport_testing_ng_lib.h index b11fe6373..be904cf4c 100644 --- a/src/include/gnunet_transport_testing_ng_lib.h +++ b/src/include/gnunet_transport_testing_ng_lib.h | |||
@@ -196,16 +196,16 @@ GNUNET_TESTING_get_peer (unsigned int num, | |||
196 | /** | 196 | /** |
197 | * Call #op on all simple traits. | 197 | * Call #op on all simple traits. |
198 | */ | 198 | */ |
199 | #define GNUNET_TRANSPORT_TESTING_SIMPLE_TRAITS(op) \ | 199 | #define GNUNET_TRANSPORT_TESTING_SIMPLE_TRAITS(op, prefix) \ |
200 | op (connected_peers_map, const struct GNUNET_CONTAINER_MultiShortmap) \ | 200 | op (prefix, connected_peers_map, const struct GNUNET_CONTAINER_MultiShortmap) \ |
201 | op (peer_id, const struct GNUNET_PeerIdentity) \ | 201 | op (prefix, peer_id, const struct GNUNET_PeerIdentity) \ |
202 | op (hello_size, const size_t) \ | 202 | op (prefix, hello_size, const size_t) \ |
203 | op (hello, const char) \ | 203 | op (prefix, hello, const char) \ |
204 | op (application_handle, const struct GNUNET_TRANSPORT_ApplicationHandle) \ | 204 | op (prefix, application_handle, const struct GNUNET_TRANSPORT_ApplicationHandle) \ |
205 | op (state, const struct GNUNET_TESTING_StartPeerState) \ | 205 | op (prefix, state, const struct GNUNET_TESTING_StartPeerState) \ |
206 | op (broadcast, const enum GNUNET_GenericReturnValue) | 206 | op (prefix, broadcast, const enum GNUNET_GenericReturnValue) |
207 | 207 | ||
208 | 208 | ||
209 | GNUNET_TRANSPORT_TESTING_SIMPLE_TRAITS (GNUNET_TESTING_MAKE_DECL_SIMPLE_TRAIT) | 209 | GNUNET_TRANSPORT_TESTING_SIMPLE_TRAITS (GNUNET_TESTING_MAKE_DECL_SIMPLE_TRAIT, GNUNET_TRANSPORT_TESTING) |
210 | 210 | ||
211 | #endif | 211 | #endif |
diff --git a/src/service/core/core_api_cmd_connecting_peers.c b/src/service/core/core_api_cmd_connecting_peers.c index 97cb8c4a6..a6aa818fa 100644 --- a/src/service/core/core_api_cmd_connecting_peers.c +++ b/src/service/core/core_api_cmd_connecting_peers.c | |||
@@ -63,9 +63,9 @@ connect_peers_run (void *cls, | |||
63 | cps->is = is; | 63 | cps->is = is; |
64 | peer1_cmd = GNUNET_TESTING_interpreter_lookup_command (is, | 64 | peer1_cmd = GNUNET_TESTING_interpreter_lookup_command (is, |
65 | cps->start_peer_label); | 65 | cps->start_peer_label); |
66 | GNUNET_TESTING_get_trait_broadcast (peer1_cmd, | 66 | GNUNET_TRANSPORT_TESTING_get_trait_broadcast (peer1_cmd, |
67 | &broadcast); | 67 | &broadcast); |
68 | GNUNET_TESTING_get_trait_state (peer1_cmd, | 68 | GNUNET_TRANSPORT_TESTING_get_trait_state (peer1_cmd, |
69 | &sps); | 69 | &sps); |
70 | 70 | ||
71 | system_cmd = GNUNET_TESTING_interpreter_lookup_command (is, | 71 | system_cmd = GNUNET_TESTING_interpreter_lookup_command (is, |
@@ -198,7 +198,7 @@ connect_peers_traits (void *cls, | |||
198 | { | 198 | { |
199 | struct GNUNET_TESTING_ConnectPeersState *cps = cls; | 199 | struct GNUNET_TESTING_ConnectPeersState *cps = cls; |
200 | struct GNUNET_TESTING_Trait traits[] = { | 200 | struct GNUNET_TESTING_Trait traits[] = { |
201 | GNUNET_TESTING_make_trait_connect_peer_state ((const void *) cps), | 201 | GNUNET_CORE_TESTING_make_trait_connect_peer_state ((const void *) cps), |
202 | GNUNET_TESTING_trait_end () | 202 | GNUNET_TESTING_trait_end () |
203 | }; | 203 | }; |
204 | return GNUNET_TESTING_get_trait (traits, | 204 | return GNUNET_TESTING_get_trait (traits, |
@@ -274,5 +274,5 @@ GNUNET_CORE_cmd_connect_peers ( | |||
274 | 274 | ||
275 | 275 | ||
276 | // FIXME: likely not ideally placed here, move to its own file | 276 | // FIXME: likely not ideally placed here, move to its own file |
277 | GNUNET_CORE_TESTING_SIMPLE_TRAITS (GNUNET_TESTING_MAKE_IMPL_SIMPLE_TRAIT) | 277 | GNUNET_CORE_TESTING_SIMPLE_TRAITS (GNUNET_TESTING_MAKE_IMPL_SIMPLE_TRAIT, GNUNET_CORE_TESTING) |
278 | 278 | ||
diff --git a/src/service/testing/testing_api_traits.c b/src/service/testing/testing_api_traits.c index ddd04ac30..18faa2d04 100644 --- a/src/service/testing/testing_api_traits.c +++ b/src/service/testing/testing_api_traits.c | |||
@@ -34,15 +34,15 @@ | |||
34 | 34 | ||
35 | /* FIXME: move these into respective sub-libs? */ | 35 | /* FIXME: move these into respective sub-libs? */ |
36 | 36 | ||
37 | GNUNET_TESTING_SIMPLE_TRAITS (GNUNET_TESTING_MAKE_IMPL_SIMPLE_TRAIT) | 37 | GNUNET_TESTING_SIMPLE_TRAITS (GNUNET_TESTING_MAKE_IMPL_SIMPLE_TRAIT, GNUNET_TESTING) |
38 | 38 | ||
39 | GNUNET_TESTING_INDEXED_TRAITS (GNUNET_TESTING_MAKE_IMPL_INDEXED_TRAIT) | 39 | GNUNET_TESTING_INDEXED_TRAITS (GNUNET_TESTING_MAKE_IMPL_INDEXED_TRAIT, GNUNET_TESTING) |
40 | 40 | ||
41 | GNUNET_TESTING_LOOP_SIMPLE_TRAITS (GNUNET_TESTING_MAKE_IMPL_SIMPLE_TRAIT) | 41 | GNUNET_TESTING_LOOP_SIMPLE_TRAITS (GNUNET_TESTING_MAKE_IMPL_SIMPLE_TRAIT, GNUNET_TESTING) |
42 | 42 | ||
43 | GNUNET_TESTING_LOOP_INDEXED_TRAITS (GNUNET_TESTING_MAKE_IMPL_INDEXED_TRAIT) | 43 | GNUNET_TESTING_LOOP_INDEXED_TRAITS (GNUNET_TESTING_MAKE_IMPL_INDEXED_TRAIT, GNUNET_TESTING) |
44 | 44 | ||
45 | GNUNET_TESTING_SIMPLE_NETJAIL_TRAITS (GNUNET_TESTING_MAKE_IMPL_SIMPLE_TRAIT) | 45 | GNUNET_TESTING_SIMPLE_NETJAIL_TRAITS (GNUNET_TESTING_MAKE_IMPL_SIMPLE_TRAIT, GNUNET_TESTING) |
46 | 46 | ||
47 | /** | 47 | /** |
48 | * End a trait array. Usually, commands offer several traits, | 48 | * End a trait array. Usually, commands offer several traits, |
diff --git a/src/service/transport/test_transport_plugin_cmd_nat_upnp.c b/src/service/transport/test_transport_plugin_cmd_nat_upnp.c index 4163ab68b..01e3e8b72 100644 --- a/src/service/transport/test_transport_plugin_cmd_nat_upnp.c +++ b/src/service/transport/test_transport_plugin_cmd_nat_upnp.c | |||
@@ -148,7 +148,7 @@ notify_connect (struct GNUNET_TESTING_Interpreter *is, | |||
148 | 148 | ||
149 | cmd = GNUNET_TESTING_interpreter_lookup_command (is, | 149 | cmd = GNUNET_TESTING_interpreter_lookup_command (is, |
150 | "connect-peers"); | 150 | "connect-peers"); |
151 | GNUNET_TESTING_get_trait_connect_peer_state (cmd, | 151 | GNUNET_TRANSPORT_TESTING_get_trait_connect_peer_state (cmd, |
152 | &cps); | 152 | &cps); |
153 | void *ret = NULL; | 153 | void *ret = NULL; |
154 | 154 | ||
diff --git a/src/service/transport/test_transport_plugin_cmd_simple_send.c b/src/service/transport/test_transport_plugin_cmd_simple_send.c index 9f34d4bcc..efef49826 100644 --- a/src/service/transport/test_transport_plugin_cmd_simple_send.c +++ b/src/service/transport/test_transport_plugin_cmd_simple_send.c | |||
@@ -151,7 +151,7 @@ notify_connect (struct GNUNET_TESTING_Interpreter *is, | |||
151 | 151 | ||
152 | cmd = GNUNET_TESTING_interpreter_lookup_command (is, | 152 | cmd = GNUNET_TESTING_interpreter_lookup_command (is, |
153 | "connect-peers"); | 153 | "connect-peers"); |
154 | GNUNET_TESTING_get_trait_connect_peer_state (cmd, | 154 | GNUNET_TRANSPORT_TESTING_get_trait_connect_peer_state (cmd, |
155 | &cps); | 155 | &cps); |
156 | void *ret = NULL; | 156 | void *ret = NULL; |
157 | 157 | ||
diff --git a/src/service/transport/test_transport_plugin_cmd_simple_send_dv.c b/src/service/transport/test_transport_plugin_cmd_simple_send_dv.c index 695344287..b92736eaa 100644 --- a/src/service/transport/test_transport_plugin_cmd_simple_send_dv.c +++ b/src/service/transport/test_transport_plugin_cmd_simple_send_dv.c | |||
@@ -91,11 +91,11 @@ handle_test (void *cls, | |||
91 | struct GNUNET_TRANSPORT_CoreHandle *ch; | 91 | struct GNUNET_TRANSPORT_CoreHandle *ch; |
92 | const struct GNUNET_TESTING_StartPeerState *sps; | 92 | const struct GNUNET_TESTING_StartPeerState *sps; |
93 | 93 | ||
94 | GNUNET_TESTING_get_trait_state (&start_peer, | 94 | GNUNET_TRANSPORT_TESTING_get_trait_state (&start_peer, |
95 | &sps); | 95 | &sps); |
96 | ch = sps->th; | 96 | ch = sps->th; |
97 | GNUNET_TESTING_get_trait_connected_peers_map (&start_peer, | 97 | GNUNET_TRANSPORT_TESTING_get_trait_connected_peers_map (&start_peer, |
98 | &connected_peers_map); | 98 | &connected_peers_map); |
99 | 99 | ||
100 | if (NULL != connected_peers_map) | 100 | if (NULL != connected_peers_map) |
101 | { | 101 | { |
@@ -210,8 +210,8 @@ notify_connect (struct GNUNET_TESTING_Interpreter *is, | |||
210 | cmd = GNUNET_TESTING_interpreter_lookup_command_all (is, | 210 | cmd = GNUNET_TESTING_interpreter_lookup_command_all (is, |
211 | "connect-peers"); | 211 | "connect-peers"); |
212 | // FIXME: check return value! | 212 | // FIXME: check return value! |
213 | GNUNET_TESTING_get_trait_connect_peer_state (cmd, | 213 | GNUNET_TRANSPORT_TESTING_get_trait_connect_peer_state (cmd, |
214 | &cps); | 214 | &cps); |
215 | cps->notify_connect (is, | 215 | cps->notify_connect (is, |
216 | peer); | 216 | peer); |
217 | return NULL; | 217 | return NULL; |
diff --git a/src/service/transport/test_transport_plugin_cmd_simple_send_performance.c b/src/service/transport/test_transport_plugin_cmd_simple_send_performance.c index d44eab9e1..d00e5c318 100644 --- a/src/service/transport/test_transport_plugin_cmd_simple_send_performance.c +++ b/src/service/transport/test_transport_plugin_cmd_simple_send_performance.c | |||
@@ -114,7 +114,7 @@ handle_test (void *cls, | |||
114 | const struct GNUNET_TESTING_StartPeerState *sps; | 114 | const struct GNUNET_TESTING_StartPeerState *sps; |
115 | 115 | ||
116 | 116 | ||
117 | GNUNET_TESTING_get_trait_state (&start_peer, | 117 | GNUNET_TRANSPORT_TESTING_get_trait_state (&start_peer, |
118 | &sps); | 118 | &sps); |
119 | ch = sps->th; | 119 | ch = sps->th; |
120 | num = ntohl (message->num); | 120 | num = ntohl (message->num); |
@@ -254,7 +254,7 @@ notify_connect (struct GNUNET_TESTING_Interpreter *is, | |||
254 | 254 | ||
255 | cmd = GNUNET_TESTING_interpreter_lookup_command (is, | 255 | cmd = GNUNET_TESTING_interpreter_lookup_command (is, |
256 | "connect-peers"); | 256 | "connect-peers"); |
257 | GNUNET_TESTING_get_trait_connect_peer_state (cmd, | 257 | GNUNET_TRANSPORT_TESTING_get_trait_connect_peer_state (cmd, |
258 | &cps); | 258 | &cps); |
259 | void *ret = NULL; | 259 | void *ret = NULL; |
260 | 260 | ||
diff --git a/src/service/transport/test_transport_plugin_cmd_udp_backchannel.c b/src/service/transport/test_transport_plugin_cmd_udp_backchannel.c index 15677eca8..75fb85e66 100644 --- a/src/service/transport/test_transport_plugin_cmd_udp_backchannel.c +++ b/src/service/transport/test_transport_plugin_cmd_udp_backchannel.c | |||
@@ -146,8 +146,8 @@ notify_connect (struct GNUNET_TESTING_Interpreter *is, | |||
146 | { | 146 | { |
147 | const struct ConnectPeersState *cps; | 147 | const struct ConnectPeersState *cps; |
148 | 148 | ||
149 | GNUNET_TESTING_get_trait_connect_peer_state (&connect_peers, | 149 | GNUNET_TRANSPORT_TESTING_get_trait_connect_peer_state (&connect_peers, |
150 | &cps); | 150 | &cps); |
151 | void *ret = NULL; | 151 | void *ret = NULL; |
152 | 152 | ||
153 | cps->notify_connect (is, | 153 | cps->notify_connect (is, |
diff --git a/src/service/transport/testing_api_cmd_start_peer.c b/src/service/transport/testing_api_cmd_start_peer.c index 3932be74b..4454b2939 100644 --- a/src/service/transport/testing_api_cmd_start_peer.c +++ b/src/service/transport/testing_api_cmd_start_peer.c | |||
@@ -248,15 +248,15 @@ start_peer_traits (void *cls, | |||
248 | char *hello = sps->hello; | 248 | char *hello = sps->hello; |
249 | size_t hello_size = sps->hello_size; | 249 | size_t hello_size = sps->hello_size; |
250 | struct GNUNET_TESTING_Trait traits[] = { | 250 | struct GNUNET_TESTING_Trait traits[] = { |
251 | GNUNET_TESTING_make_trait_application_handle ((const void *) ah), | 251 | GNUNET_TRANSPORT_TESTING_make_trait_application_handle ((const void *) ah), |
252 | GNUNET_TESTING_make_trait_peer_id ((const void *) id), | 252 | GNUNET_TRANSPORT_TESTING_make_trait_peer_id ((const void *) id), |
253 | GNUNET_TESTING_make_trait_connected_peers_map ((const | 253 | GNUNET_TRANSPORT_TESTING_make_trait_connected_peers_map ((const |
254 | void *) | 254 | void *) |
255 | connected_peers_map), | 255 | connected_peers_map), |
256 | GNUNET_TESTING_make_trait_hello ((const void *) hello), | 256 | GNUNET_TRANSPORT_TESTING_make_trait_hello ((const void *) hello), |
257 | GNUNET_TESTING_make_trait_hello_size ((const void *) hello_size), | 257 | GNUNET_TRANSPORT_TESTING_make_trait_hello_size ((const void *) hello_size), |
258 | GNUNET_TESTING_make_trait_state ((const void *) sps), | 258 | GNUNET_TRANSPORT_TESTING_make_trait_state ((const void *) sps), |
259 | GNUNET_TESTING_make_trait_broadcast ((const void *) &sps->broadcast), | 259 | GNUNET_TRANSPORT_TESTING_make_trait_broadcast ((const void *) &sps->broadcast), |
260 | GNUNET_TESTING_trait_end () | 260 | GNUNET_TESTING_trait_end () |
261 | }; | 261 | }; |
262 | 262 | ||
diff --git a/src/service/transport/testing_api_cmd_stop_peer.c b/src/service/transport/testing_api_cmd_stop_peer.c index 76a63e319..ce8d824f5 100644 --- a/src/service/transport/testing_api_cmd_stop_peer.c +++ b/src/service/transport/testing_api_cmd_stop_peer.c | |||
@@ -59,8 +59,8 @@ stop_peer_run (void *cls, | |||
59 | 59 | ||
60 | start_cmd = GNUNET_TESTING_interpreter_lookup_command (is, | 60 | start_cmd = GNUNET_TESTING_interpreter_lookup_command (is, |
61 | stop_ps->start_label); | 61 | stop_ps->start_label); |
62 | GNUNET_TESTING_get_trait_state (start_cmd, | 62 | GNUNET_TRANSPORT_TESTING_get_trait_state (start_cmd, |
63 | &sps); | 63 | &sps); |
64 | 64 | ||
65 | if (NULL != sps->peer) | 65 | if (NULL != sps->peer) |
66 | { | 66 | { |
diff --git a/src/service/transport/transport-testing-cmds.h b/src/service/transport/transport-testing-cmds.h index 057f6ea14..7ebc84d11 100644 --- a/src/service/transport/transport-testing-cmds.h +++ b/src/service/transport/transport-testing-cmds.h | |||
@@ -263,10 +263,10 @@ GNUNET_TRANSPORT_cmd_backchannel_check (const char *label, | |||
263 | /** | 263 | /** |
264 | * Call #op on all simple traits. | 264 | * Call #op on all simple traits. |
265 | */ | 265 | */ |
266 | #define GNUNET_TRANSPORT_SIMPLE_TRAITS(op) \ | 266 | #define GNUNET_TRANSPORT_SIMPLE_TRAITS(op, prefix) \ |
267 | op (connect_peer_state, const struct ConnectPeersState) | 267 | op (prefix, connect_peer_state, const struct ConnectPeersState) |
268 | 268 | ||
269 | GNUNET_TRANSPORT_SIMPLE_TRAITS (GNUNET_TESTING_MAKE_DECL_SIMPLE_TRAIT) | 269 | GNUNET_TRANSPORT_SIMPLE_TRAITS (GNUNET_TESTING_MAKE_DECL_SIMPLE_TRAIT, GNUNET_TRANSPORT_TESTING) |
270 | 270 | ||
271 | 271 | ||
272 | #endif | 272 | #endif |
diff --git a/src/service/transport/transport_api_cmd_backchannel_check.c b/src/service/transport/transport_api_cmd_backchannel_check.c index 0b57ddabd..f23230798 100644 --- a/src/service/transport/transport_api_cmd_backchannel_check.c +++ b/src/service/transport/transport_api_cmd_backchannel_check.c | |||
@@ -417,8 +417,8 @@ backchannel_check_run (void *cls, | |||
417 | 417 | ||
418 | peer1_cmd = GNUNET_TESTING_interpreter_lookup_command (is, | 418 | peer1_cmd = GNUNET_TESTING_interpreter_lookup_command (is, |
419 | cs->start_peer_label); | 419 | cs->start_peer_label); |
420 | GNUNET_TESTING_get_trait_application_handle (peer1_cmd, | 420 | GNUNET_TRANSPORT_TESTING_get_trait_application_handle (peer1_cmd, |
421 | &ah); | 421 | &ah); |
422 | 422 | ||
423 | system_cmd = GNUNET_TESTING_interpreter_lookup_command (is, | 423 | system_cmd = GNUNET_TESTING_interpreter_lookup_command (is, |
424 | cs->create_label); | 424 | cs->create_label); |
diff --git a/src/service/transport/transport_api_cmd_connecting_peers.c b/src/service/transport/transport_api_cmd_connecting_peers.c index 8498efa42..b7c072169 100644 --- a/src/service/transport/transport_api_cmd_connecting_peers.c +++ b/src/service/transport/transport_api_cmd_connecting_peers.c | |||
@@ -67,19 +67,19 @@ connect_peers_run (void *cls, | |||
67 | { | 67 | { |
68 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 68 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
69 | "Wait for connect.\n"); | 69 | "Wait for connect.\n"); |
70 | GNUNET_TESTING_get_trait_application_handle (peer1_cmd, | 70 | GNUNET_TRANSPORT_TESTING_get_trait_application_handle (peer1_cmd, |
71 | &ah); | 71 | &ah); |
72 | } | 72 | } |
73 | else | 73 | else |
74 | { | 74 | { |
75 | LOG (GNUNET_ERROR_TYPE_DEBUG, | 75 | LOG (GNUNET_ERROR_TYPE_DEBUG, |
76 | "Not waiting for connect.\n"); | 76 | "Not waiting for connect.\n"); |
77 | GNUNET_TESTING_get_trait_application_handle (peer1_cmd, | 77 | GNUNET_TRANSPORT_TESTING_get_trait_application_handle (peer1_cmd, |
78 | &ah); | 78 | &ah); |
79 | } | 79 | } |
80 | 80 | ||
81 | GNUNET_TESTING_get_trait_broadcast (peer1_cmd, | 81 | GNUNET_TRANSPORT_TESTING_get_trait_broadcast (peer1_cmd, |
82 | &broadcast); | 82 | &broadcast); |
83 | 83 | ||
84 | system_cmd = GNUNET_TESTING_interpreter_lookup_command (is, | 84 | system_cmd = GNUNET_TESTING_interpreter_lookup_command (is, |
85 | cps->create_label); | 85 | cps->create_label); |
@@ -249,7 +249,7 @@ connect_peers_traits (void *cls, | |||
249 | { | 249 | { |
250 | struct ConnectPeersState *cps = cls; | 250 | struct ConnectPeersState *cps = cls; |
251 | struct GNUNET_TESTING_Trait traits[] = { | 251 | struct GNUNET_TESTING_Trait traits[] = { |
252 | GNUNET_TESTING_make_trait_connect_peer_state ((const void *) cps), | 252 | GNUNET_TRANSPORT_TESTING_make_trait_connect_peer_state ((const void *) cps), |
253 | GNUNET_TESTING_trait_end () | 253 | GNUNET_TESTING_trait_end () |
254 | }; | 254 | }; |
255 | return GNUNET_TESTING_get_trait (traits, | 255 | return GNUNET_TESTING_get_trait (traits, |
@@ -310,4 +310,4 @@ GNUNET_TRANSPORT_cmd_connect_peers (const char *label, | |||
310 | 310 | ||
311 | 311 | ||
312 | // FIXME: likely not ideally placed here, move to its own file | 312 | // FIXME: likely not ideally placed here, move to its own file |
313 | GNUNET_TRANSPORT_TESTING_SIMPLE_TRAITS (GNUNET_TESTING_MAKE_IMPL_SIMPLE_TRAIT) | 313 | GNUNET_TRANSPORT_TESTING_SIMPLE_TRAITS (GNUNET_TESTING_MAKE_IMPL_SIMPLE_TRAIT, GNUNET_TRANSPORT_TESTING) |
diff --git a/src/service/transport/transport_api_cmd_send_simple.c b/src/service/transport/transport_api_cmd_send_simple.c index 4013a1556..3e732ffc9 100644 --- a/src/service/transport/transport_api_cmd_send_simple.c +++ b/src/service/transport/transport_api_cmd_send_simple.c | |||
@@ -122,7 +122,7 @@ send_simple_run (void *cls, | |||
122 | 122 | ||
123 | peer1_cmd = GNUNET_TESTING_interpreter_lookup_command (is, | 123 | peer1_cmd = GNUNET_TESTING_interpreter_lookup_command (is, |
124 | sss->start_peer_label); | 124 | sss->start_peer_label); |
125 | GNUNET_TESTING_get_trait_connected_peers_map (peer1_cmd, | 125 | GNUNET_TRANSPORT_TESTING_get_trait_connected_peers_map (peer1_cmd, |
126 | &connected_peers_map); | 126 | &connected_peers_map); |
127 | 127 | ||
128 | system_cmd = GNUNET_TESTING_interpreter_lookup_command (is, | 128 | system_cmd = GNUNET_TESTING_interpreter_lookup_command (is, |
diff --git a/src/service/transport/transport_api_cmd_send_simple_performance.c b/src/service/transport/transport_api_cmd_send_simple_performance.c index d6581c4e1..5979e47fe 100644 --- a/src/service/transport/transport_api_cmd_send_simple_performance.c +++ b/src/service/transport/transport_api_cmd_send_simple_performance.c | |||
@@ -173,8 +173,8 @@ send_simple_run (void *cls, | |||
173 | 173 | ||
174 | peer1_cmd = GNUNET_TESTING_interpreter_lookup_command (is, | 174 | peer1_cmd = GNUNET_TESTING_interpreter_lookup_command (is, |
175 | sss->start_peer_label); | 175 | sss->start_peer_label); |
176 | GNUNET_TESTING_get_trait_connected_peers_map (peer1_cmd, | 176 | GNUNET_TRANSPORT_TESTING_get_trait_connected_peers_map (peer1_cmd, |
177 | &connected_peers_map); | 177 | &connected_peers_map); |
178 | 178 | ||
179 | system_cmd = GNUNET_TESTING_interpreter_lookup_command (is, | 179 | system_cmd = GNUNET_TESTING_interpreter_lookup_command (is, |
180 | sss->create_label); | 180 | sss->create_label); |
diff --git a/src/service/transport/transport_api_cmd_start_peer.c b/src/service/transport/transport_api_cmd_start_peer.c index 642478109..24d731d77 100644 --- a/src/service/transport/transport_api_cmd_start_peer.c +++ b/src/service/transport/transport_api_cmd_start_peer.c | |||
@@ -420,15 +420,15 @@ start_peer_traits (void *cls, | |||
420 | 420 | ||
421 | 421 | ||
422 | struct GNUNET_TESTING_Trait traits[] = { | 422 | struct GNUNET_TESTING_Trait traits[] = { |
423 | GNUNET_TESTING_make_trait_application_handle ((const void *) ah), | 423 | GNUNET_TRANSPORT_TESTING_make_trait_application_handle ((const void *) ah), |
424 | GNUNET_TESTING_make_trait_peer_id ((const void *) id), | 424 | GNUNET_TRANSPORT_TESTING_make_trait_peer_id ((const void *) id), |
425 | GNUNET_TESTING_make_trait_connected_peers_map ((const | 425 | GNUNET_TRANSPORT_TESTING_make_trait_connected_peers_map ((const |
426 | void *) | 426 | void *) |
427 | connected_peers_map), | 427 | connected_peers_map), |
428 | GNUNET_TESTING_make_trait_hello ((const void *) hello), | 428 | GNUNET_TRANSPORT_TESTING_make_trait_hello ((const void *) hello), |
429 | GNUNET_TESTING_make_trait_hello_size ((const void *) hello_size), | 429 | GNUNET_TRANSPORT_TESTING_make_trait_hello_size ((const void *) hello_size), |
430 | GNUNET_TESTING_make_trait_state ((const void *) sps), | 430 | GNUNET_TRANSPORT_TESTING_make_trait_state ((const void *) sps), |
431 | GNUNET_TESTING_make_trait_broadcast ((const void *) &sps->broadcast), | 431 | GNUNET_TRANSPORT_TESTING_make_trait_broadcast ((const void *) &sps->broadcast), |
432 | GNUNET_TESTING_trait_end () | 432 | GNUNET_TESTING_trait_end () |
433 | }; | 433 | }; |
434 | 434 | ||
diff --git a/src/service/transport/transport_api_cmd_stop_peer.c b/src/service/transport/transport_api_cmd_stop_peer.c index cd6863711..333a3dae7 100644 --- a/src/service/transport/transport_api_cmd_stop_peer.c +++ b/src/service/transport/transport_api_cmd_stop_peer.c | |||
@@ -63,8 +63,8 @@ stop_peer_run (void *cls, | |||
63 | 63 | ||
64 | start_cmd = GNUNET_TESTING_interpreter_lookup_command (is, | 64 | start_cmd = GNUNET_TESTING_interpreter_lookup_command (is, |
65 | stop_ps->start_label); | 65 | stop_ps->start_label); |
66 | GNUNET_TESTING_get_trait_state (start_cmd, | 66 | GNUNET_TRANSPORT_TESTING_get_trait_state (start_cmd, |
67 | &sps); | 67 | &sps); |
68 | 68 | ||
69 | if (NULL != sps->pic) | 69 | if (NULL != sps->pic) |
70 | { | 70 | { |
diff --git a/src/service/transport/transport_api_traits.c b/src/service/transport/transport_api_traits.c index 78f306019..ec53f6f2b 100644 --- a/src/service/transport/transport_api_traits.c +++ b/src/service/transport/transport_api_traits.c | |||
@@ -29,4 +29,4 @@ | |||
29 | #include "transport-testing-cmds.h" | 29 | #include "transport-testing-cmds.h" |
30 | #include "gnunet_util_lib.h" | 30 | #include "gnunet_util_lib.h" |
31 | 31 | ||
32 | GNUNET_TRANSPORT_SIMPLE_TRAITS (GNUNET_TESTING_MAKE_IMPL_SIMPLE_TRAIT) | 32 | GNUNET_TRANSPORT_SIMPLE_TRAITS (GNUNET_TESTING_MAKE_IMPL_SIMPLE_TRAIT, GNUNET_TRANSPORT_TESTING) |