Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Fetching contributors…

Cannot retrieve contributors at this time

44 lines (34 sloc) 1.434 kB
#include <iostream>
#include <list>
#include <string>
// Boost.Test
#include <boost/test/auto_unit_test.hpp>
#include "zypp/base/LogControl.h"
#include "zypp/base/Logger.h"
#include "zypp/base/Exception.h"
#include "zypp/ZYpp.h"
#include "zypp/VendorAttr.h"
using boost::unit_test::test_case;
using namespace std;
using namespace zypp;
namespace zypp
void reconfigureZConfig( const Pathname & );
#define DATADIR (Pathname(TESTS_SRC_DIR) + "/zypp/data/Vendor")
reconfigureZConfig( DATADIR / "zypp1.conf" );
// No vendor definition files has been read. So only suse,opensuse vendors are
// equivalent
BOOST_REQUIRE( VendorAttr::instance().equivalent("suse", "suse") );
BOOST_REQUIRE( VendorAttr::instance().equivalent("equal", "equal") );
BOOST_REQUIRE( VendorAttr::instance().equivalent("suse", "SuSE") );
BOOST_REQUIRE( VendorAttr::instance().equivalent("opensuse", "SuSE") );
BOOST_REQUIRE( !VendorAttr::instance().equivalent("open", "SuSE") );
BOOST_REQUIRE( !VendorAttr::instance().equivalent("nothing", "SuSE") );
// but "opensuse build service" gets its own class:
BOOST_REQUIRE( !VendorAttr::instance().equivalent("opensuse build service", "suse") );
BOOST_REQUIRE( !VendorAttr::instance().equivalent("opensuse build service", "opensuse") );
BOOST_REQUIRE( VendorAttr::instance().equivalent("opensuse build service", "opensuse build service 2") );
Jump to Line
Something went wrong with that request. Please try again.