Author: mlandres
Date: Wed Oct 22 15:57:16 2008
New Revision: 11452
URL: http://svn.opensuse.org/viewcvs/zypp?rev=11452&view=rev
Log:
added
Added:
trunk/libzypp/tests/sat/LookupAttr_test.cc
Added: trunk/libzypp/tests/sat/LookupAttr_test.cc
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/libzypp/tests/sat/LookupAttr_test.cc?rev=11452&view=auto
==============================================================================
--- trunk/libzypp/tests/sat/LookupAttr_test.cc (added)
+++ trunk/libzypp/tests/sat/LookupAttr_test.cc Wed Oct 22 15:57:16 2008
@@ -0,0 +1,60 @@
+#include "TestSetup.h"
+#include
+
+#define LABELED(V) #V << ":\t" << V
+
+static TestSetup test( Arch_x86_64 );
+
+// Must be the first test!
+BOOST_AUTO_TEST_CASE(bnc_435838)
+{
+ // On the fly check that findSystemRepo does not
+ // cause loading the SystemRepo. check 2 times.
+ BOOST_REQUIRE( ! test.satpool().findSystemRepo() );
+ BOOST_REQUIRE( ! test.satpool().findSystemRepo() );
+
+ // empty @system to pool
+ test.satpool().systemRepo();
+ BOOST_REQUIRE( test.satpool().findSystemRepo() );
+
+ // bnc_435838 crashes if iterating a just created repo.
+ sat::LookupAttr q( sat::SolvAttr::name );
+ for_( it, q.begin(),q.end() )
+ ;
+}
+
+BOOST_AUTO_TEST_CASE(LookupAttr_init)
+{
+ test.loadTarget(); // initialize and load target
+ test.loadRepo( TESTS_SRC_DIR"/data/openSUSE-11.1" );
+ test.loadRepo( TESTS_SRC_DIR "/data/OBS:VirtualBox-11.1", "vbox" );
+}
+
+BOOST_AUTO_TEST_CASE(LookupAttr_defaultconstructed)
+{
+ sat::LookupAttr q;
+ BOOST_CHECK( q.empty() );
+ BOOST_CHECK( q.size() == 0 );
+ BOOST_CHECK_EQUAL( q.begin(), q.end() );
+}
+
+BOOST_AUTO_TEST_CASE(LookupAttr_nonexistingattr)
+{
+ sat::LookupAttr q( sat::SolvAttr("nonexistingattr") );
+ BOOST_CHECK( q.empty() );
+ BOOST_CHECK( q.size() == 0 );
+ BOOST_CHECK_EQUAL( q.begin(),q.end() );
+ for_( it, q.begin(), q.end() )
+ ;
+}
+
+BOOST_AUTO_TEST_CASE(LookupAttr_existingattr)
+{
+ sat::LookupAttr q( sat::SolvAttr::name );
+ BOOST_CHECK( ! q.empty() );
+ BOOST_CHECK( q.size() != 0 );
+ BOOST_CHECK( q.begin() != q.end() );
+ for_( it, q.begin(), q.end() )
+ ;
+}
+
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org