Author: mlandres Date: Thu Oct 9 13:54:22 2008 New Revision: 11276 URL: http://svn.opensuse.org/viewcvs/zypp?rev=11276&view=rev Log: WhatProvides testcase extended and iterator fixed Modified: trunk/libzypp/devel/devel.ma/NewPool.cc trunk/libzypp/package/libzypp.changes trunk/libzypp/tests/sat/WhatProvides_test.cc trunk/libzypp/zypp/sat/WhatProvides.cc trunk/libzypp/zypp/sat/WhatProvides.h Modified: trunk/libzypp/devel/devel.ma/NewPool.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/devel/devel.ma/NewPool.cc?rev=11276&r1=11275&r2=11276&view=diff ============================================================================== --- trunk/libzypp/devel/devel.ma/NewPool.cc (original) +++ trunk/libzypp/devel/devel.ma/NewPool.cc Thu Oct 9 13:54:22 2008 @@ -430,6 +430,16 @@ #undef OUTS } +void wsoft() +{ + ResPool pool( ResPool::instance() ); + for_( it, pool.begin(), pool.end() ) + { + if ( it->status().isSoftLocked() ) + INT << "SL: " << *it << endl; + } +} + /****************************************************************** ** ** FUNCTION NAME : main @@ -600,6 +610,21 @@ /////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////// + if ( 1 ) + { + PoolItem pi ( getPi<Pattern>("apparmor") ); + MIL << pi << endl; + if ( pi ) + { + Pattern::constPtr p( pi->asKind<Pattern>() ); + MIL << p << endl; + if ( p ) + { + p->contents(); + } + } + } + if ( 0 ) { CapabilitySet caps; @@ -678,11 +703,13 @@ } } +#if 0 getZYpp()->resolver()->addRequire( Capability("amarok") ); solve(); vdumpPoolStats( USR << "Transacting:"<< endl, make_filter_beginresfilter::ByTransact(pool), make_filter_endresfilter::ByTransact(pool) ) << endl; +#endif ////////////////////////////////////////////////////////////////// INT << "===[END]============================================" << endl << endl; Modified: trunk/libzypp/package/libzypp.changes URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/package/libzypp.changes?rev=11276&r1=11275&r2=11276&view=diff ============================================================================== --- trunk/libzypp/package/libzypp.changes (original) +++ trunk/libzypp/package/libzypp.changes Thu Oct 9 13:54:22 2008 @@ -1,9 +1,9 @@ ------------------------------------------------------------------- -Thu Oct 9 00:58:37 CEST 2008 - ma@suse.de +Thu Oct 9 13:52:03 CEST 2008 - ma@suse.de - Add required copy-ctor and assignment operator to WhatProvides. (bnc #433087) -- revision 11270 +- revision 11276 ------------------------------------------------------------------- Wed Oct 8 16:24:25 CEST 2008 - jkupec@suse.cz Modified: trunk/libzypp/tests/sat/WhatProvides_test.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/tests/sat/WhatProvides_test.cc?rev=11276&r1=11275&r2=11276&view=diff ============================================================================== --- trunk/libzypp/tests/sat/WhatProvides_test.cc (original) +++ trunk/libzypp/tests/sat/WhatProvides_test.cc Thu Oct 9 13:54:22 2008 @@ -1,5 +1,7 @@ #include "TestSetup.h" +#define LABELED(V) #V << ":\t" << V + BOOST_AUTO_TEST_CASE(WhatProvides) { TestSetup test( Arch_x86_64 ); @@ -22,4 +24,41 @@ BOOST_CHECK( q.empty() ); BOOST_CHECK( q.size() == 0 ); } + + { + // sat::WhatProvides::const_iterator requires proper + // copyctor and assignment. If they break + sat::WhatProvides q; + BOOST_CHECK( q.begin() == q.begin() ); + BOOST_CHECK( q.begin() == q.end() ); + + q = sat::WhatProvides( Capability("zypper.x86_64 == 0.12.5-1.1") ); + // q no longer empty + BOOST_CHECK( q.begin() == q.begin() ); + BOOST_CHECK( q.begin() != q.end() ); + + sat::WhatProvides::const_iterator a; + BOOST_CHECK( a == q.end() ); + + sat::WhatProvides::const_iterator b( q.begin() ); + BOOST_CHECK( b == q.begin() ); + +// SEC << LABELED(q.begin()) << endl; +// SEC << LABELED(q.end()) << endl; +// SEC << LABELED(a) << endl; +// SEC << LABELED(b) << endl; + + { + a = q.begin(); + BOOST_CHECK( a == q.begin() ); +// SEC << LABELED(a) << endl; +// SEC << LABELED(b) << endl; + + a = b; + BOOST_CHECK( a == b ); +// SEC << LABELED(a) << endl; +// SEC << LABELED(b) << endl; + } + BOOST_CHECK( a == q.begin() ); + } } Modified: trunk/libzypp/zypp/sat/WhatProvides.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/WhatProvides.cc?rev=11276&r1=11275&r2=11276&view=diff ============================================================================== --- trunk/libzypp/zypp/sat/WhatProvides.cc (original) +++ trunk/libzypp/zypp/sat/WhatProvides.cc Thu Oct 9 13:54:22 2008 @@ -164,6 +164,22 @@ return dumpRange( str << "(" << obj.size() << ")", obj.begin(), obj.end() ); } + /////////////////////////////////////////////////////////////////// + namespace detail + { ///////////////////////////////////////////////////////////////// + + std::ostream & operator<<( std::ostream & str, const WhatProvidesIterator & obj ) + { + str << str::form( "[%5u]", obj._offset ); + str << str::form( "<%p(%p)>", obj.base_reference(), &obj.base_reference() ); + str << str::form( "<%p(%p)>", obj._baseRef, (obj._baseRef ? *obj._baseRef : 0) ); + return str; + } + + ///////////////////////////////////////////////////////////////// + } //namespace detail + /////////////////////////////////////////////////////////////////// + ///////////////////////////////////////////////////////////////// } // namespace sat /////////////////////////////////////////////////////////////////// Modified: trunk/libzypp/zypp/sat/WhatProvides.h URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/sat/WhatProvides.h?rev=11276&r1=11275&r2=11276&view=diff ============================================================================== --- trunk/libzypp/zypp/sat/WhatProvides.h (original) +++ trunk/libzypp/zypp/sat/WhatProvides.h Thu Oct 9 13:54:22 2008 @@ -151,6 +151,7 @@ , const Solvable // Reference > { + friend std::ostream & operator<<( std::ostream & str, const WhatProvidesIterator & obj ); public: WhatProvidesIterator() : iterator_adaptor_( 0 ), _baseRef( 0 ), _offset( 0 ) @@ -173,7 +174,7 @@ /** Copy-ctor required to keep _baseRef adjusted. */ WhatProvidesIterator( const WhatProvidesIterator & rhs ) : iterator_adaptor_( rhs.base_reference() ) - , _baseRef( base_reference() ? &base_reference() : 0 ) + , _baseRef( base_reference() ? &base_reference() : rhs._baseRef ) , _offset( rhs._offset ) {} @@ -183,7 +184,7 @@ if ( this != &rhs ) // no self assign { base_reference() = rhs.base_reference(); - _baseRef = ( base_reference() ? &base_reference() : 0 ); + _baseRef = ( base_reference() ? &base_reference() : rhs._baseRef ); _offset = rhs._offset; } return *this; -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org