global reindent, now with uncrustify hook enabled
[oweals/gnunet.git] / src / regex / test_regex_integration.c
index 453500fa1626ce1442b96cd0a283bc3bb1973752..c7a7e38b501ccad590297a6446cf1559432fca72 100644 (file)
@@ -2,21 +2,21 @@
      This file is part of GNUnet.
      Copyright (C) 2013, 2015 GNUnet e.V.
 
-     GNUnet is free software; you can redistribute it and/or modify
-     it under the terms of the GNU General Public License as published
-     by the Free Software Foundation; either version 3, or (at your
-     option) any later version.
+     GNUnet is free software: you can redistribute it and/or modify it
+     under the terms of the GNU Affero General Public License as published
+     by the Free Software Foundation, either version 3 of the License,
+     or (at your option) any later version.
 
      GNUnet is distributed in the hope that it will be useful, but
      WITHOUT ANY WARRANTY; without even the implied warranty of
      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-     General Public License for more details.
+     Affero General Public License for more details.
 
-     You should have received a copy of the GNU General Public License
-     along with GNUnet; see the file COPYING.  If not, write to the
-     Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-     Boston, MA 02110-1301, USA.
-*/
+     You should have received a copy of the GNU Affero General Public License
+     along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+     SPDX-License-Identifier: AGPL3.0-or-later
+ */
 /**
  * @file regex/test_regex_integration.c
  * @brief base test case for regex integration with VPN;
@@ -35,7 +35,8 @@
 /**
  * How long until we really give up on a particular testcase portion?
  */
-#define TOTAL_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, 600)
+#define TOTAL_TIMEOUT GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS, \
+                                                     600)
 
 /**
  * How long until we give up on any particular operation (and retry)?
@@ -57,8 +58,7 @@ static struct GNUNET_SCHEDULER_Task *die_task;
 
 
 static void
-end (void *cls,
-     const struct GNUNET_SCHEDULER_TaskContext *tc)
+end (void *cls)
 {
   die_task = NULL;
   GNUNET_REGEX_announce_cancel (a4);
@@ -76,8 +76,8 @@ end (void *cls,
 static void
 end_badly ()
 {
-  FPRINTF (stderr, "%s",  "Testcase failed (timeout).\n");
-  end (NULL, NULL);
+  fprintf (stderr, "%s", "Testcase failed (timeout).\n");
+  end (NULL);
   ok = 1;
 }
 
@@ -94,11 +94,11 @@ end_badly ()
  */
 static void
 found_cb (void *cls,
-         const struct GNUNET_PeerIdentity *id,
-         const struct GNUNET_PeerIdentity *get_path,
-         unsigned int get_path_length,
-         const struct GNUNET_PeerIdentity *put_path,
-         unsigned int put_path_length)
+          const struct GNUNET_PeerIdentity *id,
+          const struct GNUNET_PeerIdentity *get_path,
+          unsigned int get_path_length,
+          const struct GNUNET_PeerIdentity *put_path,
+          unsigned int put_path_length)
 {
   const char *str = cls;
   static int found;
@@ -110,11 +110,11 @@ found_cb (void *cls,
     found |= 4;
   if (0 == strcmp (str, "6"))
     found |= 2;
-  if ((4|2) == found)
+  if ((4 | 2) == found)
   {
     GNUNET_SCHEDULER_cancel (die_task);
     die_task =
-    GNUNET_SCHEDULER_add_now (&end, NULL);
+      GNUNET_SCHEDULER_add_now (&end, NULL);
   }
 }
 
@@ -137,7 +137,7 @@ run (void *cls,
 
   die_task =
     GNUNET_SCHEDULER_add_delayed (TOTAL_TIMEOUT,
-                                 &end_badly, NULL);
+                                  &end_badly, NULL);
   GNUNET_assert (1 ==
                  inet_pton (AF_INET,
                             "127.0.0.1",
@@ -174,13 +174,15 @@ run (void *cls,
   GNUNET_free (p6r);
   a4 = GNUNET_REGEX_announce (cfg,
                               p4,
-                              GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS,
-                                                             5),
-                            1);
+                              GNUNET_TIME_relative_multiply (
+                                GNUNET_TIME_UNIT_SECONDS,
+                                5),
+                              1);
   a6 = GNUNET_REGEX_announce (cfg,
                               p6,
-                              GNUNET_TIME_relative_multiply (GNUNET_TIME_UNIT_SECONDS,
-                                                             5),
+                              GNUNET_TIME_relative_multiply (
+                                GNUNET_TIME_UNIT_SECONDS,
+                                5),
                               1);
   GNUNET_free (p4);
   GNUNET_free (p6);
@@ -200,8 +202,8 @@ int
 main (int argc, char *argv[])
 {
   if (0 != GNUNET_TESTING_peer_run ("test-regex-integration",
-                                   "test_regex_api_data.conf",
-                                   &run, NULL))
+                                    "test_regex_api_data.conf",
+                                    &run, NULL))
     return 1;
   return ok;
 }