Author: matz Date: Wed Apr 9 12:14:19 2008 New Revision: 9479 URL: http://svn.opensuse.org/viewcvs/zypp?rev=9479&view=rev Log: Some changes I had still in queue. Using a different test word, that happens to exist sometimes only in names, or summaries or descriptions. And not accessing the kv.id member (only debug output, but hey). Modified: trunk/libzypp/tests/zypp/PoolQuery_test.cc trunk/libzypp/zypp/PoolQuery.cc Modified: trunk/libzypp/tests/zypp/PoolQuery_test.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/tests/zypp/PoolQuery_test.cc?rev=9479&r1=9478&r2=9479&view=diff ============================================================================== --- trunk/libzypp/tests/zypp/PoolQuery_test.cc (original) +++ trunk/libzypp/tests/zypp/PoolQuery_test.cc Wed Apr 9 12:14:19 2008 @@ -201,13 +201,18 @@ { cout << "****100****" << endl; PoolQuery q; - q.addString("mp3"); + /* This string is found sometimes only in solvable names (e.g. novell-lum), + sometimes only in summary (e.g. yast2-casa-ats) and sometimes only + in descriptions (e.g. beagle-quickfinder). novell-lum doesn't exist + in our test solv file, but let's ignore this. I didn't find a string + with the same characteristics giving fewer matches :-/ */ + q.addString("novell"); q.addAttribute(sat::SolvAttr::name); q.addAttribute(sat::SolvAttr::summary); q.addAttribute(sat::SolvAttr::description); std::for_each(q.begin(), q.end(), &result_cb); - BOOST_CHECK(q.size() == 73); + BOOST_CHECK(q.size() == 74); cout << endl; Modified: trunk/libzypp/zypp/PoolQuery.cc URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/zypp/PoolQuery.cc?rev=9479&r1=9478&r2=9479&view=diff ============================================================================== --- trunk/libzypp/zypp/PoolQuery.cc (original) +++ trunk/libzypp/zypp/PoolQuery.cc Wed Apr 9 12:14:19 2008 @@ -601,14 +601,14 @@ { const string & sstr = _pqimpl->_rcstrings.empty() ? ai->second : _pqimpl->_rcstrings; - const IdString & value = - IdString(_rdit->kv.id); //! \todo pass compiled regex if SEARCH_REGEX - matches = dataiterator_match(_rdit, _pqimpl->_flags, sstr.c_str()); + matches = ::dataiterator_match(_rdit, _pqimpl->_flags, sstr.c_str()); if (matches) - INT << "value: " << value.asString() << endl + /* After calling dataiterator_match (with any string matcher set) + the kv.str member will be filled with something sensible. */ + INT << "value: " << _rdit->kv.str << endl << " mstr: " << sstr << endl; } } -- To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org For additional commands, e-mail: zypp-commit+help@opensuse.org