{
TestSetup test( Arch_x86_64 );
test.loadRepo( TESTS_SRC_DIR "/data/openSUSE-11.1", "opensuse" );
+ test.loadRepo( TESTS_SRC_DIR "/data/11.0-update", "update" );
}
// check that we actually found all testeable
// resolvables
BOOST_CHECK_EQUAL(c, 2);
+}
-
+BOOST_AUTO_TEST_CASE(asString)
+{
+ BOOST_CHECK_EQUAL( sat::Solvable(0).asString(), "noSolvable" );
+ BOOST_CHECK_EQUAL( sat::Solvable(1).asString(), "systemSolvable" );
+ BOOST_CHECK_EQUAL( sat::Solvable(2).asString(), "product:openSUSE-11.1.x86_64" );
+ BOOST_CHECK_EQUAL( sat::Solvable(3693).asString(), "autoyast2-2.16.19-0.1.src" );
+ BOOST_CHECK_EQUAL( sat::Solvable(19222).asString(), "noSolvable" );
+#if 0
+ Repository r = sat::Pool::instance().reposFind("update");
+ for_( it, r.solvablesBegin(), r.solvablesEnd() )
+ {
+ BOOST_CHECK_EQUAL( (*it).asString(), str::numstring((*it).id()) );
+ }
+#endif
}
+
: Capabilities();
}
+ std::string Solvable::asString() const
+ {
+ NO_SOLVABLE_RETURN( (_id == detail::systemSolvableId ? "systemSolvable" : "noSolvable") );
+ return str::form( "%s-%s.%s",
+ IdString( _solvable->name ).c_str(),
+ IdString( _solvable->evr ).c_str(),
+ IdString( _solvable->arch ).c_str() );
+ }
+
+
///////////////////////////////////////////////////////////////////
namespace
{ /////////////////////////////////////////////////////////////////
bool installOnly() const;
+ /** String representation <tt>"ident-edition.arch"</tt> or \c "noSolvable"
+ * \code
+ * product:openSUSE-11.1.x86_64
+ * autoyast2-2.16.19-0.1.src
+ * noSolvable
+ * \endcode
+ */
+ std::string asString() const;
+
public:
/** \name Access to the \ref Solvable dependencies.