diff options
author | Christian Grothoff <christian@grothoff.org> | 2010-03-24 15:12:10 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2010-03-24 15:12:10 +0000 |
commit | afdadb72f52b2a67d8ec989283ecc66edac6c987 (patch) | |
tree | e293c752738d3cd43ff2f5a6052c8401560a6316 /src/fs/test_fs_namespace.c | |
parent | e3820dded23c07ccddacbae87c862800e6174ccb (diff) | |
download | gnunet-afdadb72f52b2a67d8ec989283ecc66edac6c987.tar.gz gnunet-afdadb72f52b2a67d8ec989283ecc66edac6c987.zip |
better
Diffstat (limited to 'src/fs/test_fs_namespace.c')
-rw-r--r-- | src/fs/test_fs_namespace.c | 50 |
1 files changed, 34 insertions, 16 deletions
diff --git a/src/fs/test_fs_namespace.c b/src/fs/test_fs_namespace.c index 825612b1a..0972730d2 100644 --- a/src/fs/test_fs_namespace.c +++ b/src/fs/test_fs_namespace.c | |||
@@ -109,40 +109,58 @@ publish_cont (void *cls, | |||
109 | search = GNUNET_FS_search_start (fs, uri, 1, "ns-search"); | 109 | search = GNUNET_FS_search_start (fs, uri, 1, "ns-search"); |
110 | } | 110 | } |
111 | 111 | ||
112 | |||
113 | static void | 112 | static void |
114 | testNamespace () | 113 | adv_cont (void *cls, |
114 | const struct GNUNET_FS_Uri *uri, | ||
115 | const char *emsg) | ||
115 | { | 116 | { |
116 | struct GNUNET_FS_Namespace *ns; | 117 | struct GNUNET_FS_SearchContext *search; |
117 | struct GNUNET_FS_Uri *adv; | ||
118 | struct GNUNET_CONTAINER_MetaData *meta; | 118 | struct GNUNET_CONTAINER_MetaData *meta; |
119 | struct GNUNET_FS_Namespace *ns; | ||
119 | struct GNUNET_TIME_Absolute expiration; | 120 | struct GNUNET_TIME_Absolute expiration; |
120 | 121 | ||
121 | expiration = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_MINUTES); | 122 | expiration = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_MINUTES); |
122 | meta = GNUNET_CONTAINER_meta_data_create (); | ||
123 | adv = GNUNET_FS_uri_ksk_create ("testNamespace", NULL); | ||
124 | ns = GNUNET_FS_namespace_create (fs, | 123 | ns = GNUNET_FS_namespace_create (fs, |
125 | "testNamespace"); | 124 | "testNamespace"); |
126 | GNUNET_FS_namespace_advertise (fs, | 125 | meta = GNUNET_CONTAINER_meta_data_create (); |
127 | ns, | 126 | GNUNET_assert (NULL == emsg); |
128 | meta, | 127 | fprintf (stderr, "Starting namespace search...\n"); |
129 | 1, 1, | 128 | search = GNUNET_FS_search_start (fs, uri, 1, "ns-search"); |
130 | expiration, | ||
131 | "root", | ||
132 | &publish_cont, NULL); | ||
133 | #if 0 | ||
134 | GNUNET_FS_publish_sks (fs, | 129 | GNUNET_FS_publish_sks (fs, |
135 | ns, | 130 | ns, |
136 | "this", | 131 | "this", |
137 | "next", | 132 | "next", |
138 | meta, | 133 | meta, |
139 | rootUri, | 134 | uri, |
140 | expiration, | 135 | expiration, |
141 | 1, 1, | 136 | 1, 1, |
142 | GNUNET_FS_PUBLISH_OPTION_NONE, | 137 | GNUNET_FS_PUBLISH_OPTION_NONE, |
143 | &publish_cont, | 138 | &publish_cont, |
144 | NULL); | 139 | NULL); |
145 | #endif | 140 | GNUNET_CONTAINER_meta_data_destroy (meta); |
141 | GNUNET_FS_namespace_delete (ns, GNUNET_NO); | ||
142 | } | ||
143 | |||
144 | |||
145 | static void | ||
146 | testNamespace () | ||
147 | { | ||
148 | struct GNUNET_FS_Namespace *ns; | ||
149 | struct GNUNET_TIME_Absolute expiration; | ||
150 | struct GNUNET_CONTAINER_MetaData *meta; | ||
151 | |||
152 | expiration = GNUNET_TIME_relative_to_absolute (GNUNET_TIME_UNIT_MINUTES); | ||
153 | meta = GNUNET_CONTAINER_meta_data_create (); | ||
154 | ns = GNUNET_FS_namespace_create (fs, | ||
155 | "testNamespace"); | ||
156 | GNUNET_FS_namespace_advertise (fs, | ||
157 | ns, | ||
158 | meta, | ||
159 | 1, 1, | ||
160 | expiration, | ||
161 | "root", | ||
162 | &adv_cont, NULL); | ||
163 | GNUNET_FS_namespace_delete (ns, GNUNET_NO); | ||
146 | GNUNET_CONTAINER_meta_data_destroy (meta); | 164 | GNUNET_CONTAINER_meta_data_destroy (meta); |
147 | } | 165 | } |
148 | 166 | ||