[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] r33722 - gnunet/src/namestore
From: |
gnunet |
Subject: |
[GNUnet-SVN] r33722 - gnunet/src/namestore |
Date: |
Tue, 17 Jun 2014 22:28:29 +0200 |
Author: grothoff
Date: 2014-06-17 22:28:28 +0200 (Tue, 17 Jun 2014)
New Revision: 33722
Modified:
gnunet/src/namestore/test_namestore_api_zone_iteration_stop.c
Log:
-assert zone is non-null, simplify branching logic a bit
Modified: gnunet/src/namestore/test_namestore_api_zone_iteration_stop.c
===================================================================
--- gnunet/src/namestore/test_namestore_api_zone_iteration_stop.c
2014-06-17 20:26:21 UTC (rev 33721)
+++ gnunet/src/namestore/test_namestore_api_zone_iteration_stop.c
2014-06-17 20:28:28 UTC (rev 33722)
@@ -178,92 +178,90 @@
GNUNET_SCHEDULER_add_now (&end, NULL);
return;
}
- else
+ GNUNET_assert (NULL != zone);
+ if (0 == memcmp (zone, privkey, sizeof (struct
GNUNET_CRYPTO_EcdsaPrivateKey)))
{
- if (0 == memcmp (zone, privkey, sizeof (struct
GNUNET_CRYPTO_EcdsaPrivateKey)))
- {
- if (0 == strcmp (label, s_name_1))
+ if (0 == strcmp (label, s_name_1))
+ {
+ if (rd_count == 1)
{
- if (rd_count == 1)
+ if (GNUNET_YES != GNUNET_GNSRECORD_records_cmp(rd, s_rd_1))
{
- if (GNUNET_YES != GNUNET_GNSRECORD_records_cmp(rd, s_rd_1))
- {
- failed = GNUNET_YES;
- GNUNET_break (0);
- }
- }
- else
- {
failed = GNUNET_YES;
GNUNET_break (0);
}
}
- else if (0 == strcmp (label, s_name_2))
+ else
{
- if (rd_count == 1)
+ failed = GNUNET_YES;
+ GNUNET_break (0);
+ }
+ }
+ else if (0 == strcmp (label, s_name_2))
+ {
+ if (rd_count == 1)
+ {
+ if (GNUNET_YES != GNUNET_GNSRECORD_records_cmp(rd, s_rd_2))
{
- if (GNUNET_YES != GNUNET_GNSRECORD_records_cmp(rd, s_rd_2))
- {
- failed = GNUNET_YES;
- GNUNET_break (0);
- }
- }
- else
- {
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Received invalid record count\n");
failed = GNUNET_YES;
GNUNET_break (0);
}
}
else
{
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Comparing result failed: got name `%s' for first
zone\n", label);
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Received invalid record count\n");
failed = GNUNET_YES;
GNUNET_break (0);
}
- }
- else if (0 == memcmp (zone, privkey2, sizeof (struct
GNUNET_CRYPTO_EcdsaPrivateKey)))
- {
- if (0 == strcmp (label, s_name_3))
+ }
+ else
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Comparing result failed: got name `%s' for first zone\n",
label);
+ failed = GNUNET_YES;
+ GNUNET_break (0);
+ }
+ }
+ else if (0 == memcmp (zone, privkey2, sizeof (struct
GNUNET_CRYPTO_EcdsaPrivateKey)))
+ {
+ if (0 == strcmp (label, s_name_3))
+ {
+ if (rd_count == 1)
{
- if (rd_count == 1)
+ if (GNUNET_YES != GNUNET_GNSRECORD_records_cmp(rd, s_rd_3))
{
- if (GNUNET_YES != GNUNET_GNSRECORD_records_cmp(rd, s_rd_3))
- {
- failed = GNUNET_YES;
- GNUNET_break (0);
- }
- }
- else
- {
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
- "Received invalid record count\n");
failed = GNUNET_YES;
GNUNET_break (0);
}
}
else
{
- GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
- "Comparing result failed: got name `%s' for first
zone\n", label);
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Received invalid record count\n");
failed = GNUNET_YES;
GNUNET_break (0);
}
- }
- else
- {
- GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Received invalid zone\n");
+ }
+ else
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
+ "Comparing result failed: got name `%s' for first zone\n",
label);
failed = GNUNET_YES;
GNUNET_break (0);
- }
+ }
}
-
+ else
+ {
+ GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+ "Received invalid zone\n");
+ failed = GNUNET_YES;
+ GNUNET_break (0);
+ }
if (failed == GNUNET_NO)
{
- if (1 == returned_records)
- {
+ if (1 == returned_records)
+ {
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Telling namestore to stop zone iteration\n");
GNUNET_NAMESTORE_zone_iteration_stop (zi);
@@ -275,8 +273,8 @@
}
res = 0;
GNUNET_SCHEDULER_add_delayed (WAIT, &end, NULL);
- return;
- }
+ return;
+ }
returned_records ++;
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Telling namestore to send the next result\n");
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [GNUnet-SVN] r33722 - gnunet/src/namestore,
gnunet <=