diff options
Diffstat (limited to 'src/hello/test_friend_hello.c')
-rw-r--r-- | src/hello/test_friend_hello.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/hello/test_friend_hello.c b/src/hello/test_friend_hello.c index fafab1d57..1435b1dca 100644 --- a/src/hello/test_friend_hello.c +++ b/src/hello/test_friend_hello.c | |||
@@ -18,15 +18,18 @@ | |||
18 | Boston, MA 02110-1301, USA. | 18 | Boston, MA 02110-1301, USA. |
19 | */ | 19 | */ |
20 | /** | 20 | /** |
21 | * @file hello/test_hello.c | 21 | * @file hello/test_friend_hello.c |
22 | * @brief test for hello.c | 22 | * @brief test for hello.c |
23 | * @author Christian Grothoff | 23 | * @author Christian Grothoff |
24 | */ | 24 | */ |
25 | #include "platform.h" | 25 | #include "platform.h" |
26 | #include "gnunet_hello_lib.h" | 26 | #include "gnunet_hello_lib.h" |
27 | 27 | ||
28 | |||
28 | static ssize_t | 29 | static ssize_t |
29 | my_addr_gen (void *cls, size_t max, void *buf) | 30 | my_addr_gen (void *cls, |
31 | size_t max, | ||
32 | void *buf) | ||
30 | { | 33 | { |
31 | unsigned int *i = cls; | 34 | unsigned int *i = cls; |
32 | size_t ret; | 35 | size_t ret; |
@@ -49,7 +52,8 @@ my_addr_gen (void *cls, size_t max, void *buf) | |||
49 | 52 | ||
50 | 53 | ||
51 | static int | 54 | static int |
52 | check_addr (void *cls, const struct GNUNET_HELLO_Address *address, | 55 | check_addr (void *cls, |
56 | const struct GNUNET_HELLO_Address *address, | ||
53 | struct GNUNET_TIME_Absolute expiration) | 57 | struct GNUNET_TIME_Absolute expiration) |
54 | { | 58 | { |
55 | unsigned int *i = cls; | 59 | unsigned int *i = cls; |
@@ -69,7 +73,8 @@ check_addr (void *cls, const struct GNUNET_HELLO_Address *address, | |||
69 | 73 | ||
70 | 74 | ||
71 | static int | 75 | static int |
72 | remove_some (void *cls, const struct GNUNET_HELLO_Address *address, | 76 | remove_some (void *cls, |
77 | const struct GNUNET_HELLO_Address *address, | ||
73 | struct GNUNET_TIME_Absolute expiration) | 78 | struct GNUNET_TIME_Absolute expiration) |
74 | { | 79 | { |
75 | unsigned int *i = cls; | 80 | unsigned int *i = cls; |
@@ -94,7 +99,6 @@ main (int argc, char *argv[]) | |||
94 | struct GNUNET_HELLO_Message *msg2; | 99 | struct GNUNET_HELLO_Message *msg2; |
95 | struct GNUNET_HELLO_Message *msg3; | 100 | struct GNUNET_HELLO_Message *msg3; |
96 | struct GNUNET_CRYPTO_EddsaPublicKey publicKey; | 101 | struct GNUNET_CRYPTO_EddsaPublicKey publicKey; |
97 | struct GNUNET_CRYPTO_EddsaPublicKey pk; | ||
98 | struct GNUNET_TIME_Absolute startup_time; | 102 | struct GNUNET_TIME_Absolute startup_time; |
99 | unsigned int i; | 103 | unsigned int i; |
100 | 104 | ||
@@ -127,11 +131,6 @@ main (int argc, char *argv[]) | |||
127 | GNUNET_HELLO_iterate_addresses (msg2, GNUNET_NO, &check_addr, | 131 | GNUNET_HELLO_iterate_addresses (msg2, GNUNET_NO, &check_addr, |
128 | &i)); | 132 | &i)); |
129 | GNUNET_assert (i == 0); | 133 | GNUNET_assert (i == 0); |
130 | |||
131 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | ||
132 | "Testing get_key from HELLO...\n"); | ||
133 | GNUNET_assert (GNUNET_OK == GNUNET_HELLO_get_key (msg2, &pk)); | ||
134 | GNUNET_assert (0 == memcmp (&publicKey, &pk, sizeof (pk))); | ||
135 | GNUNET_free (msg1); | 134 | GNUNET_free (msg1); |
136 | 135 | ||
137 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, | 136 | GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, |