rps tests: sanity checks and cosmetics
authorJulius Bünger <buenger@mytum.de>
Sun, 7 Jan 2018 21:10:21 +0000 (22:10 +0100)
committerJulius Bünger <buenger@mytum.de>
Sun, 7 Jan 2018 21:33:08 +0000 (22:33 +0100)
src/rps/test_rps.c

index 584d26c265ae555d3dbcb37f26e37c2c1c636adc..9f3044dccbd36b054f73fd8dd48528a3021c4db2 100644 (file)
@@ -1181,7 +1181,7 @@ churn_cb (void *cls,
 
   num_peers_online += entry->delta;
 
-  if (0 > entry->delta)
+  if (-1 == entry->delta)
   { /* Peer hopefully just went offline */
     if (GNUNET_YES != rps_peers[entry->index].online)
     {
@@ -1222,6 +1222,12 @@ churn_cb (void *cls,
     }
     rps_peers[entry->index].online = GNUNET_YES;
   }
+  else
+  {
+    GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
+        "Invalid value for delta: %i\n", entry->delta);
+    GNUNET_break (0);
+  }
 
   GNUNET_CONTAINER_DLL_remove (oplist_head, oplist_tail, entry);
   rps_peers[entry->index].entry_op_manage = NULL;
@@ -1743,10 +1749,10 @@ main (int argc, char *argv[])
 
   ok = 1;
   ret_value = GNUNET_TESTBED_test_run (cur_test_run.name,
-                                  "test_rps.conf",
-                                  num_peers,
-                                  0, NULL, NULL,
-                                  &run, NULL);
+                                       "test_rps.conf",
+                                       num_peers,
+                                       0, NULL, NULL,
+                                       &run, NULL);
   GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
               "_test_run returned.\n");
   if (GNUNET_OK != ret_value)