return;
}
- if (GNUNET_OK != compare_ats(atsi, ats_count, test_ats_info, test_ats_count))
+ if ((ats_count != test_ats_count) ||
+ (GNUNET_OK != compare_ats(atsi, ats_count, test_ats_info, test_ats_count)))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Stage 0: Callback with incorrect ats info \n");
ret = 1;
test_ats_info[0].type = htonl (GNUNET_ATS_NETWORK_TYPE);
test_ats_info[0].value = htonl(GNUNET_ATS_NET_WAN);
test_ats_info[1].type = htonl (GNUNET_ATS_QUALITY_NET_DISTANCE);
- test_ats_info[1].value = htonl(3);
- test_ats_info[1].type = htonl (GNUNET_ATS_QUALITY_NET_DELAY);
- test_ats_info[1].value = htonl(30);
- test_ats_count = 2;
+ test_ats_info[1].value = htonl(5);
+ test_ats_info[2].type = htonl (GNUNET_ATS_QUALITY_NET_DELAY);
+ test_ats_info[2].value = htonl(30);
+ test_ats_count = 3;
GNUNET_ATS_address_update (sched_ats, &test_hello_address, test_session, test_ats_info, test_ats_count);
ret = 1;
}
- if (GNUNET_OK != compare_ats(atsi, ats_count, test_ats_info, test_ats_count))
+ if ((ats_count != test_ats_count) ||
+ (GNUNET_OK != compare_ats(atsi, ats_count, test_ats_info, test_ats_count)))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Stage 1: Callback with incorrect ats info \n");
ret = 1;
}
/* 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");
- ret = GNUNET_SYSERR;
- end ();
- 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));
/* Prepare ATS Information */
test_ats_info[0].type = htonl (GNUNET_ATS_NETWORK_TYPE);
test_ats_info[0].value = htonl(GNUNET_ATS_NET_WAN);
- test_ats_info[1].type = htonl (GNUNET_ATS_QUALITY_NET_DISTANCE);
- test_ats_info[1].value = htonl(1);
test_ats_info[1].type = htonl (GNUNET_ATS_QUALITY_NET_DELAY);
test_ats_info[1].value = htonl(10);
test_ats_count = 2;