*/
/**
* @file ats/test_ats_solver_add_address.c
- * @brief solver test: add address
+ * @brief solver test: request address, add address and wait for suggest
* @author Christian Grothoff
* @author Matthias Wachs
*/
}
static void
-address_suggest_cb (void *cls, const struct GNUNET_HELLO_Address *address,
+address_suggest_cb (void *cls,
+ const struct GNUNET_PeerIdentity *peer,
+ const struct GNUNET_HELLO_Address *address,
struct Session *session,
struct GNUNET_BANDWIDTH_Value32NBO bandwidth_out,
struct GNUNET_BANDWIDTH_Value32NBO bandwidth_in,
GNUNET_assert (NULL != address);
GNUNET_assert (NULL == session);
- GNUNET_assert (ntohl(bandwidth_in.value__) > 0);
- GNUNET_assert (ntohl(bandwidth_out.value__) > 0);
GNUNET_log (GNUNET_ERROR_TYPE_INFO, "Received sugggestion for peer `%s'\n",
GNUNET_i2s (&address->peer));
GNUNET_SCHEDULER_add_now (&end_badly, NULL);
return;
}
- /* Request */
- GNUNET_ATS_suggest_address (sched_ats, &p.id);
/* Set up peer */
- if (GNUNET_SYSERR == GNUNET_CRYPTO_hash_from_string(PEERID0, &p.id.hashPubKey))
- {
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Could not setup peer!\n");
- GNUNET_SCHEDULER_add_now (&end_badly, NULL);
- return;
- }
- GNUNET_assert (0 == strcmp (PEERID0, GNUNET_i2s_full (&p.id)));
-
+ memset (&p.id, '1', sizeof (p.id));
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Created peer `%s'\n",
GNUNET_i2s_full(&p.id));
test_hello_address.address = test_addr.addr;
test_hello_address.address_length = test_addr.addr_len;
+ /* Request */
+ GNUNET_ATS_suggest_address (sched_ats, &p.id, NULL, NULL);
+
+
/* Adding address */
GNUNET_ATS_address_add (sched_ats, &test_hello_address, NULL, test_ats_info, test_ats_count);
}