aboutsummaryrefslogtreecommitdiff
path: root/src/util/test_container_meta_data.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2010-05-31 08:24:42 +0000
committerChristian Grothoff <christian@grothoff.org>2010-05-31 08:24:42 +0000
commit5554d773fef027d978d8b94f2cfe10b3206c5916 (patch)
tree22c4d3cf3b820248a15fa86552dfa3d505dbc09d /src/util/test_container_meta_data.c
parent46e277f53de5d77ba4414c178b511278c21b1789 (diff)
downloadgnunet-5554d773fef027d978d8b94f2cfe10b3206c5916.tar.gz
gnunet-5554d773fef027d978d8b94f2cfe10b3206c5916.zip
done
Diffstat (limited to 'src/util/test_container_meta_data.c')
-rw-r--r--src/util/test_container_meta_data.c56
1 files changed, 0 insertions, 56 deletions
diff --git a/src/util/test_container_meta_data.c b/src/util/test_container_meta_data.c
index b6196da14..a439362d0 100644
--- a/src/util/test_container_meta_data.c
+++ b/src/util/test_container_meta_data.c
@@ -231,61 +231,6 @@ testMetaLink ()
231} 231}
232 232
233 233
234static int
235testThumbnail ()
236{
237 struct GNUNET_CONTAINER_MetaData *m;
238 struct GNUNET_CONTAINER_MetaData *d;
239 struct EXTRACTOR_PluginList *ex;
240 unsigned char *thumb;
241 size_t size;
242 char *date;
243
244 ex = EXTRACTOR_plugin_add_config (NULL, "thumbnailgtk", EXTRACTOR_OPTION_DEFAULT_POLICY);
245 if (ex == NULL)
246 {
247 fprintf (stderr,
248 "Test incomplete, have no GTK thumbnail extractor available.\n");
249 return 0; /* can not test, no thumbnailer */
250 }
251 ex = EXTRACTOR_plugin_add_config (ex, "mime", EXTRACTOR_OPTION_DEFAULT_POLICY);
252 m = GNUNET_CONTAINER_meta_data_create ();
253 if (3 != GNUNET_CONTAINER_meta_data_extract_from_file (m,
254 "test_container_meta_data_image.jpg",
255 ex))
256 {
257 GNUNET_break (0);
258 EXTRACTOR_plugin_remove_all (ex);
259 GNUNET_CONTAINER_meta_data_destroy (m);
260 return 1;
261 }
262 EXTRACTOR_plugin_remove_all (ex);
263 d = GNUNET_CONTAINER_meta_data_duplicate (m);
264 GNUNET_CONTAINER_meta_data_destroy (m);
265 thumb = NULL;
266 size = GNUNET_CONTAINER_meta_data_get_thumbnail (d, &thumb);
267 if (size == 0)
268 {
269 GNUNET_break (0);
270 GNUNET_CONTAINER_meta_data_destroy (d);
271 return 1;
272 }
273 GNUNET_free (thumb);
274 GNUNET_CONTAINER_meta_data_add_publication_date (d);
275 date = GNUNET_CONTAINER_meta_data_get_by_type (d,
276 EXTRACTOR_METATYPE_PUBLICATION_DATE);
277 if (date == NULL)
278 {
279 GNUNET_break (0);
280 GNUNET_CONTAINER_meta_data_destroy (d);
281 return 1;
282 }
283 GNUNET_free (date);
284 GNUNET_CONTAINER_meta_data_destroy (d);
285 return 0;
286}
287
288
289int 234int
290main (int argc, char *argv[]) 235main (int argc, char *argv[])
291{ 236{
@@ -298,7 +243,6 @@ main (int argc, char *argv[])
298 for (i = 1; i < 255; i++) 243 for (i = 1; i < 255; i++)
299 failureCount += testMetaMore (i); 244 failureCount += testMetaMore (i);
300 failureCount += testMetaLink (); 245 failureCount += testMetaLink ();
301 failureCount += testThumbnail ();
302 246
303 if (failureCount != 0) 247 if (failureCount != 0)
304 return 1; 248 return 1;