[Aptitude-svn-commit] r3964 - in branches/aptitude-0.3/aptitude: . tests

Daniel Burrows dburrows at costa.debian.org
Fri Aug 26 01:20:05 UTC 2005


Author: dburrows
Date: Fri Aug 26 01:20:02 2005
New Revision: 3964

Modified:
   branches/aptitude-0.3/aptitude/ChangeLog
   branches/aptitude-0.3/aptitude/tests/test_apt_universe.cc
Log:
Provide more specific information about why the connectivity test fails.

Modified: branches/aptitude-0.3/aptitude/ChangeLog
==============================================================================
--- branches/aptitude-0.3/aptitude/ChangeLog	(original)
+++ branches/aptitude-0.3/aptitude/ChangeLog	Fri Aug 26 01:20:02 2005
@@ -1,5 +1,10 @@
 2005-08-25  Daniel Burrows  <dburrows at debian.org>
 
+	* tests/test_apt_universe.cc:
+
+	  Provide more specific information in failure messages for the
+	  connectivity test.
+
 	* src/generic/aptitude_resolver_universe.cc:
 
 	  Finally (I hope) fix the case of conflicts-through-provides in

Modified: branches/aptitude-0.3/aptitude/tests/test_apt_universe.cc
==============================================================================
--- branches/aptitude-0.3/aptitude/tests/test_apt_universe.cc	(original)
+++ branches/aptitude-0.3/aptitude/tests/test_apt_universe.cc	Fri Aug 26 01:20:02 2005
@@ -235,6 +235,22 @@
 	}
   }
 
+  void dump_revdeps(std::ostream &out, const aptitude_universe::version v)
+  {
+    out << "Reverse dependencies of "
+	<< v.get_package().get_name() << " "
+	<< v.get_name() << " are:" << std::endl;
+
+    for(aptitude_universe::version::revdep_iterator rdi
+	  = v.revdeps_begin(); !rdi.end(); ++rdi)
+      {
+	out << *rdi
+	    << "(" << (pkgCache::Dependency *) (*rdi).get_dep()
+	    << ":" << (pkgCache::Provides *) (*rdi).get_prv() << ")"
+	    << std::endl;
+      }
+  }
+
   void testReverseConnectivity()
   {
     CPPUNIT_ASSERT(apt_cache_file != NULL);
@@ -293,11 +309,17 @@
 		    {
 		      std::ostringstream out;
 		      out << "The dependency " << *di
-			  << " does not occur in the revdep list of either "
+			  << "(" << (pkgCache::Dependency *) (*di).get_dep()
+			  << ":" << (pkgCache::Provides *) (*di).get_prv()
+			  << ") does not occur in the revdep list of either "
 			  << (*si).get_package().get_name() << " "
 			  << (*si).get_name() << " or "
 			  << (*vi).get_package().get_name() << " "
-			  << (*vi).get_name();
+			  << (*vi).get_name() << std::endl;
+
+		      dump_revdeps(out, *si);
+		      dump_revdeps(out, *vi);
+
 		      CPPUNIT_FAIL(out.str());
 		    }
 		}



More information about the Aptitude-svn-commit mailing list