2 #include <zypp/sat/LookupAttr.h>
4 #define LABELED(V) #V << ":\t" << V
6 static TestSetup test( Arch_x86_64 );
8 // Must be the first test!
9 BOOST_AUTO_TEST_CASE(bnc_435838)
11 // On the fly check that findSystemRepo does not
12 // cause loading the SystemRepo. check 2 times.
13 BOOST_REQUIRE( ! test.satpool().findSystemRepo() );
14 BOOST_REQUIRE( ! test.satpool().findSystemRepo() );
16 // empty @system to pool
17 test.satpool().systemRepo();
18 BOOST_REQUIRE( test.satpool().findSystemRepo() );
20 // bnc_435838 crashes if iterating a just created repo.
21 sat::LookupAttr q( sat::SolvAttr::name );
22 for_( it, q.begin(),q.end() )
26 BOOST_AUTO_TEST_CASE(LookupAttr_init)
28 test.loadTarget(); // initialize and load target
29 test.loadRepo( TESTS_SRC_DIR "/data/openSUSE-11.1" );
30 test.loadRepo( TESTS_SRC_DIR "/data/OBS:VirtualBox-11.1" );
31 test.loadRepo( TESTS_SRC_DIR "/data/11.0-update" );
34 BOOST_AUTO_TEST_CASE(LookupAttr_defaultconstructed)
37 BOOST_CHECK( q.empty() );
38 BOOST_CHECK( q.size() == 0 );
39 BOOST_CHECK_EQUAL( q.begin(), q.end() );
42 BOOST_AUTO_TEST_CASE(LookupAttr_nonexistingattr)
44 sat::LookupAttr q( sat::SolvAttr("nonexistingattr") );
45 BOOST_CHECK( q.empty() );
46 BOOST_CHECK( q.size() == 0 );
47 BOOST_CHECK_EQUAL( q.begin(), q.end() );
50 BOOST_AUTO_TEST_CASE(LookupAttr_existingattr)
52 sat::LookupAttr q( sat::SolvAttr::name );
53 BOOST_CHECK( ! q.empty() );
54 BOOST_CHECK( q.size() != 0 );
55 BOOST_CHECK_NE( q.begin(), q.end() );
58 BOOST_AUTO_TEST_CASE(LookupAttr_)
60 // base::LogControl::TmpLineWriter shutUp( new log::FileLineWriter( "/tmp/YLOG" ) );
61 // sat::LookupAttr q( sat::SolvAttr::name );
62 // MIL << "HI" << endl;