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.
15 You should have received a copy of the GNU Affero General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
18 SPDX-License-Identifier: AGPL3.0-or-later
21 * @file fs/test_plugin_block_fs.c
22 * @brief test for plugin_block_fs.c
23 * @author Christian Grothoff
26 #include "gnunet_block_lib.h"
30 test_fs (struct GNUNET_BLOCK_Context *ctx)
32 struct GNUNET_HashCode key;
35 memset (block, 1, sizeof(block));
37 GNUNET_BLOCK_get_key (ctx, GNUNET_BLOCK_TYPE_FS_DBLOCK, block,
40 if (GNUNET_BLOCK_EVALUATION_OK_LAST !=
41 GNUNET_BLOCK_evaluate (ctx,
42 GNUNET_BLOCK_TYPE_FS_DBLOCK,
47 block, sizeof(block)))
49 if (GNUNET_BLOCK_EVALUATION_REQUEST_VALID !=
50 GNUNET_BLOCK_evaluate (ctx,
51 GNUNET_BLOCK_TYPE_FS_DBLOCK,
58 GNUNET_log_skip (1, GNUNET_NO);
59 if (GNUNET_BLOCK_EVALUATION_REQUEST_INVALID !=
60 GNUNET_BLOCK_evaluate (ctx,
61 GNUNET_BLOCK_TYPE_FS_DBLOCK,
68 GNUNET_log_skip (0, GNUNET_YES);
74 main (int argc, char *argv[])
77 struct GNUNET_BLOCK_Context *ctx;
78 struct GNUNET_CONFIGURATION_Handle *cfg;
80 GNUNET_log_setup ("test-block", "WARNING", NULL);
81 cfg = GNUNET_CONFIGURATION_create ();
82 ctx = GNUNET_BLOCK_context_create (cfg);
84 GNUNET_BLOCK_context_destroy (ctx);
85 GNUNET_CONFIGURATION_destroy (cfg);
87 fprintf (stderr, "Tests failed: %d\n", ret);
92 /* end of test_plugin_block_fs.c */