X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=src%2Ffs%2Ftest_fs_file_information.c;h=cc79c8020a71aeeee1ba69f390c6a644ac01e0e4;hb=eef168bdbf40609b944dada415fc536e15cac494;hp=db5a8448aca4c2fc4ed7aaf5f71bb7557ac90868;hpb=5746309cb4be2073d550ad7a6885e918631dbc38;p=oweals%2Fgnunet.git diff --git a/src/fs/test_fs_file_information.c b/src/fs/test_fs_file_information.c index db5a8448a..cc79c8020 100644 --- a/src/fs/test_fs_file_information.c +++ b/src/fs/test_fs_file_information.c @@ -31,12 +31,10 @@ * - other API functions may not yet be tested (such as * filedata-from-callback) */ - #include "platform.h" #include "gnunet_util_lib.h" #include "gnunet_fs_service.h" -#define VERBOSE GNUNET_NO /** * File-size we use for testing. @@ -121,7 +119,7 @@ run (void *cls, char *const *args, const char *cfgfile, fidir = GNUNET_FS_file_information_create_empty_directory (fs, "file_information-context-dir", - kuri, meta, &bo); + kuri, meta, &bo, NULL); GNUNET_assert (GNUNET_OK == GNUNET_FS_file_information_add (fidir, fi1)); GNUNET_assert (GNUNET_OK == GNUNET_FS_file_information_add (fidir, fi2)); GNUNET_FS_uri_destroy (kuri); @@ -137,66 +135,6 @@ run (void *cls, char *const *args, const char *cfgfile, } -static int -testThumbnail () -{ - struct GNUNET_CONTAINER_MetaData *m; - struct GNUNET_CONTAINER_MetaData *d; - struct EXTRACTOR_PluginList *ex; - unsigned char *thumb; - size_t size; - char *date; - - ex = EXTRACTOR_plugin_add_config (NULL, "thumbnailgtk", - EXTRACTOR_OPTION_DEFAULT_POLICY); - if (ex == NULL) - { - fprintf (stderr, - "Test incomplete, have no GTK thumbnail extractor available.\n"); - return 0; /* can not test, no thumbnailer */ - } - ex = EXTRACTOR_plugin_add_config (ex, "mime", - EXTRACTOR_OPTION_DEFAULT_POLICY); - m = GNUNET_CONTAINER_meta_data_create (); - if (3 != - GNUNET_FS_meta_data_extract_from_file (m, - "test_fs_file_information_meta_data_image.jpg", - ex)) - { - GNUNET_break (0); - EXTRACTOR_plugin_remove_all (ex); - GNUNET_CONTAINER_meta_data_destroy (m); - return 1; - } - EXTRACTOR_plugin_remove_all (ex); - d = GNUNET_CONTAINER_meta_data_duplicate (m); - GNUNET_CONTAINER_meta_data_destroy (m); - thumb = NULL; - size = GNUNET_CONTAINER_meta_data_get_thumbnail (d, &thumb); - if (size == 0) - { - GNUNET_break (0); - GNUNET_CONTAINER_meta_data_destroy (d); - return 1; - } - GNUNET_free (thumb); - GNUNET_CONTAINER_meta_data_add_publication_date (d); - date = - GNUNET_CONTAINER_meta_data_get_by_type (d, - EXTRACTOR_METATYPE_PUBLICATION_DATE); - if (date == NULL) - { - GNUNET_break (0); - GNUNET_CONTAINER_meta_data_destroy (d); - return 1; - } - GNUNET_free (date); - GNUNET_CONTAINER_meta_data_destroy (d); - return 0; -} - - - int main (int argc, char *argv[]) { @@ -204,9 +142,6 @@ main (int argc, char *argv[]) "test-fs-file_information", "-c", "test_fs_file_information_data.conf", -#if VERBOSE - "-L", "DEBUG", -#endif NULL }; struct GNUNET_GETOPT_CommandLineOption options[] = { @@ -214,14 +149,8 @@ main (int argc, char *argv[]) }; GNUNET_log_setup ("test_fs_file_information", -#if VERBOSE - "DEBUG", -#else "WARNING", -#endif NULL); - if (0 != testThumbnail ()) - return 1; GNUNET_PROGRAM_run ((sizeof (argvx) / sizeof (char *)) - 1, argvx, "test-fs-file_information", "nohelp", options, &run, NULL);