summaryrefslogtreecommitdiff
path: root/src/transport/test_transport_api_manipulation_cfg.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2013-08-11 21:21:56 +0000
committerChristian Grothoff <christian@grothoff.org>2013-08-11 21:21:56 +0000
commit3d7fefedc9ba60bd8e8448efe8b628446d958536 (patch)
tree61ce41a52cd6e7232cead77818ef265993b2427e /src/transport/test_transport_api_manipulation_cfg.c
parent4a0398474db197abed243a123fb971fbeeffab4b (diff)
changing time measurement from milliseconds to microseconds
Diffstat (limited to 'src/transport/test_transport_api_manipulation_cfg.c')
-rw-r--r--src/transport/test_transport_api_manipulation_cfg.c46
1 files changed, 27 insertions, 19 deletions
diff --git a/src/transport/test_transport_api_manipulation_cfg.c b/src/transport/test_transport_api_manipulation_cfg.c
index b7321af85..c9bb5d08a 100644
--- a/src/transport/test_transport_api_manipulation_cfg.c
+++ b/src/transport/test_transport_api_manipulation_cfg.c
@@ -25,8 +25,8 @@
* Peer 1 has inbound and outbound delay of 100ms
* Peer 2 has no inbound and outbound delay
*
- * We send a request from P1 to P2 and expect delay of >= TEST_DELAY ms
- * Then we send response from P2 to P1 and expect delay of >= TEST_DELAY ms
+ * We send a request from P1 to P2 and expect delay of >= TEST_DELAY us
+ * Then we send response from P2 to P1 and expect delay of >= TEST_DELAY us
*/
#include "platform.h"
#include "gnunet_transport_service.h"
@@ -48,7 +48,10 @@
#define TEST_RESPONSE_MESSAGE_TYPE 12346
-#define TEST_DELAY 100
+/**
+ * Test delay, in microseconds.
+ */
+#define TEST_DELAY 100 * 1000LL
static char *test_source;
@@ -304,16 +307,18 @@ notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
case TEST_REQUEST_MESSAGE_TYPE:
duration = GNUNET_TIME_absolute_get_difference(start_request,
GNUNET_TIME_absolute_get());
- if (duration.rel_value >= TEST_DELAY)
+ if (duration.rel_value_us >= TEST_DELAY)
GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- "Request message was delayed for %llu ms\n",
- duration.rel_value);
+ "Request message was delayed for %s\n",
+ GNUNET_STRINGS_relative_time_to_string (duration,
+ GNUNET_YES));
else
- {
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Request message was delayed for %llu ms, should be %u ms\n",
- duration.rel_value, TEST_DELAY);
- ok = 1;
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Request message was delayed for unexpected duration %s\n",
+ GNUNET_STRINGS_relative_time_to_string (duration,
+ GNUNET_YES));
+ ok = 1;
}
/* Send response */
@@ -323,15 +328,18 @@ notify_receive (void *cls, const struct GNUNET_PeerIdentity *peer,
case TEST_RESPONSE_MESSAGE_TYPE:
duration = GNUNET_TIME_absolute_get_difference(start_response,
GNUNET_TIME_absolute_get());
- if (duration.rel_value >= TEST_DELAY)
- GNUNET_log (GNUNET_ERROR_TYPE_INFO,
- "Response message was delayed for %llu ms\n", duration);
+ if (duration.rel_value_us >= TEST_DELAY)
+ GNUNET_log (GNUNET_ERROR_TYPE_INFO,
+ "Response message was delayed for %s\n",
+ GNUNET_STRINGS_relative_time_to_string (duration,
+ GNUNET_YES));
else
- {
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Response message was delayed for %llu ms, should be %u ms\n",
- duration.rel_value, TEST_DELAY);
- ok = 1;
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Response message was delayed for unexpected duration %s\n",
+ GNUNET_STRINGS_relative_time_to_string (duration,
+ GNUNET_YES));
+ ok = 1;
}
/* Done */
ok = 0;