Forget to commit some files
[oweals/gnunet.git] / src / fs / test_fs_uri.c
index afc80ef71edcf7733e12e34a81bc14a8a1987d7b..193b4c4578b176b3971a60831ce42b18b474244e 100644 (file)
@@ -1,6 +1,6 @@
 /*
      This file is part of GNUnet.
-     (C) 2003-2014 Christian Grothoff (and other contributing authors)
+     Copyright (C) 2003-2014 Christian Grothoff (and other contributing authors)
 
      GNUnet is free software; you can redistribute it and/or modify
      it under the terms of the GNU General Public License as published
@@ -14,8 +14,8 @@
 
      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., 59 Temple Place - Suite 330,
-     Boston, MA 02111-1307, USA.
+     Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+     Boston, MA 02110-1301, USA.
 */
 /**
  * @file fs/test_fs_uri.c
@@ -42,12 +42,12 @@ testKeyword ()
   }
   GNUNET_free (emsg);
   ret = GNUNET_FS_uri_parse ("gnunet://fs/ksk/foo+bar", &emsg);
-  if (ret == NULL)
+  if (NULL == ret)
   {
     GNUNET_free (emsg);
     GNUNET_assert (0);
   }
-  if (!GNUNET_FS_uri_test_ksk (ret))
+  if (! GNUNET_FS_uri_test_ksk (ret))
   {
     GNUNET_FS_uri_destroy (ret);
     GNUNET_assert (0);
@@ -81,7 +81,7 @@ testLocation ()
   struct GNUNET_FS_Uri *uri2;
   struct GNUNET_FS_Uri *baseURI;
   char *emsg;
-  struct GNUNET_CONFIGURATION_Handle *cfg;
+  struct GNUNET_CRYPTO_EddsaPrivateKey *pk;
 
   baseURI =
       GNUNET_FS_uri_parse
@@ -89,38 +89,31 @@ testLocation ()
        &emsg);
   GNUNET_assert (baseURI != NULL);
   GNUNET_assert (emsg == NULL);
-  cfg = GNUNET_CONFIGURATION_create ();
-  if (GNUNET_OK != GNUNET_CONFIGURATION_load (cfg, "test_fs_uri_data.conf"))
-  {
-    FPRINTF (stderr, "%s",  "Failed to parse configuration file\n");
-    GNUNET_FS_uri_destroy (baseURI);
-    GNUNET_CONFIGURATION_destroy (cfg);
-    return 1;
-  }
-  uri = GNUNET_FS_uri_loc_create (baseURI, cfg, GNUNET_TIME_absolute_get ());
-  if (uri == NULL)
+  pk = GNUNET_CRYPTO_eddsa_key_create ();
+  uri = GNUNET_FS_uri_loc_create (baseURI,
+                                  pk,
+                                  GNUNET_TIME_absolute_get ());
+  GNUNET_free (pk);
+  if (NULL == uri)
   {
     GNUNET_break (0);
     GNUNET_FS_uri_destroy (baseURI);
-    GNUNET_CONFIGURATION_destroy (cfg);
     return 1;
   }
-  if (!GNUNET_FS_uri_test_loc (uri))
+  if (! GNUNET_FS_uri_test_loc (uri))
   {
     GNUNET_break (0);
     GNUNET_FS_uri_destroy (uri);
     GNUNET_FS_uri_destroy (baseURI);
-    GNUNET_CONFIGURATION_destroy (cfg);
     return 1;
   }
   uri2 = GNUNET_FS_uri_loc_get_uri (uri);
-  if (!GNUNET_FS_uri_test_equal (baseURI, uri2))
+  if (! GNUNET_FS_uri_test_equal (baseURI, uri2))
   {
     GNUNET_break (0);
     GNUNET_FS_uri_destroy (uri);
     GNUNET_FS_uri_destroy (uri2);
     GNUNET_FS_uri_destroy (baseURI);
-    GNUNET_CONFIGURATION_destroy (cfg);
     return 1;
   }
   GNUNET_FS_uri_destroy (uri2);
@@ -137,7 +130,6 @@ testLocation ()
     fprintf (stderr, "URI parsing failed: %s\n", emsg);
     GNUNET_break (0);
     GNUNET_FS_uri_destroy (uri);
-    GNUNET_CONFIGURATION_destroy (cfg);
     GNUNET_free (emsg);
     return 1;
   }
@@ -147,12 +139,10 @@ testLocation ()
     GNUNET_break (0);
     GNUNET_FS_uri_destroy (uri);
     GNUNET_FS_uri_destroy (uri2);
-    GNUNET_CONFIGURATION_destroy (cfg);
     return 1;
   }
   GNUNET_FS_uri_destroy (uri2);
   GNUNET_FS_uri_destroy (uri);
-  GNUNET_CONFIGURATION_destroy (cfg);
   return 0;
 }