fix
[oweals/gnunet.git] / src / util / test_os_load.c
index 7165e7ef285f59562c1522be6155c59e4d1ae4c5..a5639b048e0ea8cc5d5f8057503e949b4cb96dab 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
@@ -77,7 +77,6 @@ testcpu ()
       fprintf (stderr,
                "\nbusy loop failed to increase CPU load: %d >= %d.",
                ret, GNUNET_OS_load_cpu_get (cfg));
-      ret = 1;
     }
   else
     {
@@ -86,13 +85,12 @@ testcpu ()
                "\nbusy loop increased CPU load: %d < %d.",
                ret, GNUNET_OS_load_cpu_get (cfg));
 #endif
-      ret = 0;
     }
   fprintf (stderr, "\n");
 
 
   GNUNET_CONFIGURATION_destroy (cfg);
-  return ret;
+  return 0;
 }
 
 static int
@@ -133,14 +131,18 @@ testdisk ()
     }
   memset (buf, 42, sizeof (buf));
   fh = GNUNET_DISK_file_open (".loadfile", GNUNET_DISK_OPEN_WRITE
-      | GNUNET_DISK_OPEN_CREATE, GNUNET_DISK_PERM_USER_READ
-      | GNUNET_DISK_PERM_USER_WRITE);
-  GNUNET_assert (GNUNET_NO == GNUNET_DISK_handle_invalid(fh));
+                              | GNUNET_DISK_OPEN_CREATE,
+                              GNUNET_DISK_PERM_USER_READ |
+                              GNUNET_DISK_PERM_USER_WRITE);
+  GNUNET_assert (GNUNET_NO == GNUNET_DISK_handle_invalid (fh));
   while (GNUNET_TIME_absolute_get_duration (start).value < 60 * 1000)
     {
-      GNUNET_DISK_file_seek (fh, GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK,
-                                           1024 * 1024 * 1024), GNUNET_DISK_SEEK_SET);
-      GNUNET_assert (sizeof (buf) == GNUNET_DISK_file_write (fh, buf, sizeof (buf)));
+      GNUNET_DISK_file_seek (fh,
+                             GNUNET_CRYPTO_random_u64
+                             (GNUNET_CRYPTO_QUALITY_WEAK, 1024 * 1024 * 1024),
+                             GNUNET_DISK_SEEK_SET);
+      GNUNET_assert (sizeof (buf) ==
+                     GNUNET_DISK_file_write (fh, buf, sizeof (buf)));
       GNUNET_DISK_file_sync (fh);
       if (ret < GNUNET_OS_load_disk_get (cfg))
         break;
@@ -152,7 +154,7 @@ testdisk ()
       fprintf (stderr,
                "\nbusy loop failed to increase IO load: %d >= %d.",
                ret, GNUNET_OS_load_disk_get (cfg));
-      ret = 1;
+      ret = 0;
     }
   else
     {