gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r3327 - in GNUnet: . src/applications/sqstore_mysql src/app


From: grothoff
Subject: [GNUnet-SVN] r3327 - in GNUnet: . src/applications/sqstore_mysql src/applications/sqstore_sqlite src/util/error
Date: Sat, 26 Aug 2006 21:32:10 -0700 (PDT)

Author: grothoff
Date: 2006-08-26 21:32:06 -0700 (Sat, 26 Aug 2006)
New Revision: 3327

Modified:
   GNUnet/src/applications/sqstore_mysql/Makefile.am
   GNUnet/src/applications/sqstore_mysql/mysqltest.c
   GNUnet/src/applications/sqstore_sqlite/Makefile.am
   GNUnet/src/applications/sqstore_sqlite/sqlitetest.c
   GNUnet/src/util/error/error.c
   GNUnet/todo
Log:
fixing sqstore tests

Modified: GNUnet/src/applications/sqstore_mysql/Makefile.am
===================================================================
--- GNUnet/src/applications/sqstore_mysql/Makefile.am   2006-08-27 04:23:24 UTC 
(rev 3326)
+++ GNUnet/src/applications/sqstore_mysql/Makefile.am   2006-08-27 04:32:06 UTC 
(rev 3327)
@@ -34,4 +34,5 @@
  mysqltest.c 
 mysqltest_LDADD = \
  $(top_builddir)/src/util/libgnunetutil.la \
+ $(top_builddir)/src/util/config_impl/libgnunetutil_config.la  \
  $(top_builddir)/src/server/libgnunetcore.la
\ No newline at end of file

Modified: GNUnet/src/applications/sqstore_mysql/mysqltest.c
===================================================================
--- GNUnet/src/applications/sqstore_mysql/mysqltest.c   2006-08-27 04:23:24 UTC 
(rev 3326)
+++ GNUnet/src/applications/sqstore_mysql/mysqltest.c   2006-08-27 04:32:06 UTC 
(rev 3327)
@@ -25,6 +25,8 @@
 
 #include "platform.h"
 #include "gnunet_util.h"
+#include "gnunet_util_cron.h"
+#include "gnunet_util_config_impl.h"
 #include "gnunet_protocols.h"
 #include "gnunet_sqstore_service.h"
 #include "core.h"
@@ -226,35 +228,27 @@
   return SYSERR;
 }
 
-/**
- * Perform option parsing from the command line.
- */
-static int parser(int argc,
-                 char * argv[]) {
-  FREENONNULL(setConfigurationString("GNUNETD",
-                                    "_MAGIC_",
-                                    "YES"));
-  FREENONNULL(setConfigurationString("GNUNETD",
-                                    "LOGFILE",
-                                    NULL));
-  FREENONNULL(setConfigurationString("FILES",
-                                    "gnunet.conf",
-                                    "check.conf"));
-  return OK;
-}
-
 int main(int argc, char *argv[]) {
   SQstore_ServiceAPI * api;
   int ok;
+  struct GC_Configuration * cfg;
+  struct CronManager * cron;
 
-  if (OK != initUtil(argc, argv, &parser))
-    errexit(_("Could not initialize libgnunetutil!\n"));
-  initCore();
+  cfg = GC_create_C_impl();
+  if (-1 == GC_parse_configuration(cfg,
+                                  "check.conf")) {
+    GC_free(cfg);
+    return -1;  
+  }
+  cron = cron_create(NULL);
+  initCore(NULL,
+          cfg,
+          cron,
+          NULL);
   api = requestService("sqstore");
   if (api == NULL) {
-    GE_BREAK(ectx, 0);
+    GE_BREAK(NULL, 0);
     doneCore();
-    doneUtil();
     return 1;
   }
   ok = SYSERR;
@@ -266,15 +260,13 @@
       ok = test(api);
       releaseService(api);
     } else {
-      GE_BREAK(ectx, 0);
+      GE_BREAK(NULL, 0);
     }
   }
   doneCore();
-  doneUtil();
   if (ok == SYSERR)
     return 1;
-  else
-    return 0;
+  return 0;
 }
 
 /* end of mysqltest.c */

Modified: GNUnet/src/applications/sqstore_sqlite/Makefile.am
===================================================================
--- GNUnet/src/applications/sqstore_sqlite/Makefile.am  2006-08-27 04:23:24 UTC 
(rev 3326)
+++ GNUnet/src/applications/sqstore_sqlite/Makefile.am  2006-08-27 04:32:06 UTC 
(rev 3327)
@@ -30,4 +30,5 @@
  sqlitetest.c 
 sqlitetest_LDADD = \
  $(top_builddir)/src/server/libgnunetcore.la  \
+ $(top_builddir)/src/util/config_impl/libgnunetutil_config.la  \
  $(top_builddir)/src/util/libgnunetutil.la  

Modified: GNUnet/src/applications/sqstore_sqlite/sqlitetest.c
===================================================================
--- GNUnet/src/applications/sqstore_sqlite/sqlitetest.c 2006-08-27 04:23:24 UTC 
(rev 3326)
+++ GNUnet/src/applications/sqstore_sqlite/sqlitetest.c 2006-08-27 04:32:06 UTC 
(rev 3327)
@@ -25,6 +25,8 @@
 
 #include "platform.h"
 #include "gnunet_util.h"
+#include "gnunet_util_cron.h"
+#include "gnunet_util_config_impl.h"
 #include "gnunet_protocols.h"
 #include "gnunet_sqstore_service.h"
 #include "core.h"
@@ -229,36 +231,23 @@
 
 #define TEST_DB "/tmp/GNUnet_sqstore_test/"
 
-/**
- * Perform option parsing from the command line.
- */
-static int parser(int argc,
-                 char * argv[]) {
-  FREENONNULL(setConfigurationString("GNUNETD",
-                                    "_MAGIC_",
-                                    "YES"));
-  FREENONNULL(setConfigurationString("GNUNETD",
-                                    "LOGFILE",
-                                    NULL));
-  FREENONNULL(setConfigurationString("GNUNETD",
-                                    "GNUNETD_HOME",
-                                    "/tmp/gnunet_test/"));
-  FREENONNULL(setConfigurationString("FILES",
-                                    "gnunet.conf",
-                                    "check.conf"));
-  FREENONNULL(setConfigurationString("FS",
-                                    "DIR",
-                                    TEST_DB));
-  return OK;
-}
-
 int main(int argc, char *argv[]) {
   SQstore_ServiceAPI * api;
   int ok;
+  struct GC_Configuration * cfg;
+  struct CronManager * cron;
 
-  if (OK != initUtil(argc, argv, &parser))
-    errexit(_("Could not initialize libgnunetutil!\n"));
-  initCore();
+ cfg = GC_create_C_impl();
+ if (-1 == GC_parse_configuration(cfg,
+                                 "check.conf")) {
+   GC_free(cfg);
+   return -1;  
+ }
+ cron = cron_create(NULL);
+   initCore(NULL,
+          cfg,
+          cron,
+          NULL);
   api = requestService("sqstore");
   if (api != NULL) {
     ok = test(api);
@@ -266,11 +255,11 @@
   } else
     ok = SYSERR;
   doneCore();
-  doneUtil();
+  cron_destroy(cron);  
+  GC_free(cfg);
   if (ok == SYSERR)
     return 1;
-  else
-    return 0;
+  return 0;
 }
 
 /* end of sqlitetest.c */

Modified: GNUnet/src/util/error/error.c
===================================================================
--- GNUnet/src/util/error/error.c       2006-08-27 04:23:24 UTC (rev 3326)
+++ GNUnet/src/util/error/error.c       2006-08-27 04:32:06 UTC (rev 3327)
@@ -140,6 +140,8 @@
  */
 int GE_isLogged(GE_Context * ctx,
                GE_KIND kind) {
+  if (ctx == NULL)
+    return YES;
   return GE_applies(kind,
                    ctx->mask);
 }

Modified: GNUnet/todo
===================================================================
--- GNUnet/todo 2006-08-27 04:23:24 UTC (rev 3326)
+++ GNUnet/todo 2006-08-27 04:32:06 UTC (rev 3327)
@@ -21,8 +21,6 @@
   * make testcases compile & pass again:
     + util/network_client/ 
     + session
-    + sqstore_sqlite
-    + sqstore_mysql
     + gap
     + fs/ecrs
     + fs/lib





reply via email to

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