/*
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;
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";
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;
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;
struct GNUNET_HELLO_Message *msg1;
struct GNUNET_HELLO_Message *msg2;
struct GNUNET_HELLO_Message *msg3;
- struct GNUNET_CRYPTO_EccPublicKey publicKey;
- struct GNUNET_CRYPTO_EccPublicKey pk;
+ struct GNUNET_CRYPTO_EddsaPublicKey publicKey;
struct GNUNET_TIME_Absolute startup_time;
unsigned int i;
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,