summaryrefslogtreecommitdiff
path: root/src/fs/test_plugin_block_fs.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fs/test_plugin_block_fs.c')
-rw-r--r--src/fs/test_plugin_block_fs.c70
1 files changed, 35 insertions, 35 deletions
diff --git a/src/fs/test_plugin_block_fs.c b/src/fs/test_plugin_block_fs.c
index 53f7304dd..305da2f18 100644
--- a/src/fs/test_plugin_block_fs.c
+++ b/src/fs/test_plugin_block_fs.c
@@ -27,64 +27,64 @@
27 27
28 28
29static int 29static int
30test_fs(struct GNUNET_BLOCK_Context *ctx) 30test_fs (struct GNUNET_BLOCK_Context *ctx)
31{ 31{
32 struct GNUNET_HashCode key; 32 struct GNUNET_HashCode key;
33 char block[4]; 33 char block[4];
34 34
35 memset(block, 1, sizeof(block)); 35 memset (block, 1, sizeof(block));
36 if (GNUNET_OK != 36 if (GNUNET_OK !=
37 GNUNET_BLOCK_get_key(ctx, GNUNET_BLOCK_TYPE_FS_DBLOCK, block, 37 GNUNET_BLOCK_get_key (ctx, GNUNET_BLOCK_TYPE_FS_DBLOCK, block,
38 sizeof(block), &key)) 38 sizeof(block), &key))
39 return 1; 39 return 1;
40 if (GNUNET_BLOCK_EVALUATION_OK_LAST != 40 if (GNUNET_BLOCK_EVALUATION_OK_LAST !=
41 GNUNET_BLOCK_evaluate(ctx, 41 GNUNET_BLOCK_evaluate (ctx,
42 GNUNET_BLOCK_TYPE_FS_DBLOCK, 42 GNUNET_BLOCK_TYPE_FS_DBLOCK,
43 NULL, 43 NULL,
44 GNUNET_BLOCK_EO_NONE, 44 GNUNET_BLOCK_EO_NONE,
45 &key, 45 &key,
46 NULL, 0, 46 NULL, 0,
47 block, sizeof(block))) 47 block, sizeof(block)))
48 return 2; 48 return 2;
49 if (GNUNET_BLOCK_EVALUATION_REQUEST_VALID != 49 if (GNUNET_BLOCK_EVALUATION_REQUEST_VALID !=
50 GNUNET_BLOCK_evaluate(ctx, 50 GNUNET_BLOCK_evaluate (ctx,
51 GNUNET_BLOCK_TYPE_FS_DBLOCK, 51 GNUNET_BLOCK_TYPE_FS_DBLOCK,
52 NULL, 52 NULL,
53 GNUNET_BLOCK_EO_NONE, 53 GNUNET_BLOCK_EO_NONE,
54 &key, 54 &key,
55 NULL, 0, 55 NULL, 0,
56 NULL, 0)) 56 NULL, 0))
57 return 4; 57 return 4;
58 GNUNET_log_skip(1, GNUNET_NO); 58 GNUNET_log_skip (1, GNUNET_NO);
59 if (GNUNET_BLOCK_EVALUATION_REQUEST_INVALID != 59 if (GNUNET_BLOCK_EVALUATION_REQUEST_INVALID !=
60 GNUNET_BLOCK_evaluate(ctx, 60 GNUNET_BLOCK_evaluate (ctx,
61 GNUNET_BLOCK_TYPE_FS_DBLOCK, 61 GNUNET_BLOCK_TYPE_FS_DBLOCK,
62 NULL, 62 NULL,
63 GNUNET_BLOCK_EO_NONE, 63 GNUNET_BLOCK_EO_NONE,
64 &key, 64 &key,
65 "bogus", 5, 65 "bogus", 5,
66 NULL, 0)) 66 NULL, 0))
67 return 8; 67 return 8;
68 GNUNET_log_skip(0, GNUNET_YES); 68 GNUNET_log_skip (0, GNUNET_YES);
69 return 0; 69 return 0;
70} 70}
71 71
72 72
73int 73int
74main(int argc, char *argv[]) 74main (int argc, char *argv[])
75{ 75{
76 int ret; 76 int ret;
77 struct GNUNET_BLOCK_Context *ctx; 77 struct GNUNET_BLOCK_Context *ctx;
78 struct GNUNET_CONFIGURATION_Handle *cfg; 78 struct GNUNET_CONFIGURATION_Handle *cfg;
79 79
80 GNUNET_log_setup("test-block", "WARNING", NULL); 80 GNUNET_log_setup ("test-block", "WARNING", NULL);
81 cfg = GNUNET_CONFIGURATION_create(); 81 cfg = GNUNET_CONFIGURATION_create ();
82 ctx = GNUNET_BLOCK_context_create(cfg); 82 ctx = GNUNET_BLOCK_context_create (cfg);
83 ret = test_fs(ctx); 83 ret = test_fs (ctx);
84 GNUNET_BLOCK_context_destroy(ctx); 84 GNUNET_BLOCK_context_destroy (ctx);
85 GNUNET_CONFIGURATION_destroy(cfg); 85 GNUNET_CONFIGURATION_destroy (cfg);
86 if (ret != 0) 86 if (ret != 0)
87 fprintf(stderr, "Tests failed: %d\n", ret); 87 fprintf (stderr, "Tests failed: %d\n", ret);
88 return ret; 88 return ret;
89} 89}
90 90