/*
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
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
}
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);
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
&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);
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;
}
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;
}