splitted in two testcases
authorStefan Schubert <schubi@suse.de>
Wed, 5 Mar 2008 09:43:01 +0000 (09:43 +0000)
committerStefan Schubert <schubi@suse.de>
Wed, 5 Mar 2008 09:43:01 +0000 (09:43 +0000)
tests/zypp/CMakeLists.txt
tests/zypp/Vendor2_test.cc [new file with mode: 0644]
tests/zypp/Vendor_test.cc

index b726d03ddf366d46a25651bb77da3492f6a6cc02..7b5fcbb4ebd05bdf463ebb8ff903d373dbd01985 100644 (file)
@@ -1,5 +1,5 @@
 ADD_SUBDIRECTORY(base)
 
-ADD_TESTS(RWPtr Vendor TranslatedText PoolQuery KeyRing MediaSetAccess ResKind Arch Url Edition Capabilities CheckSum PublicKey PathInfo Digest Fetcher FileChecker RepoManager RepoInfo RepoStatus ProgressData )
+ADD_TESTS(RWPtr Vendor Vendor2 TranslatedText PoolQuery KeyRing MediaSetAccess ResKind Arch Url Edition Capabilities CheckSum PublicKey PathInfo Digest Fetcher FileChecker RepoManager RepoInfo RepoStatus ProgressData )
 
 EXEC_PROGRAM( ln ARGS -sf "${CMAKE_CURRENT_SOURCE_DIR}/data" "${CMAKE_CURRENT_BINARY_DIR}/data"  )
diff --git a/tests/zypp/Vendor2_test.cc b/tests/zypp/Vendor2_test.cc
new file mode 100644 (file)
index 0000000..98e979b
--- /dev/null
@@ -0,0 +1,44 @@
+
+#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")
+
+
+BOOST_AUTO_TEST_CASE(vendor2_test)
+{
+  reconfigureZConfig( DATADIR / "zypp2.conf" );
+
+  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") );
+  BOOST_REQUIRE( VendorAttr::instance().equivalent("nvidia", "SuSE") );
+  BOOST_REQUIRE( VendorAttr::instance().equivalent("nvidia_new_new", "SuSE") );
+  BOOST_REQUIRE( VendorAttr::instance().equivalent("nvidia", "opensuse") );
+  BOOST_REQUIRE( !VendorAttr::instance().equivalent("ati", "SuSE") );
+  BOOST_REQUIRE( !VendorAttr::instance().equivalent("ati", "nvidia") );
+  BOOST_REQUIRE( VendorAttr::instance().equivalent("ati_new", "ati") );
+}
+
index 1f328daf7cbb7da6809d3af531b022247cadf06d..34337d8465e0c3725e3dda0aa9d91e7a87207c81 100644 (file)
@@ -36,22 +36,3 @@ BOOST_AUTO_TEST_CASE(vendor_test1)
   BOOST_REQUIRE( !VendorAttr::instance().equivalent("nothing", "SuSE") );
 }
 
-BOOST_AUTO_TEST_CASE(vendor_test2)
-{
-  reconfigureZConfig( DATADIR / "zypp2.conf" );
-  // No vendor definition files has been readed. 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") );
-  BOOST_REQUIRE( VendorAttr::instance().equivalent("nvidia", "SuSE") );
-  BOOST_REQUIRE( VendorAttr::instance().equivalent("nvidia_new_new", "SuSE") );
-  BOOST_REQUIRE( !VendorAttr::instance().equivalent("nvidia", "opensuse") );
-  BOOST_REQUIRE( !VendorAttr::instance().equivalent("ati", "SuSE") );
-  BOOST_REQUIRE( !VendorAttr::instance().equivalent("ati", "nvidia") );
-  BOOST_REQUIRE( VendorAttr::instance().equivalent("ati_new", "ati") );
-}
-