gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] r3428 - in GNUnet: . src/applications/fs/fsui


From: grothoff
Subject: [GNUnet-SVN] r3428 - in GNUnet: . src/applications/fs/fsui
Date: Sat, 30 Sep 2006 21:27:27 -0700 (PDT)

Author: grothoff
Date: 2006-09-30 21:27:24 -0700 (Sat, 30 Sep 2006)
New Revision: 3428

Modified:
   GNUnet/src/applications/fs/fsui/download.c
   GNUnet/src/applications/fs/fsui/downloadtest.c
   GNUnet/src/applications/fs/fsui/fsui.c
   GNUnet/src/applications/fs/fsui/fsuitest.c
   GNUnet/src/applications/fs/fsui/unindex.c
   GNUnet/todo
Log:
fixing fsui tests

Modified: GNUnet/src/applications/fs/fsui/download.c
===================================================================
--- GNUnet/src/applications/fs/fsui/download.c  2006-10-01 04:15:18 UTC (rev 
3427)
+++ GNUnet/src/applications/fs/fsui/download.c  2006-10-01 04:27:24 UTC (rev 
3428)
@@ -578,15 +578,16 @@
   struct GE_Context * ectx;
   unsigned int backup;
 
-  printf("Stop download %p\n", dl);
   ectx = ctx->ectx;
   if (dl == NULL) {
     GE_BREAK(ectx, 0);
     return SYSERR;
   }
+#if 0
   GE_LOG(ectx,
         GE_DEBUG | GE_REQUEST | GE_USER,
         "FSUI_stopDownload called.\n");
+#endif
   MUTEX_LOCK(ctx->lock);
   prev = (dl->parent != NULL) ? dl->parent->child : ctx->activeDownloads.child;
   while ( (prev != dl) &&

Modified: GNUnet/src/applications/fs/fsui/downloadtest.c
===================================================================
--- GNUnet/src/applications/fs/fsui/downloadtest.c      2006-10-01 04:15:18 UTC 
(rev 3427)
+++ GNUnet/src/applications/fs/fsui/downloadtest.c      2006-10-01 04:27:24 UTC 
(rev 3428)
@@ -215,6 +215,7 @@
   struct FSUI_UnindexList * unindex = NULL;
   struct FSUI_UploadList * upload = NULL;
 
+  ok = YES;
   cfg = GC_create_C_impl();
   if (-1 == GC_parse_configuration(cfg,
                                   "check.conf")) {

Modified: GNUnet/src/applications/fs/fsui/fsui.c
===================================================================
--- GNUnet/src/applications/fs/fsui/fsui.c      2006-10-01 04:15:18 UTC (rev 
3427)
+++ GNUnet/src/applications/fs/fsui/fsui.c      2006-10-01 04:27:24 UTC (rev 
3428)
@@ -748,9 +748,10 @@
   int big;
 
   ectx = ctx->ectx;
-  GE_LOG(ectx, 
-        GE_INFO | GE_REQUEST | GE_USER,
-        "FSUI shutdown.  This may take a while.\n");
+  if (ctx->ipc != NULL)
+    GE_LOG(ectx, 
+          GE_INFO | GE_REQUEST | GE_USER,
+          "FSUI shutdown.  This may take a while.\n");
 
   cron_stop(ctx->cron);
   cron_del_job(ctx->cron,
@@ -919,9 +920,10 @@
   MUTEX_DESTROY(ctx->lock);
   FREE(ctx->name);
   FREE(ctx);
-  GE_LOG(ectx,
-        GE_INFO | GE_REQUEST | GE_USER,
-        "FSUI shutdown complete.\n");
+  if (ctx->ipc != NULL)
+    GE_LOG(ectx,
+          GE_INFO | GE_REQUEST | GE_USER,
+          "FSUI shutdown complete.\n");
 }
 
 

Modified: GNUnet/src/applications/fs/fsui/fsuitest.c
===================================================================
--- GNUnet/src/applications/fs/fsui/fsuitest.c  2006-10-01 04:15:18 UTC (rev 
3427)
+++ GNUnet/src/applications/fs/fsui/fsuitest.c  2006-10-01 04:27:24 UTC (rev 
3428)
@@ -30,6 +30,8 @@
 #include "gnunet_util_config_impl.h"
 #include "gnunet_util_network_client.h"
 
+#define DEBUG_VERBOSE NO
+
 #define CHECK(a) if (!(a)) { ok = NO; GE_BREAK(NULL, 0); goto FAILURE; }
 
 static char * makeName(unsigned int i) {
@@ -69,32 +71,36 @@
   case FSUI_unindex_resuming:
     return &unused;
   case FSUI_search_result:
+#if DEBUG_VERBOSE
     printf("Received search result\n");
+#endif
+    fn = makeName(43);
+    download = FSUI_startDownload(ctx,
+                                 0,
+                                 NO,
+                                 event->data.SearchResult.fi.uri,
+                                 fn);    
+    FREE(fn);
     break;
   case FSUI_upload_complete:
+#if DEBUG_VERBOSE
     printf("Upload complete.\n");
+#endif
     break;
   case FSUI_download_complete:
+#if DEBUG_VERBOSE
     printf("Download complete.\n");
+#endif
     break;
   case FSUI_unindex_complete:
+#if DEBUG_VERBOSE
     printf("Unindex complete.\n");
+#endif
     break;
   default:
     break;
   }
-  if (lastEvent == FSUI_download_complete)
-    return NULL; /* ignore all other events */
   lastEvent = event->type;
-  if (event->type == FSUI_search_result) {
-    fn = makeName(43);
-    download = FSUI_startDownload(ctx,
-                                 0,
-                                 NO,
-                                 event->data.SearchResult.fi.uri,
-                                 fn);    
-    FREE(fn);
-  }
   return NULL;
 }
 
@@ -173,6 +179,8 @@
     CHECK(prog < 10000)
 
     PTHREAD_SLEEP(50 * cronMILLIS);
+    if (GNUNET_SHUTDOWN_TEST() == YES)
+      break;
   }
   SNPRINTF(keyword,
           40,
@@ -191,6 +199,8 @@
     prog++;
     CHECK(prog < 10000);
     PTHREAD_SLEEP(50 * cronMILLIS);
+    if (GNUNET_SHUTDOWN_TEST() == YES)
+      break;
   }
   FSUI_stopSearch(ctx,
                  search);
@@ -200,6 +210,8 @@
     prog++;
     CHECK(prog < 10000);
     PTHREAD_SLEEP(50 * cronMILLIS);
+    if (GNUNET_SHUTDOWN_TEST() == YES)
+      break;
   }
   
 

Modified: GNUnet/src/applications/fs/fsui/unindex.c
===================================================================
--- GNUnet/src/applications/fs/fsui/unindex.c   2006-10-01 04:15:18 UTC (rev 
3427)
+++ GNUnet/src/applications/fs/fsui/unindex.c   2006-10-01 04:27:24 UTC (rev 
3428)
@@ -88,9 +88,11 @@
   }
   utc->ctx->ecb(utc->ctx->ecbClosure,
                &event);
+#if 0
   GE_LOG(utc->ctx->ectx, 
         GE_DEBUG | GE_REQUEST | GE_USER,
         "FSUI unindexThread exits.\n");
+#endif
   return NULL;
 }
 
@@ -159,9 +161,11 @@
     GE_BREAK(ectx, 0);
     return SYSERR;
   }
+#if 0
   GE_LOG(ectx,
         GE_DEBUG | GE_REQUEST | GE_USER,
         "FSUI_stopUnindex called.\n");
+#endif
   MUTEX_LOCK(ctx->lock);
   prev = ctx->unindexOperations;
   while ( (prev != dl) &&

Modified: GNUnet/todo
===================================================================
--- GNUnet/todo 2006-10-01 04:15:18 UTC (rev 3427)
+++ GNUnet/todo 2006-10-01 04:27:24 UTC (rev 3428)
@@ -18,9 +18,6 @@
     + loggers: SMTP logger
     + use new loggers in for CS error reporting
   * make testcases compile & pass again:
-    + fs/fsui:
-      - searchtest, downloadtest pass
-      - fsuitest, fsuitest2 -- to be done
     + dht/tools, dht/module
   * transports:
     + SMTP/HTTP: do not yet compile (commented out from build)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]