2 This file is part of GNUnet
3 (C) 2010 Christian Grothoff (and other contributing authors)
5 GNUnet is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published
7 by the Free Software Foundation; either version 3, or (at your
8 option) any later version.
10 GNUnet is distributed in the hope that it will be useful, but
11 WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 General Public License for more details.
15 You should have received a copy of the GNU General Public License
16 along with GNUnet; see the file COPYING. If not, write to the
17 Free Software Foundation, Inc., 59 Temple Place - Suite 330,
18 Boston, MA 02111-1307, USA.
21 * @file block/test_block.c
22 * @brief test for block.c
23 * @author Christian Grothoff
26 #include "gnunet_block_lib.h"
28 #define DEBUG GNUNET_EXTRA_LOGGING
30 #define VERBOSE GNUNET_EXTRA_LOGGING
33 test_fs (struct GNUNET_BLOCK_Context *ctx)
38 memset (block, 1, sizeof (block));
40 GNUNET_BLOCK_get_key (ctx, GNUNET_BLOCK_TYPE_FS_DBLOCK, block,
41 sizeof (block), &key))
43 if (GNUNET_BLOCK_EVALUATION_OK_LAST !=
44 GNUNET_BLOCK_evaluate (ctx, GNUNET_BLOCK_TYPE_FS_DBLOCK, &key, NULL, 0,
45 NULL, 0, block, sizeof (block)))
47 if (GNUNET_BLOCK_EVALUATION_REQUEST_VALID !=
48 GNUNET_BLOCK_evaluate (ctx, GNUNET_BLOCK_TYPE_FS_DBLOCK, &key, NULL, 0,
51 GNUNET_log_skip (1, GNUNET_NO);
52 if (GNUNET_BLOCK_EVALUATION_REQUEST_INVALID !=
53 GNUNET_BLOCK_evaluate (ctx, GNUNET_BLOCK_TYPE_FS_DBLOCK, &key, NULL, 0,
56 GNUNET_log_skip (0, GNUNET_YES);
61 main (int argc, char *argv[])
64 struct GNUNET_BLOCK_Context *ctx;
65 struct GNUNET_CONFIGURATION_Handle *cfg;
67 GNUNET_log_setup ("test-block", "WARNING", NULL);
68 cfg = GNUNET_CONFIGURATION_create ();
69 GNUNET_CONFIGURATION_set_value_string (cfg, "block", "PLUGINS", "fs");
70 ctx = GNUNET_BLOCK_context_create (cfg);
72 GNUNET_BLOCK_context_destroy (ctx);
73 GNUNET_CONFIGURATION_destroy (cfg);
75 fprintf (stderr, "Tests failed: %d\n", ret);