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

kdenonbeta/kdedebian/kapture



CVS commit by mornfall: 

- remove implicit loadAll in pkgcache, add explicit calls as needed
- turn pkgcache-test into unit test (disabled, needs fix in pkgcache)
- TODO ++


  M +2 -0      TODO   1.51
  M +1 -0      kapture/kapture.cpp   1.33
  M +1 -0      kurrent/kurrent.cpp   1.3
  M +1 -1      libcapture/pkgmanager.cpp   1.39
  M +3 -2      tests/libcapture/Makefile.am   1.5
  M +1 -0      tests/libcapture/celem-test.cpp   1.3
  M +65 -60    tests/libcapture/pkgcache-test.cpp   1.2


--- kdenonbeta/kdedebian/kapture/TODO  #1.50:1.51
@@ -188,4 +188,6 @@
   - add broken-fixing (-f) mode
 
+  USE OPSTATUS [done: 0%]
+
   PROGRESS/DPKG EMBEDDED INTO KAPTURE WINDOW [done: 40%]
   Embed acqprogress, dpkg and stuff into main kapture window and create

--- kdenonbeta/kdedebian/kapture/kapture/kapture.cpp  #1.32:1.33
@@ -56,4 +56,5 @@ Kapture::Kapture()
 {
     KaptureManager::inst ();
+    PkgManager::instance () -> loadAll ();
     // accept dnd
     // setAcceptDrops(true);

--- kdenonbeta/kdedebian/kapture/kurrent/kurrent.cpp  #1.2:1.3
@@ -33,4 +33,5 @@ Kurrent::Kurrent ()
 {
     KaptureManager::inst ();
+    PkgManager::instance () -> loadAll ();
 
     // set up the kapture libs

--- kdenonbeta/kdedebian/kapture/libcapture/pkgmanager.cpp  #1.38:1.39
@@ -79,5 +79,5 @@ PkgManager::PkgManager ()
     }
 
-    loadAll ();
+    // loadAll ();
 
     // GrouperFactory::registerDefault ();

--- kdenonbeta/kdedebian/kapture/tests/libcapture/Makefile.am  #1.4:1.5
@@ -4,5 +4,5 @@
 
 # set the include path for X, qt and KDE
-INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/libcapture -I$(top_srcdir)/tests -I/usr/include/libtagcoll $(all_includes)
+INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/libcapture -I$(top_srcdir)/tests -I/usr/include/libtagcoll $(all_includes) -DCACHE_DIR=\"$(top_srcdir)/tests/apt-cache/\"
 
 # these are the headers for your project
@@ -25,5 +25,6 @@
 
 libcapture_test_la_SOURCES = \
-    stl_util-test.cpp grouper-test.cpp celem-test.cpp
+    stl_util-test.cpp grouper-test.cpp celem-test.cpp \
+    pkgcache-test.cpp
 
 libcapture_test_SOURCES = ../tut-main.cpp

--- kdenonbeta/kdedebian/kapture/tests/libcapture/celem-test.cpp  #1.2:1.3
@@ -18,4 +18,5 @@ namespace tut {
     void to::test<1> ()
     {
+        PkgManager::instance () -> loadAll ();
         PkgCElemPtr a = cElem (PkgManager::cache () -> FindPkg ("postfix"));
         ensure (a -> id () == string ("postfix"));

--- kdenonbeta/kdedebian/kapture/tests/libcapture/pkgcache-test.cpp  #1.1:1.2
@@ -1,22 +1,27 @@
-#include <sys/resource.h>
+#include <tut.h>
 
-#include "pkgcache.h"
-#include "pkgmanager.h"
+#include <libcapture/pkgcache.h>
+#include <libcapture/pkgmanager.h>
+#include <apt-pkg/configuration.h>
 #include <iostream>
 
-using namespace capture;
-using namespace std;
+namespace tut {
 
-// XXX investigate why netbase has wanted_pri 500 from postfix; it should be
-// 60 from exim as far as i can see (ie, postfix is unwanted, really)
+    using namespace std;
+    using namespace capture;
 
-int main ()
-{
-    /* struct rlimit l;
-    getrlimit (RLIMIT_STACK, &l);
-    cerr << "stack limits: " << l . rlim_cur << ", " << l . rlim_max << endl;
-    l . rlim_cur = l . rlim_max;
-    setrlimit (RLIMIT_STACK, &l); */
+    struct pkgcache_shar {
+    };
 
+    typedef test_group<pkgcache_shar> tg;
+    typedef tg::object to;
+    tg pkgcache_tg ("pkgcache");
+    template<> template<>
+    void to::test<1> ()
+    {
+        PkgManager::instance ();
+        _config -> Set ("Dir::Cache", CACHE_DIR);
+        return; // need a way to put cache into extState mode
+        PkgManager::instance () -> loadAll ();
     pkgCache::PkgIterator P;
     // P = (PkgManager::cache ()) -> FindPkg ("amavis-ng");
@@ -25,8 +30,8 @@ int main ()
     P = (PkgManager::cache ()) -> FindPkg ("k3b");
     PkgManager::cache () -> setExtState (P, true, 500);
-    PkgManager::cache () -> updateAWanted (true);
+        PkgManager::cache () -> updateAWanted ();
     P = (PkgManager::cache ()) -> FindPkg ("kapture");
     PkgManager::cache () -> setExtState (P, true, 500);
-    PkgManager::cache () -> updateAWanted (true);
+        PkgManager::cache () -> updateAWanted ();
     /* P = (PkgManager::cache ()) -> FindPkg ("apt-listchanges");
     PkgManager::cache () -> setExtState (P, true, 900);
@@ -66,4 +71,4 @@ int main ()
         }
     }
-    return 0;
+    }
 }




Reply to: