resetting valid solver run in order to get a complete solver run for the testcase
authorStefan Schubert <schubi@suse.de>
Thu, 22 Mar 2007 12:18:36 +0000 (12:18 +0000)
committerStefan Schubert <schubi@suse.de>
Thu, 22 Mar 2007 12:18:36 +0000 (12:18 +0000)
zypp/solver/detail/ContextPool.h
zypp/solver/detail/Resolver.cc
zypp/solver/detail/Resolver.h
zypp/solver/detail/Testcase.cc

index 8dbc1b7..59a228c 100644 (file)
@@ -112,6 +112,13 @@ class ContextPool : public base::ReferenceCounted, private base::NonCopyable {
     ResolverContext_Ptr findContext (PoolItemList & installItems,
                                     PoolItemList & deleteItems,
                                     const PoolItemList & lockUninstalledItems);
+
+    /** 
+     * Delete all sucessful solver run.
+     *
+     * */         
+    void reset () { contextList.clear(); }
+    
 };
 ///////////////////////////////////////////////////////////////////
     };// namespace detail
index ecc2902..458497e 100644 (file)
@@ -136,7 +136,7 @@ Resolver::pool (void) const
 }
 
 void
-Resolver::reset (void)
+Resolver::reset (const bool resetValidResults)
 {
     _verifying = false;
 
@@ -160,6 +160,9 @@ Resolver::reset (void)
 
     _best_context = NULL;
     _timed_out = false;
+
+    if (resetValidResults)
+       contextPool.reset();
     
 }
 
index 2234f99..b06ddda 100644 (file)
@@ -238,7 +238,7 @@ class Resolver : public base::ReferenceCounted, private base::NonCopyable {
     void undo(void);
 
     // only for testsuite
-    void reset (void);
+    void reset (const bool resetValidResults = false);
 
     Arch architecture() const { return _architecture; }
     void setArchitecture( const Arch & arch) { _architecture = arch; }
index 38c256c..deb0957 100644 (file)
@@ -217,7 +217,8 @@ bool Testcase::createTestcase(Resolver & resolver)
     
     zypp::base::LogControl::instance().logfile( dumpPath +"/y2log" );
     zypp::base::LogControl::TmpExcessive excessive;
-    
+
+    resolver.reset(true); // true = resetting all valid solverresults
     resolver.resolvePool();
 
     zypp::base::LogControl::instance().logfile( "/var/log/YaST2/y2log" );