diff options
author | Christian Grothoff <christian@grothoff.org> | 2019-10-05 15:09:28 +0200 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2019-10-05 15:09:28 +0200 |
commit | c4e9ba925ffd758aaa3feee2ccfc0b76f26fe207 (patch) | |
tree | cac3ce030d77b4cbe7c7dc62ed58cfe6d24f73e1 /src/transport/test_transport_api.c | |
parent | fbb71d527c7d6babf269a8fefce1db291b9f7068 (diff) | |
download | gnunet-c4e9ba925ffd758aaa3feee2ccfc0b76f26fe207.tar.gz gnunet-c4e9ba925ffd758aaa3feee2ccfc0b76f26fe207.zip |
global reindent, now with uncrustify hook enabled
Diffstat (limited to 'src/transport/test_transport_api.c')
-rw-r--r-- | src/transport/test_transport_api.c | 75 |
1 files changed, 38 insertions, 37 deletions
diff --git a/src/transport/test_transport_api.c b/src/transport/test_transport_api.c index e7d2e5a7e..950eb2b04 100644 --- a/src/transport/test_transport_api.c +++ b/src/transport/test_transport_api.c | |||
@@ -34,42 +34,43 @@ | |||
34 | /** | 34 | /** |
35 | * How long until we give up on transmitting the message? | 35 | * How long until we give up on transmitting the message? |
36 | */ | 36 | */ |
37 | #define TIMEOUT GNUNET_TIME_relative_multiply(GNUNET_TIME_UNIT_SECONDS, 30) | 37 | #define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 30) |
38 | 38 | ||
39 | static struct GNUNET_TRANSPORT_TESTING_ConnectCheckContext *ccc; | 39 | static struct GNUNET_TRANSPORT_TESTING_ConnectCheckContext *ccc; |
40 | 40 | ||
41 | 41 | ||
42 | static void | 42 | static void |
43 | notify_receive(void *cls, | 43 | notify_receive (void *cls, |
44 | struct GNUNET_TRANSPORT_TESTING_PeerContext *receiver, | 44 | struct GNUNET_TRANSPORT_TESTING_PeerContext *receiver, |
45 | const struct GNUNET_PeerIdentity *sender, | 45 | const struct GNUNET_PeerIdentity *sender, |
46 | const struct GNUNET_TRANSPORT_TESTING_TestMessage *message) | 46 | const struct GNUNET_TRANSPORT_TESTING_TestMessage *message) |
47 | { | 47 | { |
48 | { | 48 | { |
49 | char *ps = GNUNET_strdup(GNUNET_i2s(&receiver->id)); | 49 | char *ps = GNUNET_strdup (GNUNET_i2s (&receiver->id)); |
50 | 50 | ||
51 | GNUNET_log(GNUNET_ERROR_TYPE_INFO, | 51 | GNUNET_log (GNUNET_ERROR_TYPE_INFO, |
52 | "Peer %u (`%s') received message of type %d and size %u size from peer %s!\n", | 52 | "Peer %u (`%s') received message of type %d and size %u size from peer %s!\n", |
53 | receiver->no, | 53 | receiver->no, |
54 | ps, | 54 | ps, |
55 | ntohs(message->header.type), | 55 | ntohs (message->header.type), |
56 | ntohs(message->header.size), | 56 | ntohs (message->header.size), |
57 | GNUNET_i2s(sender)); | 57 | GNUNET_i2s (sender)); |
58 | GNUNET_free(ps); | 58 | GNUNET_free (ps); |
59 | } | 59 | } |
60 | 60 | ||
61 | if ((GNUNET_TRANSPORT_TESTING_SIMPLE_MTYPE == ntohs(message->header.type)) && | 61 | if ((GNUNET_TRANSPORT_TESTING_SIMPLE_MTYPE == ntohs (message->header.type)) && |
62 | (GNUNET_TRANSPORT_TESTING_LARGE_MESSAGE_SIZE == ntohs(message->header.size))) | 62 | (GNUNET_TRANSPORT_TESTING_LARGE_MESSAGE_SIZE == ntohs ( |
63 | { | 63 | message->header.size))) |
64 | ccc->global_ret = GNUNET_OK; | 64 | { |
65 | GNUNET_SCHEDULER_shutdown(); | 65 | ccc->global_ret = GNUNET_OK; |
66 | } | 66 | GNUNET_SCHEDULER_shutdown (); |
67 | } | ||
67 | else | 68 | else |
68 | { | 69 | { |
69 | GNUNET_break(0); | 70 | GNUNET_break (0); |
70 | ccc->global_ret = GNUNET_SYSERR; | 71 | ccc->global_ret = GNUNET_SYSERR; |
71 | GNUNET_SCHEDULER_shutdown(); | 72 | GNUNET_SCHEDULER_shutdown (); |
72 | } | 73 | } |
73 | } | 74 | } |
74 | 75 | ||
75 | 76 | ||
@@ -81,8 +82,8 @@ notify_receive(void *cls, | |||
81 | * in both directions simultaneously? | 82 | * in both directions simultaneously? |
82 | */ | 83 | */ |
83 | static int | 84 | static int |
84 | test(char *argv[], | 85 | test (char *argv[], |
85 | int bi_directional) | 86 | int bi_directional) |
86 | { | 87 | { |
87 | struct GNUNET_TRANSPORT_TESTING_SendClosure sc = { | 88 | struct GNUNET_TRANSPORT_TESTING_SendClosure sc = { |
88 | .num_messages = 1 | 89 | .num_messages = 1 |
@@ -101,22 +102,22 @@ test(char *argv[], | |||
101 | ccc = &my_ccc; | 102 | ccc = &my_ccc; |
102 | sc.ccc = ccc; | 103 | sc.ccc = ccc; |
103 | if (GNUNET_OK != | 104 | if (GNUNET_OK != |
104 | GNUNET_TRANSPORT_TESTING_main(2, | 105 | GNUNET_TRANSPORT_TESTING_main (2, |
105 | &GNUNET_TRANSPORT_TESTING_connect_check, | 106 | &GNUNET_TRANSPORT_TESTING_connect_check, |
106 | ccc)) | 107 | ccc)) |
107 | return 1; | 108 | return 1; |
108 | return 0; | 109 | return 0; |
109 | } | 110 | } |
110 | 111 | ||
111 | 112 | ||
112 | int | 113 | int |
113 | main(int argc, | 114 | main (int argc, |
114 | char *argv[]) | 115 | char *argv[]) |
115 | { | 116 | { |
116 | if ((0 != test(argv, | 117 | if ((0 != test (argv, |
117 | GNUNET_NO)) || | 118 | GNUNET_NO)) || |
118 | (0 != test(argv, | 119 | (0 != test (argv, |
119 | GNUNET_YES))) | 120 | GNUNET_YES))) |
120 | return 1; | 121 | return 1; |
121 | return 0; | 122 | return 0; |
122 | } | 123 | } |