From: Christian Grothoff Date: Tue, 20 Oct 2009 08:18:33 +0000 (+0000) Subject: final fixes, adding testcase to official suite X-Git-Tag: initial-import-from-subversion-38251~23304 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=6e6ae629601179fba79284331b8860f4272400c6;p=oweals%2Fgnunet.git final fixes, adding testcase to official suite --- diff --git a/src/fs/Makefile.am b/src/fs/Makefile.am index 85470e4d9..1e22b9900 100644 --- a/src/fs/Makefile.am +++ b/src/fs/Makefile.am @@ -108,7 +108,7 @@ check_PROGRAMS = \ test_fs_getopt \ test_fs_uri -TESTS = test_fs_directory test_fs_uri +TESTS = test_fs_directory test_fs_download test_fs_uri # $(check_PROGRAMS) diff --git a/src/fs/fs_download.c b/src/fs/fs_download.c index defc9724f..e0c4471ac 100644 --- a/src/fs/fs_download.c +++ b/src/fs/fs_download.c @@ -36,7 +36,7 @@ #include "fs.h" #include "fs_tree.h" -#define DEBUG_DOWNLOAD GNUNET_YES +#define DEBUG_DOWNLOAD GNUNET_NO /** * We're storing the IBLOCKS after the @@ -339,12 +339,7 @@ process_result (struct GNUNET_FS_DownloadContext *dc, &query); if (NULL == sm) { - GNUNET_break (0); /* FIXME: this assertion actually fails for one - of my tests, the ascii-strings of the - query match what was printed when the - request was originally made; this does - NOT happen if in line ~825 a HT size - of 1 is used! => bug in HT? */ + GNUNET_break (0); return; } if (size != calculate_block_size (GNUNET_ntohll (dc->uri->data.chk.file_length), @@ -442,6 +437,7 @@ process_result (struct GNUNET_FS_DownloadContext *dc, } GNUNET_CLIENT_disconnect (dc->client); dc->client = NULL; + GNUNET_free (sm); return; } } @@ -501,7 +497,10 @@ process_result (struct GNUNET_FS_DownloadContext *dc, } // FIXME: make persistent if (sm->depth == dc->treedepth) - return; + { + GNUNET_free (sm); + return; + } #if DEBUG_DOWNLOAD GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, "Triggering downloads of children (this block was at level %u and offset %llu)\n", @@ -523,6 +522,7 @@ process_result (struct GNUNET_FS_DownloadContext *dc, off, sm->depth + 1); } + GNUNET_free (sm); } diff --git a/src/fs/fs_file_information.c b/src/fs/fs_file_information.c index 6d6a83ffe..d1d897b24 100644 --- a/src/fs/fs_file_information.c +++ b/src/fs/fs_file_information.c @@ -835,6 +835,7 @@ GNUNET_FS_file_information_destroy (struct GNUNET_FS_FileInformation *fi, &fi->client_info); } GNUNET_free_non_null (fi->emsg); + GNUNET_free_non_null (fi->chk_uri); /* clean up serialization */ if ( (NULL != fi->serialization) && (0 != UNLINK (fi->serialization)) ) diff --git a/src/fs/fs_publish.c b/src/fs/fs_publish.c index 145b7605c..c143b6d17 100644 --- a/src/fs/fs_publish.c +++ b/src/fs/fs_publish.c @@ -40,7 +40,7 @@ #include "fs.h" #include "fs_tree.h" -#define DEBUG_PUBLISH GNUNET_YES +#define DEBUG_PUBLISH GNUNET_NO /** * Maximum allowed size for a KBlock. diff --git a/src/fs/fs_tree.c b/src/fs/fs_tree.c index 047fdd332..83da423f3 100644 --- a/src/fs/fs_tree.c +++ b/src/fs/fs_tree.c @@ -31,7 +31,7 @@ #include "platform.h" #include "fs_tree.h" -#define DEBUG_TREE GNUNET_YES +#define DEBUG_TREE GNUNET_NO /** * Context for an ECRS-based file encoder that computes diff --git a/src/fs/gnunet-service-fs.c b/src/fs/gnunet-service-fs.c index 639780fc2..a810e72cb 100644 --- a/src/fs/gnunet-service-fs.c +++ b/src/fs/gnunet-service-fs.c @@ -47,7 +47,7 @@ #include "gnunet_util_lib.h" #include "fs.h" -#define DEBUG_FS GNUNET_YES +#define DEBUG_FS GNUNET_NO /** @@ -875,6 +875,12 @@ read_index_list () "FS"); return; } + if (GNUNET_NO == GNUNET_DISK_file_test (fn)) + { + /* no index info yet */ + GNUNET_free (fn); + return; + } rh = GNUNET_BIO_read_open (fn); if (NULL == rh) { diff --git a/src/fs/test_fs_directory.c b/src/fs/test_fs_directory.c index 1f77dcf14..9783e5903 100644 --- a/src/fs/test_fs_directory.c +++ b/src/fs/test_fs_directory.c @@ -134,7 +134,7 @@ testDirectory (unsigned int i) (unsigned long long) dlen, s); GNUNET_free (s); - if (i < 1000) + if (i < 100) { cls.pos = 0; cls.uri = uris; @@ -169,10 +169,8 @@ main (int argc, char *argv[]) "WARNING", #endif NULL); - for (i = 17; i < 4000; i *= 2) + for (i = 17; i < 1000; i *= 2) failureCount += testDirectory (i); - fprintf (stderr, "\n"); - if (failureCount != 0) return 1; return 0; diff --git a/src/fs/test_fs_download.c b/src/fs/test_fs_download.c index f6fb2a1f2..879f054b8 100644 --- a/src/fs/test_fs_download.c +++ b/src/fs/test_fs_download.c @@ -29,7 +29,7 @@ #include "gnunet_arm_service.h" #include "gnunet_fs_service.h" -#define VERBOSE GNUNET_YES +#define VERBOSE GNUNET_NO #define START_ARM GNUNET_YES diff --git a/src/fs/test_fs_download_data.conf b/src/fs/test_fs_download_data.conf index 41678142c..d55191a32 100644 --- a/src/fs/test_fs_download_data.conf +++ b/src/fs/test_fs_download_data.conf @@ -19,7 +19,7 @@ HOSTNAME = localhost DEFAULTSERVICES = resolver datastore transport core fs [datastore] -DEBUG = YES +#DEBUG = YES [statistics] PORT = 42467 @@ -36,7 +36,7 @@ HOSTNAME = localhost [fs] PORT = 42471 HOSTNAME = localhost -DEBUG = YES +#DEBUG = YES [testing] WEAKRANDOM = YES