[Aptitude-devel] r3201 - in branches/aptitude-0.3/aptitude: . src/generic/problemresolver

Daniel Burrows dburrows@costa.debian.org
Sat, 30 Apr 2005 18:31:55 +0000


Author: dburrows
Date: Sat Apr 30 18:31:47 2005
New Revision: 3201

Modified:
   branches/aptitude-0.3/aptitude/ChangeLog
   branches/aptitude-0.3/aptitude/src/generic/problemresolver/test.cc
   branches/aptitude-0.3/aptitude/src/generic/problemresolver/test1.txt
Log:
Fix the problem resolver test code.

Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog	(original)
+++ branches/aptitude-0.3/aptitude/ChangeLog	Sat Apr 30 18:31:47 2005
@@ -1,5 +1,9 @@
 2005-04-30  Daniel Burrows  <dburrows@debian.org>
 
+	* src/generic/problemresolver/test.cc, src/generic/problemresolver/test1.txt:
+
+	  Fix the test code to work with the new problem resolver.
+
 	* src/generic/aptitude_resolver.h:
 
 	  Adjust the get_name() routine of versions to mangle versions

Modified: branches/aptitude-0.3/aptitude/src/generic/problemresolver/test.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/src/generic/problemresolver/test.cc	(original)
+++ branches/aptitude-0.3/aptitude/src/generic/problemresolver/test.cc	Sat Apr 30 18:31:47 2005
@@ -457,6 +457,20 @@
       return wrap_ptr_iter<dummy_version, version>(real_dep->solvers_begin(),
 						   real_dep->solvers_end());
     }
+
+    template<class Sol>
+    bool broken_under(const Sol& s) const
+    {
+      if(!s.ver_installed(get_source()))
+	return false;
+
+      for(dummy_dep::solver_iterator i=real_dep->solvers_begin();
+	  i!=real_dep->solvers_end(); ++i)
+	if(s.ver_installed(get_source()))
+	  return false;
+
+      return true;
+    }
   };
 
 
@@ -1021,21 +1035,26 @@
 
 	      int step_score;
 	      int broken_score;
+	      int infinity;
+	      int max_successors;
+	      int goal_score;
 
-	      f >> step_score >> broken_score;
+	      f >> step_score >> broken_score >> infinity >> max_successors >> goal_score;
 
 	      if(f.eof())
 		throw ParseError("Expected '{' following broken_score, got EOF");
 
 	      if(!f)
-		throw ParseError("Error reading step_score and broken_score after 'TEST'");
+		throw ParseError("Error reading step_score, broken_score, infinity, max_succ, and goal_score after 'TEST'");
 
 	      f >> s >> ws;
 
 	      if(s != "{")
 		throw ParseError("Expected '{' following TEST, got "+s);
 
-	      dummy_resolver resolver(step_score, broken_score, *universe);
+	      dummy_resolver resolver(step_score, broken_score,
+				      infinity, max_successors,
+				      goal_score, *universe);
 
 	      read_scores(f, universe, resolver);
 

Modified: branches/aptitude-0.3/aptitude/src/generic/problemresolver/test1.txt
==============================================================================
--- branches/aptitude-0.3/aptitude/src/generic/problemresolver/test1.txt	(original)
+++ branches/aptitude-0.3/aptitude/src/generic/problemresolver/test1.txt	Sat Apr 30 18:31:47 2005
@@ -20,6 +20,6 @@
   DEP p3 v3 -> < p4 v1  p4 v2  p4 v3 >
 ]
 
-TEST 10 10 { } EXPECT ( 10000 ANY
-                        10000 ANY
-                        10000 ANY )
\ No newline at end of file
+TEST 10 10 10000 10 50 { } EXPECT ( 10000 ANY
+			            10000 ANY
+                                    10000 ANY )
\ No newline at end of file