2 #include <zypp/parser/ProductFileReader.h>
4 //static TestSetup test( Arch_x86_64 );
6 // Must be the first test!
7 BOOST_AUTO_TEST_CASE(basic)
9 parser::ProductFileData data;
10 BOOST_CHECK( data.empty() );
12 data = parser::ProductFileReader::scanFile( TESTS_SRC_DIR "/parser/ProductFileReader_test.dat" );
13 BOOST_REQUIRE( ! data.empty() );
15 BOOST_CHECK_EQUAL( data.vendor(), "Novell" );
16 BOOST_CHECK_EQUAL( data.name(), "SUSE_SLES" );
17 BOOST_CHECK_EQUAL( data.edition(), "11-0" );
18 BOOST_CHECK_EQUAL( data.arch(), Arch_i586 );
19 BOOST_CHECK_EQUAL( data.productline(), "" );
20 BOOST_CHECK_EQUAL( data.registerTarget(), "sle-11-i586" );
21 BOOST_CHECK_EQUAL( data.registerRelease(), "whatever" );
22 BOOST_CHECK_EQUAL( data.updaterepokey(), "A43242DKD" );
24 BOOST_REQUIRE_EQUAL( data.upgrades().size(), 2 );
26 BOOST_CHECK_EQUAL( data.upgrades()[0].name(), "openSUSE_11.1" );
27 BOOST_CHECK_EQUAL( data.upgrades()[0].summary(), "openSUSE 11.1" );
28 BOOST_CHECK_EQUAL( data.upgrades()[0].repository(), "http://download.opensuse.org/distribution/openSUSE/11.1" );
29 BOOST_CHECK_EQUAL( data.upgrades()[0].notify(), true );
30 BOOST_CHECK_EQUAL( data.upgrades()[0].status(), "stable" );
32 BOOST_CHECK_EQUAL( data.upgrades()[1].name(), "openSUSE_Factory" );
33 BOOST_CHECK_EQUAL( data.upgrades()[1].summary(), "openSUSE Factory" );
34 BOOST_CHECK_EQUAL( data.upgrades()[1].repository(), "http://download.opensuse.org/distribution/openSUSE/Factory" );
35 BOOST_CHECK_EQUAL( data.upgrades()[1].notify(), false );
36 BOOST_CHECK_EQUAL( data.upgrades()[1].status(), "unstable" );