splitted in two testcases
[platform/upstream/libzypp.git] / tests / zypp / Vendor_test.cc
1
2 #include <iostream>
3 #include <list>
4 #include <string>
5
6 // Boost.Test
7 #include <boost/test/auto_unit_test.hpp>
8
9 #include "zypp/base/LogControl.h"
10 #include "zypp/base/Logger.h"
11 #include "zypp/base/Exception.h"
12 #include "zypp/ZYpp.h"
13 #include "zypp/VendorAttr.h"
14
15 using boost::unit_test::test_case;
16 using namespace std;
17 using namespace zypp;
18
19 namespace zypp
20 {
21   void reconfigureZConfig( const Pathname & );
22 }
23
24 #define DATADIR (Pathname(TESTS_SRC_DIR) + "/zypp/data/Vendor")
25
26 BOOST_AUTO_TEST_CASE(vendor_test1)
27 {
28   reconfigureZConfig( DATADIR / "zypp1.conf" );
29   // No vendor definition files has been readed. So only suse,opensuse vendors are
30   // equivalent
31   BOOST_REQUIRE( VendorAttr::instance().equivalent("suse", "suse") );
32   BOOST_REQUIRE( VendorAttr::instance().equivalent("equal", "equal") );
33   BOOST_REQUIRE( VendorAttr::instance().equivalent("suse", "SuSE") );
34   BOOST_REQUIRE( VendorAttr::instance().equivalent("opensuse", "SuSE") );
35   BOOST_REQUIRE( !VendorAttr::instance().equivalent("open", "SuSE") );
36   BOOST_REQUIRE( !VendorAttr::instance().equivalent("nothing", "SuSE") );
37 }
38