diff options
author | Christian Grothoff <christian@grothoff.org> | 2011-12-30 22:42:04 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2011-12-30 22:42:04 +0000 |
commit | 416c2f5a713b93ba689a8cd1e038682a53e6bc17 (patch) | |
tree | 987f51d9edfddc02afe1524df5e1156b920c71d4 /src/hello/test_hello.c | |
parent | fceec98e767bce7ad2c24dde73cdcf8837e04013 (diff) | |
download | gnunet-416c2f5a713b93ba689a8cd1e038682a53e6bc17.tar.gz gnunet-416c2f5a713b93ba689a8cd1e038682a53e6bc17.zip |
-LRN: use FPRINTF -- #2051
Diffstat (limited to 'src/hello/test_hello.c')
-rw-r--r-- | src/hello/test_hello.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/hello/test_hello.c b/src/hello/test_hello.c index eb15668f4..c645252ff 100644 --- a/src/hello/test_hello.c +++ b/src/hello/test_hello.c | |||
@@ -38,7 +38,7 @@ my_addr_gen (void *cls, size_t max, void *buf) | |||
38 | struct GNUNET_HELLO_Address address; | 38 | struct GNUNET_HELLO_Address address; |
39 | 39 | ||
40 | #if DEBUG | 40 | #if DEBUG |
41 | fprintf (stderr, "DEBUG: my_addr_gen called with i = %d\n", *i); | 41 | FPRINTF (stderr, "DEBUG: my_addr_gen called with i = %d\n", *i); |
42 | #endif | 42 | #endif |
43 | if (0 == *i) | 43 | if (0 == *i) |
44 | return 0; | 44 | return 0; |
@@ -61,7 +61,7 @@ check_addr (void *cls, const struct GNUNET_HELLO_Address *address, | |||
61 | unsigned int *i = cls; | 61 | unsigned int *i = cls; |
62 | 62 | ||
63 | #if DEBUG | 63 | #if DEBUG |
64 | fprintf (stderr, "DEBUG: check_addr called with i = %d and addrlen = %u\n", | 64 | FPRINTF (stderr, "DEBUG: check_addr called with i = %d and addrlen = %u\n", |
65 | *i, address->address_length); | 65 | *i, address->address_length); |
66 | #endif | 66 | #endif |
67 | GNUNET_assert (address->address_length > 0); | 67 | GNUNET_assert (address->address_length > 0); |
@@ -82,7 +82,7 @@ remove_some (void *cls, const struct GNUNET_HELLO_Address *address, | |||
82 | unsigned int *i = cls; | 82 | unsigned int *i = cls; |
83 | 83 | ||
84 | #if DEBUG | 84 | #if DEBUG |
85 | fprintf (stderr, "DEBUG: remove_some called with i = %d and addrlen = %u\n", | 85 | FPRINTF (stderr, "DEBUG: remove_some called with i = %d and addrlen = %u\n", |
86 | *i, address->address_length); | 86 | *i, address->address_length); |
87 | #endif | 87 | #endif |
88 | GNUNET_assert (address->address_length > 0); | 88 | GNUNET_assert (address->address_length > 0); |
@@ -110,7 +110,7 @@ main (int argc, char *argv[]) | |||
110 | startup_time = GNUNET_TIME_absolute_get (); | 110 | startup_time = GNUNET_TIME_absolute_get (); |
111 | memset (&publicKey, 42, sizeof (publicKey)); | 111 | memset (&publicKey, 42, sizeof (publicKey)); |
112 | #if VERBOSE | 112 | #if VERBOSE |
113 | fprintf (stderr, "Testing HELLO creation (without addresses)...\n"); | 113 | FPRINTF (stderr, "%s", "Testing HELLO creation (without addresses)...\n"); |
114 | #endif | 114 | #endif |
115 | i = 0; | 115 | i = 0; |
116 | msg1 = GNUNET_HELLO_create (&publicKey, &my_addr_gen, &i); | 116 | msg1 = GNUNET_HELLO_create (&publicKey, &my_addr_gen, &i); |
@@ -118,14 +118,14 @@ main (int argc, char *argv[]) | |||
118 | GNUNET_assert (0 < GNUNET_HELLO_size (msg1)); | 118 | GNUNET_assert (0 < GNUNET_HELLO_size (msg1)); |
119 | 119 | ||
120 | #if VERBOSE | 120 | #if VERBOSE |
121 | fprintf (stderr, "Testing address iteration (empty set)...\n"); | 121 | FPRINTF (stderr, "%s", "Testing address iteration (empty set)...\n"); |
122 | #endif | 122 | #endif |
123 | GNUNET_assert (NULL == | 123 | GNUNET_assert (NULL == |
124 | GNUNET_HELLO_iterate_addresses (msg1, GNUNET_NO, &check_addr, | 124 | GNUNET_HELLO_iterate_addresses (msg1, GNUNET_NO, &check_addr, |
125 | &i)); | 125 | &i)); |
126 | 126 | ||
127 | #if VERBOSE | 127 | #if VERBOSE |
128 | fprintf (stderr, "Testing HELLO creation (with one address)...\n"); | 128 | FPRINTF (stderr, "%s", "Testing HELLO creation (with one address)...\n"); |
129 | #endif | 129 | #endif |
130 | i = 1; | 130 | i = 1; |
131 | msg2 = GNUNET_HELLO_create (&publicKey, &my_addr_gen, &i); | 131 | msg2 = GNUNET_HELLO_create (&publicKey, &my_addr_gen, &i); |
@@ -133,7 +133,7 @@ main (int argc, char *argv[]) | |||
133 | GNUNET_assert (GNUNET_HELLO_size (msg1) < GNUNET_HELLO_size (msg2)); | 133 | GNUNET_assert (GNUNET_HELLO_size (msg1) < GNUNET_HELLO_size (msg2)); |
134 | 134 | ||
135 | #if VERBOSE | 135 | #if VERBOSE |
136 | fprintf (stderr, "Testing address iteration (one address)...\n"); | 136 | FPRINTF (stderr, "%s", "Testing address iteration (one address)...\n"); |
137 | #endif | 137 | #endif |
138 | i = 1; | 138 | i = 1; |
139 | GNUNET_assert (NULL == | 139 | GNUNET_assert (NULL == |
@@ -142,14 +142,14 @@ main (int argc, char *argv[]) | |||
142 | GNUNET_assert (i == 0); | 142 | GNUNET_assert (i == 0); |
143 | 143 | ||
144 | #if VERBOSE | 144 | #if VERBOSE |
145 | fprintf (stderr, "Testing get_key from HELLO...\n"); | 145 | FPRINTF (stderr, "%s", "Testing get_key from HELLO...\n"); |
146 | #endif | 146 | #endif |
147 | GNUNET_assert (GNUNET_OK == GNUNET_HELLO_get_key (msg2, &pk)); | 147 | GNUNET_assert (GNUNET_OK == GNUNET_HELLO_get_key (msg2, &pk)); |
148 | GNUNET_assert (0 == memcmp (&publicKey, &pk, sizeof (pk))); | 148 | GNUNET_assert (0 == memcmp (&publicKey, &pk, sizeof (pk))); |
149 | GNUNET_free (msg1); | 149 | GNUNET_free (msg1); |
150 | 150 | ||
151 | #if VERBOSE | 151 | #if VERBOSE |
152 | fprintf (stderr, "Testing HELLO creation (with two addresses)...\n"); | 152 | FPRINTF (stderr, "%s", "Testing HELLO creation (with two addresses)...\n"); |
153 | #endif | 153 | #endif |
154 | i = 2; | 154 | i = 2; |
155 | msg3 = GNUNET_HELLO_create (&publicKey, &my_addr_gen, &i); | 155 | msg3 = GNUNET_HELLO_create (&publicKey, &my_addr_gen, &i); |
@@ -157,7 +157,7 @@ main (int argc, char *argv[]) | |||
157 | GNUNET_assert (GNUNET_HELLO_size (msg2) < GNUNET_HELLO_size (msg3)); | 157 | GNUNET_assert (GNUNET_HELLO_size (msg2) < GNUNET_HELLO_size (msg3)); |
158 | 158 | ||
159 | #if VERBOSE | 159 | #if VERBOSE |
160 | fprintf (stderr, "Testing address iteration (two addresses)...\n"); | 160 | FPRINTF (stderr, "%s", "Testing address iteration (two addresses)...\n"); |
161 | #endif | 161 | #endif |
162 | i = 3; | 162 | i = 3; |
163 | GNUNET_assert (NULL == | 163 | GNUNET_assert (NULL == |
@@ -166,7 +166,7 @@ main (int argc, char *argv[]) | |||
166 | GNUNET_assert (i == 0); | 166 | GNUNET_assert (i == 0); |
167 | 167 | ||
168 | #if VERBOSE | 168 | #if VERBOSE |
169 | fprintf (stderr, "Testing HELLO merge...\n"); | 169 | FPRINTF (stderr, "%s", "Testing HELLO merge...\n"); |
170 | #endif | 170 | #endif |
171 | msg1 = GNUNET_HELLO_merge (msg2, msg3); | 171 | msg1 = GNUNET_HELLO_merge (msg2, msg3); |
172 | GNUNET_assert (GNUNET_HELLO_size (msg1) == GNUNET_HELLO_size (msg3)); | 172 | GNUNET_assert (GNUNET_HELLO_size (msg1) == GNUNET_HELLO_size (msg3)); |
@@ -179,7 +179,7 @@ main (int argc, char *argv[]) | |||
179 | GNUNET_free (msg1); | 179 | GNUNET_free (msg1); |
180 | 180 | ||
181 | #if VERBOSE | 181 | #if VERBOSE |
182 | fprintf (stderr, "Testing address iteration to copy HELLO...\n"); | 182 | FPRINTF (stderr, "%s", "Testing address iteration to copy HELLO...\n"); |
183 | #endif | 183 | #endif |
184 | i = 2; | 184 | i = 2; |
185 | msg1 = GNUNET_HELLO_iterate_addresses (msg3, GNUNET_YES, &remove_some, &i); | 185 | msg1 = GNUNET_HELLO_iterate_addresses (msg3, GNUNET_YES, &remove_some, &i); |
@@ -193,7 +193,7 @@ main (int argc, char *argv[]) | |||
193 | GNUNET_free (msg1); | 193 | GNUNET_free (msg1); |
194 | 194 | ||
195 | #if VERBOSE | 195 | #if VERBOSE |
196 | fprintf (stderr, "Testing delta address iteration...\n"); | 196 | FPRINTF (stderr, "%s", "Testing delta address iteration...\n"); |
197 | #endif | 197 | #endif |
198 | i = 2; | 198 | i = 2; |
199 | GNUNET_HELLO_iterate_new_addresses (msg3, msg2, startup_time, &check_addr, | 199 | GNUNET_HELLO_iterate_new_addresses (msg3, msg2, startup_time, &check_addr, |