#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
///////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////
+ 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;
}
}
+#if 0
getZYpp()->resolver()->addRequire( Capability("amarok") );
solve();
vdumpPoolStats( USR << "Transacting:"<< endl,
make_filter_begin<resfilter::ByTransact>(pool),
make_filter_end<resfilter::ByTransact>(pool) ) << endl;
+#endif
//////////////////////////////////////////////////////////////////
INT << "===[END]============================================" << endl << endl;
-------------------------------------------------------------------
-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
#include "TestSetup.h"
+#define LABELED(V) #V << ":\t" << V
+
BOOST_AUTO_TEST_CASE(WhatProvides)
{
TestSetup test( Arch_x86_64 );
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() );
+ }
}
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
///////////////////////////////////////////////////////////////////
, const Solvable // Reference
>
{
+ friend std::ostream & operator<<( std::ostream & str, const WhatProvidesIterator & obj );
public:
WhatProvidesIterator()
: iterator_adaptor_( 0 ), _baseRef( 0 ), _offset( 0 )
/** 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 )
{}
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;