2 This file is part of GNUnet
3 Copyright (C) 2010, 2012 GNUnet e.V.
5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Affero General Public License as published
7 by the Free Software Foundation, either version 3 of the License,
8 or (at your 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 Affero General Public License for more details.
16 * @file fs/test_plugin_block_fs.c
17 * @brief test for plugin_block_fs.c
18 * @author Christian Grothoff
21 #include "gnunet_block_lib.h"
25 test_fs (struct GNUNET_BLOCK_Context *ctx)
27 struct GNUNET_HashCode key;
30 memset (block, 1, sizeof (block));
32 GNUNET_BLOCK_get_key (ctx, GNUNET_BLOCK_TYPE_FS_DBLOCK, block,
33 sizeof (block), &key))
35 if (GNUNET_BLOCK_EVALUATION_OK_LAST !=
36 GNUNET_BLOCK_evaluate (ctx,
37 GNUNET_BLOCK_TYPE_FS_DBLOCK,
42 block, sizeof (block)))
44 if (GNUNET_BLOCK_EVALUATION_REQUEST_VALID !=
45 GNUNET_BLOCK_evaluate (ctx,
46 GNUNET_BLOCK_TYPE_FS_DBLOCK,
53 GNUNET_log_skip (1, GNUNET_NO);
54 if (GNUNET_BLOCK_EVALUATION_REQUEST_INVALID !=
55 GNUNET_BLOCK_evaluate (ctx,
56 GNUNET_BLOCK_TYPE_FS_DBLOCK,
63 GNUNET_log_skip (0, GNUNET_YES);
69 main (int argc, char *argv[])
72 struct GNUNET_BLOCK_Context *ctx;
73 struct GNUNET_CONFIGURATION_Handle *cfg;
75 GNUNET_log_setup ("test-block", "WARNING", NULL);
76 cfg = GNUNET_CONFIGURATION_create ();
77 ctx = GNUNET_BLOCK_context_create (cfg);
79 GNUNET_BLOCK_context_destroy (ctx);
80 GNUNET_CONFIGURATION_destroy (cfg);
82 FPRINTF (stderr, "Tests failed: %d\n", ret);
86 /* end of test_plugin_block_fs.c */