[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r25444 - gnunet/src/ats
From: |
gnunet |
Subject: |
[GNUnet-SVN] r25444 - gnunet/src/ats |
Date: |
Thu, 13 Dec 2012 13:41:37 +0100 |
Author: wachs
Date: 2012-12-13 13:41:37 +0100 (Thu, 13 Dec 2012)
New Revision: 25444
Modified:
gnunet/src/ats/test_ats_api_scheduling_switch_network.c
Log:
changes
Modified: gnunet/src/ats/test_ats_api_scheduling_switch_network.c
===================================================================
--- gnunet/src/ats/test_ats_api_scheduling_switch_network.c 2012-12-13
11:53:13 UTC (rev 25443)
+++ gnunet/src/ats/test_ats_api_scheduling_switch_network.c 2012-12-13
12:41:37 UTC (rev 25444)
@@ -19,8 +19,7 @@
*/
/**
* @file ats/test_ats_api_scheduling_update_address.c
- * @brief test updating an address: add address, get and compare it, update it
- * get it again and compre
+ * @brief test updating networtk type of an address
* @author Christian Grothoff
* @author Matthias Wachs
*/
@@ -115,6 +114,8 @@
uint32_t ats_count)
{
static int stage = 0;
+ int level;
+ char *text;
if (0 == stage)
{
GNUNET_ATS_suggest_address_cancel (sched_ats, &p.id);
@@ -143,21 +144,49 @@
if (ntohl(bandwidth_out.value__) == quota_out[GNUNET_ATS_NET_WAN])
{
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Stage %u: WAN quota out correct
\n", stage);
+ level = GNUNET_ERROR_TYPE_DEBUG;
+ text = "correct";
+ ret = 0;
}
else
{
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Stage %u: WAN quota out wrong
\n", stage);
+ level = GNUNET_ERROR_TYPE_ERROR;
+ text = "wrong";
+ ret = 1;
}
+
+ GNUNET_log (level, "Stage %u: WAN outbound quota out %s: Received %llu,
configured %llu\n",
+ stage,
+ text,
+ (unsigned long long int) ntohl(bandwidth_out.value__),
+ quota_out[GNUNET_ATS_NET_WAN]);
+
if (ntohl(bandwidth_in.value__) == quota_in[GNUNET_ATS_NET_WAN])
{
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Stage %u: WAN quota in correct
\n", stage);
+ level = GNUNET_ERROR_TYPE_DEBUG;
+ text = "correct";
+ ret = 0;
}
else
{
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Stage %u: WAN quota in wrong
\n", stage);
+ level = GNUNET_ERROR_TYPE_ERROR;
+ text = "wrong";
+ ret = 1;
}
+
+ GNUNET_log (level, "Stage %u: WAN inbound quota out %s: Received %llu,
configured %llu\n",
+ stage,
+ text,
+ (unsigned long long int) ntohl(bandwidth_out.value__),
+ quota_out[GNUNET_ATS_NET_WAN]);
+
+ if (1 == ret)
+ {
+ GNUNET_SCHEDULER_add_now (&end, NULL);
+ return;
+ }
+
/* Update address */
/* Prepare ATS Information: change network */
test_ats_info[0].type = htonl (GNUNET_ATS_NETWORK_TYPE);
@@ -200,24 +229,42 @@
if (ntohl(bandwidth_out.value__) == quota_out[GNUNET_ATS_NET_LAN])
{
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Stage %u: LAN quota out
correct \n", stage);
+ level = GNUNET_ERROR_TYPE_DEBUG;
+ text = "correct";
ret = 0;
}
else
{
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Stage %u: LAN quota out wrong
\n", stage);
+ level = GNUNET_ERROR_TYPE_ERROR;
+ text = "wrong";
ret = 1;
}
+
+ GNUNET_log (level, "Stage %u: LAN outbound quota out %s: Received %llu,
configured %llu\n",
+ stage,
+ text,
+ (unsigned long long int) ntohl(bandwidth_out.value__),
+ quota_out[GNUNET_ATS_NET_LAN]);
+
if (ntohl(bandwidth_in.value__) == quota_in[GNUNET_ATS_NET_LAN])
- {
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Stage %u: LAN quota in correct
\n", stage);
- }
- else
- {
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Stage %u: LAN quota in wrong
\n", stage);
- ret = 1;
- }
+ {
+ level = GNUNET_ERROR_TYPE_DEBUG;
+ text = "correct";
+ ret = 0;
+ }
+ else
+ {
+ level = GNUNET_ERROR_TYPE_ERROR;
+ text = "wrong";
+ ret = 1;
+ }
+ GNUNET_log (level, "Stage %u: LAN inbound quota out %s: Received %llu,
configured %llu\n",
+ stage,
+ text,
+ (unsigned long long int) ntohl(bandwidth_out.value__),
+ quota_out[GNUNET_ATS_NET_LAN]);
+
GNUNET_SCHEDULER_add_now (&end, NULL);
}
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r25444 - gnunet/src/ats,
gnunet <=