From a3e9d658d534357a91237d29e30d10fec2cb5196 Mon Sep 17 00:00:00 2001 From: Michael Andres Date: Wed, 7 Jul 2010 14:39:54 +0200 Subject: [PATCH] improve testcase --- tests/zypp/PoolQuery_test.cc | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/tests/zypp/PoolQuery_test.cc b/tests/zypp/PoolQuery_test.cc index 9a90d20..7d77851 100644 --- a/tests/zypp/PoolQuery_test.cc +++ b/tests/zypp/PoolQuery_test.cc @@ -750,24 +750,34 @@ BOOST_AUTO_TEST_CASE(addDependency) PoolQuery q; q.setCaseSensitive( false ); q.setMatchSubstring(); - q.addString( "libzypp" ); - q.addDependency( sat::SolvAttr::provides, "FOO", Rel::GT, Edition("5.0") ); + q.addDependency( sat::SolvAttr::provides, "libzypp", Rel::GT, Edition("5.0") ); q.addAttribute( sat::SolvAttr::arch, Arch_i586.asString() ); // OR with arch i585 std::for_each(q.begin(), q.end(), PrintAndCount()); //dumpQ( std::cout, q ); - BOOST_CHECK_EQUAL( q.size(), 68 ); + BOOST_CHECK_EQUAL( q.size(), 66 ); } { cout << "****addDependency2b****" << endl; PoolQuery q; q.setCaseSensitive( false ); q.setMatchSubstring(); - q.addString( "libzypp" ); - q.addDependency( sat::SolvAttr::provides, "FOO", Rel::GT, Edition("5.0"), Arch_i586 ); // AND with arch i585 + // libzypp provides yast2-packagemanager... + q.addDependency( sat::SolvAttr::provides, "yast2-packagemanager", Rel::GT, Edition("5.0"), Arch_i586 ); // AND with arch i585 std::for_each(q.begin(), q.end(), PrintAndCount()); //dumpQ( std::cout, q ); BOOST_CHECK_EQUAL( q.size(), 2 ); } + { + cout << "****addDependency2c****" << endl; + PoolQuery q; + q.setCaseSensitive( false ); + q.setMatchSubstring(); + // but no package named yast2-packagemanager + q.addDependency( sat::SolvAttr::name, "yast2-packagemanager", Rel::GT, Edition("5.0"), Arch_i586 ); // AND with arch i585 + std::for_each(q.begin(), q.end(), PrintAndCount()); + //dumpQ( std::cout, q ); + BOOST_CHECK_EQUAL( q.size(), 0 ); + } { cout << "****addDependency3****" << endl; -- 2.7.4