[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r6427 - in GNUnet/src/applications: sqstore_mysql sqstore_s
From: |
gnunet |
Subject: |
[GNUnet-SVN] r6427 - in GNUnet/src/applications: sqstore_mysql sqstore_sqlite |
Date: |
Sat, 23 Feb 2008 23:56:05 -0700 (MST) |
Author: grothoff
Date: 2008-02-23 23:56:04 -0700 (Sat, 23 Feb 2008)
New Revision: 6427
Modified:
GNUnet/src/applications/sqstore_mysql/mysqltest2.c
GNUnet/src/applications/sqstore_mysql/mysqltest3.c
GNUnet/src/applications/sqstore_sqlite/sqlitetest2.c
GNUnet/src/applications/sqstore_sqlite/sqlitetest3.c
Log:
values must now be unique, adjusting testcases
Modified: GNUnet/src/applications/sqstore_mysql/mysqltest2.c
===================================================================
--- GNUnet/src/applications/sqstore_mysql/mysqltest2.c 2008-02-24 06:39:01 UTC
(rev 6426)
+++ GNUnet/src/applications/sqstore_mysql/mysqltest2.c 2008-02-24 06:56:04 UTC
(rev 6427)
@@ -121,7 +121,7 @@
static GNUNET_CronTime start_time;
static int
-putValue (GNUNET_SQstore_ServiceAPI * api, int i)
+putValue (GNUNET_SQstore_ServiceAPI * api, int i, int k)
{
GNUNET_DatastoreValue *value;
size_t size;
@@ -147,6 +147,9 @@
GNUNET_htonll (GNUNET_get_time () +
GNUNET_random_u32 (GNUNET_RANDOM_QUALITY_WEAK, 1000));
memset (&value[1], i, size - sizeof (GNUNET_DatastoreValue));
+ if (i > 255)
+ memset (&value[1], i-255, (size - sizeof (GNUNET_DatastoreValue))/2);
+ ((char*)&value[1])[0] = k;
if (GNUNET_OK != api->put (&key, value))
{
GNUNET_free (value);
@@ -209,7 +212,7 @@
/* insert data equivalent to 1/10th of MAX_SIZE */
for (j = 0; j < PUT_10; j++)
{
- ASSERT (GNUNET_OK == putValue (api, j));
+ ASSERT (GNUNET_OK == putValue (api, j, i));
if (GNUNET_shutdown_test () == GNUNET_YES)
break;
}
Modified: GNUnet/src/applications/sqstore_mysql/mysqltest3.c
===================================================================
--- GNUnet/src/applications/sqstore_mysql/mysqltest3.c 2008-02-24 06:39:01 UTC
(rev 6426)
+++ GNUnet/src/applications/sqstore_mysql/mysqltest3.c 2008-02-24 06:56:04 UTC
(rev 6427)
@@ -53,7 +53,7 @@
static GNUNET_CronTime start_time;
static int
-putValue (GNUNET_SQstore_ServiceAPI * api, int i)
+putValue (GNUNET_SQstore_ServiceAPI * api, int i, int k)
{
GNUNET_DatastoreValue *value;
size_t size;
@@ -81,6 +81,9 @@
GNUNET_htonll (GNUNET_get_time () + 60 * GNUNET_CRON_HOURS +
GNUNET_random_u32 (GNUNET_RANDOM_QUALITY_WEAK, 1000));
memset (&value[1], i, size - sizeof (GNUNET_DatastoreValue));
+ if (i > 255)
+ memset (&value[1], i-255, (size - sizeof (GNUNET_DatastoreValue))/2);
+ ((char*)&value[1])[0] = k;
if (GNUNET_OK != api->put (&key, value))
{
GNUNET_free (value);
@@ -119,7 +122,7 @@
start = GNUNET_get_time ();
for (j = 0; j < PUT_10; j++)
{
- if (GNUNET_OK != putValue (api, j))
+ if (GNUNET_OK != putValue (api, j, i))
break;
if (GNUNET_shutdown_test () == GNUNET_YES)
break;
Modified: GNUnet/src/applications/sqstore_sqlite/sqlitetest2.c
===================================================================
--- GNUnet/src/applications/sqstore_sqlite/sqlitetest2.c 2008-02-24
06:39:01 UTC (rev 6426)
+++ GNUnet/src/applications/sqstore_sqlite/sqlitetest2.c 2008-02-24
06:56:04 UTC (rev 6427)
@@ -121,7 +121,7 @@
static GNUNET_CronTime start_time;
static int
-putValue (GNUNET_SQstore_ServiceAPI * api, int i)
+putValue (GNUNET_SQstore_ServiceAPI * api, int i, int k)
{
GNUNET_DatastoreValue *value;
size_t size;
@@ -147,6 +147,9 @@
GNUNET_htonll (GNUNET_get_time () +
GNUNET_random_u32 (GNUNET_RANDOM_QUALITY_WEAK, 1000));
memset (&value[1], i, size - sizeof (GNUNET_DatastoreValue));
+ if (i > 255)
+ memset (&value[1], i-255, (size - sizeof (GNUNET_DatastoreValue))/2);
+ ((char*)&value[1])[0] = k;
if (GNUNET_OK != api->put (&key, value))
{
GNUNET_free (value);
@@ -209,7 +212,7 @@
/* insert data equivalent to 1/10th of MAX_SIZE */
for (j = 0; j < PUT_10; j++)
{
- ASSERT (GNUNET_OK == putValue (api, j));
+ ASSERT (GNUNET_OK == putValue (api, j, i));
if (GNUNET_shutdown_test () == GNUNET_YES)
break;
}
Modified: GNUnet/src/applications/sqstore_sqlite/sqlitetest3.c
===================================================================
--- GNUnet/src/applications/sqstore_sqlite/sqlitetest3.c 2008-02-24
06:39:01 UTC (rev 6426)
+++ GNUnet/src/applications/sqstore_sqlite/sqlitetest3.c 2008-02-24
06:56:04 UTC (rev 6427)
@@ -53,7 +53,7 @@
static GNUNET_CronTime start_time;
static int
-putValue (GNUNET_SQstore_ServiceAPI * api, int i)
+putValue (GNUNET_SQstore_ServiceAPI * api, int i, int k)
{
GNUNET_DatastoreValue *value;
size_t size;
@@ -81,6 +81,9 @@
GNUNET_htonll (GNUNET_get_time () + 60 * GNUNET_CRON_HOURS +
GNUNET_random_u32 (GNUNET_RANDOM_QUALITY_WEAK, 1000));
memset (&value[1], i, size - sizeof (GNUNET_DatastoreValue));
+ if (i > 255)
+ memset (&value[1], i-255, (size - sizeof (GNUNET_DatastoreValue))/2);
+ ((char*)&value[1])[0] = k;
if (GNUNET_OK != api->put (&key, value))
{
GNUNET_free (value);
@@ -119,7 +122,7 @@
start = GNUNET_get_time ();
for (j = 0; j < PUT_10; j++)
{
- if (GNUNET_OK != putValue (api, j))
+ if (GNUNET_OK != putValue (api, j, i))
break;
if (GNUNET_shutdown_test () == GNUNET_YES)
break;
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r6427 - in GNUnet/src/applications: sqstore_mysql sqstore_sqlite,
gnunet <=