-fix format warning
[oweals/gnunet.git] / src / hello / test_friend_hello.c
index d5f75c824c8c6bb48474871ec10c96fbf96e2b93..0b4ed0b266276bbbd3229786083d8bcf9f2546be 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet
-     (C) 2009 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2009 GNUnet e.V.
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
 
      You should have received a copy of the GNU General Public License
      along with GNUnet; see the file COPYING.  If not, write to the
-     Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-     Boston, MA 02111-1307, USA.
+     Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+     Boston, MA 02110-1301, USA.
 */
 /**
- * @file hello/test_hello.c
+ * @file hello/test_friend_hello.c
  * @brief test for hello.c
  * @author Christian Grothoff
  */
 #include "platform.h"
 #include "gnunet_hello_lib.h"
 
-static size_t
-my_addr_gen (void *cls, size_t max, void *buf)
+
+static ssize_t
+my_addr_gen (void *cls,
+             size_t max,
+             void *buf)
 {
   unsigned int *i = cls;
   size_t ret;
@@ -35,7 +38,7 @@ my_addr_gen (void *cls, size_t max, void *buf)
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
              "DEBUG: my_addr_gen called with i = %d\n", *i);
   if (0 == *i)
-    return 0;
+    return GNUNET_SYSERR; /* Stop iteration */
   memset (&address.peer, 0, sizeof (struct GNUNET_PeerIdentity));
   address.address = "address_information";
   address.transport_name = "test";
@@ -49,7 +52,8 @@ my_addr_gen (void *cls, size_t max, void *buf)
 
 
 static int
-check_addr (void *cls, const struct GNUNET_HELLO_Address *address,
+check_addr (void *cls,
+            const struct GNUNET_HELLO_Address *address,
             struct GNUNET_TIME_Absolute expiration)
 {
   unsigned int *i = cls;
@@ -69,7 +73,8 @@ check_addr (void *cls, const struct GNUNET_HELLO_Address *address,
 
 
 static int
-remove_some (void *cls, const struct GNUNET_HELLO_Address *address,
+remove_some (void *cls,
+             const struct GNUNET_HELLO_Address *address,
              struct GNUNET_TIME_Absolute expiration)
 {
   unsigned int *i = cls;
@@ -93,8 +98,7 @@ main (int argc, char *argv[])
   struct GNUNET_HELLO_Message *msg1;
   struct GNUNET_HELLO_Message *msg2;
   struct GNUNET_HELLO_Message *msg3;
-  struct GNUNET_CRYPTO_EccPublicSignKey publicKey;
-  struct GNUNET_CRYPTO_EccPublicSignKey pk;
+  struct GNUNET_CRYPTO_EddsaPublicKey publicKey;
   struct GNUNET_TIME_Absolute startup_time;
   unsigned int i;
 
@@ -127,11 +131,6 @@ main (int argc, char *argv[])
                  GNUNET_HELLO_iterate_addresses (msg2, GNUNET_NO, &check_addr,
                                                  &i));
   GNUNET_assert (i == 0);
-
-  GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
-          "Testing get_key from HELLO...\n");
-  GNUNET_assert (GNUNET_OK == GNUNET_HELLO_get_key (msg2, &pk));
-  GNUNET_assert (0 == memcmp (&publicKey, &pk, sizeof (pk)));
   GNUNET_free (msg1);
 
   GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,