aboutsummaryrefslogtreecommitdiff
path: root/src/datastore/test_datastore_api.c
diff options
context:
space:
mode:
authorgrothoff <grothoff@140774ce-b5e7-0310-ab8b-a85725594a96>2009-07-19 09:10:43 +0000
committergrothoff <grothoff@140774ce-b5e7-0310-ab8b-a85725594a96>2009-07-19 09:10:43 +0000
commite7fa24a65fa751f5dbfe2d4c17a64aaf19c2fce5 (patch)
treed5f3218032ef23010d28b8f4c67bc104f0239956 /src/datastore/test_datastore_api.c
parente98c7d9f12f4766910358407f8ca173e83611cab (diff)
debug messages
git-svn-id: https://gnunet.org/svn/gnunet@8749 140774ce-b5e7-0310-ab8b-a85725594a96
Diffstat (limited to 'src/datastore/test_datastore_api.c')
-rw-r--r--src/datastore/test_datastore_api.c46
1 files changed, 39 insertions, 7 deletions
diff --git a/src/datastore/test_datastore_api.c b/src/datastore/test_datastore_api.c
index afc36b7089..e9545bbf18 100644
--- a/src/datastore/test_datastore_api.c
+++ b/src/datastore/test_datastore_api.c
@@ -33,11 +33,15 @@
#include "gnunet_protocols.h"
#include "gnunet_datastore_service.h"
+#define VERBOSE GNUNET_YES
+
/**
* How long until we give up on transmitting the message?
*/
#define TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 15)
+#define ITERATIONS 256
+
static struct GNUNET_DATASTORE_Handle *datastore;
static struct GNUNET_TIME_Absolute now;
@@ -250,7 +254,13 @@ run_continuation (void *cls,
switch (crc->phase)
{
case RP_PUT:
- memset (&crc->key, 256 - crc->i, sizeof (GNUNET_HashCode));
+#if VERBOSE
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Executing `%s' number %u\n",
+ "PUT",
+ crc->i);
+#endif
+ memset (&crc->key, ITERATIONS - crc->i, sizeof (GNUNET_HashCode));
GNUNET_DATASTORE_put (datastore,
0,
&crc->key,
@@ -264,12 +274,18 @@ run_continuation (void *cls,
&check_success,
crc);
crc->i++;
- if (crc->i == 256)
+ if (crc->i == ITERATIONS)
crc->phase = RP_GET;
break;
case RP_GET:
crc->i--;
- memset (&crc->key, 256 - crc->i, sizeof (GNUNET_HashCode));
+#if VERBOSE
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Executing `%s' number %u\n",
+ "GET",
+ crc->i);
+#endif
+ memset (&crc->key, ITERATIONS - crc->i, sizeof (GNUNET_HashCode));
GNUNET_DATASTORE_get (datastore,
&crc->key,
get_type (crc->i),
@@ -279,12 +295,18 @@ run_continuation (void *cls,
if (crc->i == 0)
{
crc->phase = RP_DEL;
- crc->i = 256;
+ crc->i = ITERATIONS;
}
break;
case RP_DEL:
crc->i--;
- memset (&crc->key, 256 - crc->i, sizeof (GNUNET_HashCode));
+#if VERBOSE
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Executing `%s' number %u\n",
+ "DEL",
+ crc->i);
+#endif
+ memset (&crc->key, ITERATIONS - crc->i, sizeof (GNUNET_HashCode));
GNUNET_DATASTORE_get (datastore,
&crc->key,
get_type (crc->i),
@@ -294,12 +316,18 @@ run_continuation (void *cls,
if (crc->i == 0)
{
crc->phase = RP_DELVALIDATE;
- crc->i = 256;
+ crc->i = ITERATIONS;
}
break;
case RP_DELVALIDATE:
crc->i--;
- memset (&crc->key, 256 - crc->i, sizeof (GNUNET_HashCode));
+#if VERBOSE
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Executing `%s' number %u\n",
+ "DEL-VALIDATE",
+ crc->i);
+#endif
+ memset (&crc->key, ITERATIONS - crc->i, sizeof (GNUNET_HashCode));
GNUNET_DATASTORE_get (datastore,
&crc->key,
get_type (crc->i),
@@ -315,6 +343,10 @@ run_continuation (void *cls,
/* check update */
/* test multiple results */
case RP_DONE:
+#if VERBOSE
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Finished, disconnecting\n");
+#endif
GNUNET_DATASTORE_disconnect (datastore, GNUNET_YES);
ok = 0;
}