- use proper signedness
[oweals/gnunet.git] / src / datastore / test_datastore_api_management.c
index bbb9543044e5450289f2ea380d4e057d542a9dcc..5553e5c0beb405f11622f2de281f3ee456a3a5d6 100644 (file)
@@ -26,7 +26,7 @@
 #include "gnunet_util_lib.h"
 #include "gnunet_protocols.h"
 #include "gnunet_datastore_service.h"
-#include "gnunet_testing_lib-new.h"
+#include "gnunet_testing_lib.h"
 
 
 /**
@@ -51,7 +51,7 @@ enum RunPhase
 
 struct CpsRunContext
 {
-  GNUNET_HashCode key;
+  struct GNUNET_HashCode key;
   int i;
   int found;
   const struct GNUNET_CONFIGURATION_Handle *cfg;
@@ -113,7 +113,7 @@ get_expiration (int i)
 {
   struct GNUNET_TIME_Absolute av;
 
-  av.abs_value = now.abs_value + i * 1000;
+  av.abs_value_us = now.abs_value_us + i * 1000 * 1000LL;
   return av;
 }
 
@@ -138,7 +138,7 @@ check_success (void *cls, int success, struct GNUNET_TIME_Absolute min_expiratio
 
 
 static void
-check_value (void *cls, const GNUNET_HashCode * key, size_t size,
+check_value (void *cls, const struct GNUNET_HashCode * key, size_t size,
              const void *data, enum GNUNET_BLOCK_Type type, uint32_t priority,
              uint32_t anonymity, struct GNUNET_TIME_Absolute expiration,
              uint64_t uid)
@@ -159,7 +159,7 @@ check_value (void *cls, const GNUNET_HashCode * key, size_t size,
   GNUNET_assert (type == get_type (i));
   GNUNET_assert (priority == get_priority (i));
   GNUNET_assert (anonymity == get_anonymity (i));
-  GNUNET_assert (expiration.abs_value == get_expiration (i).abs_value);
+  GNUNET_assert (expiration.abs_value_us == get_expiration (i).abs_value_us);
   crc->offset++;
   crc->i--;
   if (crc->i == 0)
@@ -170,7 +170,7 @@ check_value (void *cls, const GNUNET_HashCode * key, size_t size,
 
 
 static void
-check_nothing (void *cls, const GNUNET_HashCode * key, size_t size,
+check_nothing (void *cls, const struct GNUNET_HashCode * key, size_t size,
                const void *data, enum GNUNET_BLOCK_Type type, uint32_t priority,
                uint32_t anonymity, struct GNUNET_TIME_Absolute expiration,
                uint64_t uid)
@@ -258,13 +258,14 @@ run_tests (void *cls, int success, struct GNUNET_TIME_Absolute min_expiration, c
 
 
 static void
-run (void *cls, 
-     const struct GNUNET_CONFIGURATION_Handle *cfg)
+run (void *cls,
+     const struct GNUNET_CONFIGURATION_Handle *cfg,
+     struct GNUNET_TESTING_Peer *peer)
 {
   struct CpsRunContext *crc;
-  static GNUNET_HashCode zkey;
+  static struct GNUNET_HashCode zkey;
 
-  crc = GNUNET_malloc (sizeof (struct CpsRunContext));
+  crc = GNUNET_new (struct CpsRunContext);
   crc->cfg = cfg;
   crc->phase = RP_PUT;
   now = GNUNET_TIME_absolute_get ();