Imported Upstream version 16.3.2
[platform/upstream/libzypp.git] / tests / lib / TestSetup.h
index 53fcb04..4893c08 100644 (file)
@@ -48,8 +48,7 @@ inline std::string getXmlNodeVal( const std::string & line_r, const std::string
 
 enum TestSetupOptionBits
 {
-  TSO_CLEANROOT                = (1 <<  0),    // wipe rootdir in ctor
-  TSO_REPO_DEFAULT_GPG = (1 <<  1),    // dont turn off gpgcheck in repos
+  TSO_CLEANROOT = (1 <<  0)
 };
 ZYPP_DECLARE_FLAGS_AND_OPERATORS( TestSetupOptions, TestSetupOptionBits );
 
@@ -82,8 +81,8 @@ class TestSetup
     typedef TestSetupOptions Options;
 
   public:
-    TestSetup( const Arch & sysarch_r = Arch_empty, const Options & options_r = Options() )
-    { _ctor( Pathname(), sysarch_r, options_r ); }
+    TestSetup( const Arch & sysarch_r = Arch_empty )
+    { _ctor( Pathname(), sysarch_r, Options() ); }
 
     TestSetup( const Pathname & rootdir_r, const Arch & sysarch_r = Arch_empty, const Options & options_r = Options() )
     { _ctor( rootdir_r, sysarch_r, options_r ); }
@@ -148,8 +147,7 @@ class TestSetup
       RepoInfo nrepo;
       nrepo.setAlias( alias_r.empty() ? url_r.getHost()+":"+Pathname::basename(url_r.getPathName()) : alias_r );
       nrepo.addBaseUrl( url_r );
-      if ( ! _options.testFlag( TSO_REPO_DEFAULT_GPG ) )
-       nrepo.setGpgCheck( false );
+      nrepo.setGpgCheck( false );
       loadRepo( nrepo );
     }
     /** Directly load repo from metadata(dir) or solvfile(file) to pool.
@@ -254,7 +252,7 @@ class TestSetup
       }
 
       //
-      filesystem::Glob files( path_r/"*{.xml,.xml.gz}", filesystem::Glob::_BRACE );
+      filesystem::Glob files( path_r/"*{.xml,.xml.gz}", filesystem::Glob::kBrace );
       for_( it, files.begin(), files.end() )
       {
         std::string basename( Pathname::basename( *it ) );
@@ -392,14 +390,12 @@ class TestSetup
   private:
     void _ctor( const Pathname & rootdir_r, const Arch & sysarch_r, const Options & options_r )
     {
-      _options = options_r;
-
       if ( rootdir_r.empty() )
         _rootdir = _tmprootdir.path();
       else
       {
         filesystem::assert_dir( (_rootdir = rootdir_r) );
-        if ( _options.testFlag( TSO_CLEANROOT ) )
+        if ( options_r.testFlag( TSO_CLEANROOT ) )
           filesystem::clean_dir( _rootdir );
       }
 
@@ -410,7 +406,6 @@ class TestSetup
   private:
     filesystem::TmpDir _tmprootdir;
     Pathname           _rootdir;
-    Options            _options;
 };