#include "Tools.h"
+#include <zypp/ResObjects.h>
/******************************************************************
**
INT << "===[START]==========================================" << endl;
// https://bugzilla.novell.com/show_bug.cgi?id=442200
-
Pathname mroot( "/tmp/ToolScanRepos" );
TestSetup test( mroot, Arch_x86_64 );
test.loadRepos();
+ ResPool pool( test.pool() );
+ for_( it, pool.byKindBegin<Patch>(), pool.byKindEnd<Patch>() )
+ {
+ Patch::constPtr p( (*it)->asKind<Patch>() );
+ MIL << p << endl;
+ Patch::Contents contents( p->contents() );
+ DBG << contents << endl;
+ }
+
INT << "===[END]============================================" << endl << endl;
return 0;
** FUNCTION TYPE : int
*/
int main( int argc, char * argv[] )
-{
+try {
INT << "===[START]==========================================" << endl;
std::string appname( Pathname::basename( argv[0] ) );
--argc;
INT << "===[END]============================================" << endl << endl;
return 0;
}
-
+catch ( const Exception & exp )
+{
+ INT;
+ cerr << exp << endl << exp.historyAsString();
+ throw;
+}
+catch (...)
+{}
#define LABELED(V) #V << ":\t" << V
-static TestSetup test( Arch_x86_64 );
+static TestSetup test( "/tmp/x", Arch_x86_64 );
// Must be the first test!
BOOST_AUTO_TEST_CASE(bnc_435838)
BOOST_AUTO_TEST_CASE(LookupAttr_)
{
-// base::LogControl::TmpLineWriter shutUp( new log::FileLineWriter( "/tmp/YLOG" ) );
-// sat::LookupAttr q( sat::SolvAttr::name );
-// MIL << "HI" << endl;
-}
\ No newline at end of file
+ base::LogControl::TmpLineWriter shutUp( new log::FileLineWriter( "/tmp/YLOG" ) );
+ MIL << "GO" << endl;
+
+ sat::Pool satpool( test.satpool() );
+ for_( it, satpool.reposBegin(), satpool.reposEnd() )
+ {
+ SEC << endl;
+ sat::LookupAttr q( sat::SolvAttr::name, *it );
+ BOOST_CHECK_EQUAL( q.size(), it->solvablesSize() );
+ MIL << q << ' ' << q.size() << " in " << *it << endl;
+ DBG << q << endl;
+ }
+ return;
+ sat::LookupAttr q( sat::SolvAttr::name );
+ BOOST_CHECK_EQUAL( q.size(), satpool.solvablesSize() );
+ MIL << q << ' ' << q.size() << " in ALL" << endl;
+}
using std::endl;
+#if 0
+#undef XXX
+#define XXX MIL
+#warning Remove dummy debug output defines
+#endif
+
///////////////////////////////////////////////////////////////////
namespace zypp
{ /////////////////////////////////////////////////////////////////
bool chain = false;
if ( _solv )
- ::dataiterator_init( dip.get(), sat::Pool::instance().get(), _solv.repository().id(), _solv.id(), _attr.id(), 0, 0 );
+ {
+ ::dataiterator_init( dip.get(), sat::Pool::instance().get(), _solv.repository().id(), _solv.id(), _attr.id(), 0, 0 );
+ XXX << "Solv " << _solv << endl;
+ }
else if ( _repo )
- ::dataiterator_init( dip.get(), sat::Pool::instance().get(), _repo.id(), 0, _attr.id(), 0, 0 );
+ {
+ ::dataiterator_init( dip.get(), sat::Pool::instance().get(), _repo.id(), 0, _attr.id(), 0, 0 );
+ XXX << "Repo " << _repo << endl;
+ }
else if ( ! sat::Pool::instance().reposEmpty() )
{
::dataiterator_init( dip.get(), sat::Pool::instance().get(), sat::Pool::instance().reposBegin()->id(), 0, _attr.id(), 0, 0 );
chain = true;
+ XXX << "ALL " << endl;
}
else
return iterator();
// CLASS NAME : LookupAttr::iterator
//
///////////////////////////////////////////////////////////////////
+ std::ostream & operator<<( std::ostream & str, const ::_Dataiterator * obj )
+ {
+
+ str << "::_Dataiterator(";
+ if ( ! obj )
+ {
+ str << "NULL";
+ }
+ else
+ {
+ str << '|' << obj->pool;
+ str << '|' << Repository(obj->repo);
+ str << '|' << obj->key;
+ str << '|' << obj->keyname;
+ str << '|' << obj->repodataid;
+ str << '|' << obj->solvid;
+ str << '|' << obj->repoid;
+ }
+ return str << ")";
+ }
+
+ std::ostream & operator<<( std::ostream & str, const scoped_ptr< ::_Dataiterator> & obj )
+ {
+ return str << obj.get();
+ }
+
///////////////////////////////////////////////////////////////////
// position and moving
, _chainRepos( chain_r )
{
_dip.swap( dip_r ); // take ownership!
+ XXX << _dip << endl;
increment();
+ XXX << *this << endl;
}
///////////////////////////////////////////////////////////////////
*/
iterator( scoped_ptr< ::_Dataiterator> & dip_r, bool chain_r );
- ::_Dataiterator * cloneFrom( const ::_Dataiterator * rhs );
-
private:
friend class boost::iterator_core_access;
+ ::_Dataiterator * cloneFrom( const ::_Dataiterator * rhs );
+
template <class OtherDerived, class OtherIterator, class V, class C, class R, class D>
bool equal( const boost::iterator_adaptor<OtherDerived, OtherIterator, V, C, R, D> & rhs ) const
{