LRN: Fix automake deps to allow -j* builds again
[oweals/gnunet.git] / src / util / test_configuration.c
index 992c32e6c479342bd6a532d780030fea603f4051..365161e34f79eebdeae4637a7114e95518462bc8 100644 (file)
@@ -4,7 +4,7 @@
 
      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 2, or (at your
+     by the Free Software Foundation; either version 3, or (at your
      option) any later version.
 
      GNUnet is distributed in the hope that it will be useful, but
@@ -473,7 +473,12 @@ main (int argc, char *argv[])
       return 1;
     }
   failureCount += testConfig ();
-  failureCount += 2 * testConfigFilenames ();
+  if (failureCount > 0)
+    goto error;
+
+  failureCount = testConfigFilenames ();
+  if (failureCount > 0)
+    goto error;
 
   if (GNUNET_OK != GNUNET_CONFIGURATION_write (cfg, "/tmp/gnunet-test.conf"))
     {
@@ -492,15 +497,22 @@ main (int argc, char *argv[])
       GNUNET_CONFIGURATION_destroy (cfg);
       return 1;
     }
-  if ((GNUNET_OK !=
-       GNUNET_CONFIGURATION_get_value_string (cfg, "TESTING", "WEAKRANDOM",
-                                             &c))
-      || (0 != strcmp (c, "YES")))
+  if (GNUNET_OK !=
+      GNUNET_CONFIGURATION_get_value_string (cfg, "TESTING", "WEAKRANDOM",
+                                            &c))
     {
       GNUNET_break (0);
       GNUNET_CONFIGURATION_destroy (cfg);
       return 1;
     }
+  if (0 != strcmp (c, "YES"))
+    {
+      GNUNET_break (0);
+      GNUNET_free (c);
+      GNUNET_CONFIGURATION_destroy (cfg);
+      return 1;
+    }
+
   GNUNET_free (c);
   GNUNET_CONFIGURATION_destroy (cfg);
 
@@ -530,6 +542,7 @@ main (int argc, char *argv[])
 
   GNUNET_CONFIGURATION_destroy (cfgDefault);
 
+error:
   if (failureCount != 0)
     {
       fprintf (stderr, "Test failed: %u\n", failureCount);