remove obsolete testdrafts
authorMichael Andres <ma@suse.de>
Thu, 15 Oct 2009 15:36:27 +0000 (17:36 +0200)
committerMichael Andres <ma@suse.de>
Thu, 15 Oct 2009 15:39:08 +0000 (17:39 +0200)
devel/devel.ma/testdrafts/Arch.cc [deleted file]
devel/devel.ma/testdrafts/BitField.cc [deleted file]
devel/devel.ma/testdrafts/CapMatch.cc [deleted file]
devel/devel.ma/testdrafts/CompareBy.cc [deleted file]
devel/devel.ma/testdrafts/EditionRangeOvelap.cc [deleted file]
devel/devel.ma/testdrafts/GzStream.cc [deleted file]
devel/devel.ma/testdrafts/Locale.cc [deleted file]
devel/devel.ma/testdrafts/XmlExample.cc [deleted file]

diff --git a/devel/devel.ma/testdrafts/Arch.cc b/devel/devel.ma/testdrafts/Arch.cc
deleted file mode 100644 (file)
index 28d7ad9..0000000
+++ /dev/null
@@ -1,157 +0,0 @@
-#include <iostream>
-#include <list>
-#include <set>
-
-#include "Printing.h"
-
-#include <zypp/base/LogControl.h>
-#include <zypp/base/String.h>
-#include <zypp/base/Exception.h>
-#include <zypp/base/PtrTypes.h>
-#include <zypp/base/Iterator.h>
-#include <zypp/base/Algorithm.h>
-
-#include <zypp/Arch.h>
-#include <zypp/Bit.h>
-#include <zypp/RelCompare.h>
-
-using namespace std;
-using namespace zypp;
-using namespace zypp::functor;
-
-inline const char * compResult( int res )
-{
-  return( res ? ( res < 0 ? "<" : ">" ) : "=" );
-}
-
-template<class _Iter, class _Function>
-  inline void sym_compare( _Iter begin, _Iter end, _Function fnc )
-  {
-    for ( _Iter l = begin; l != end; ++l )
-      for ( _Iter r = begin; r != end; ++r )
-        fnc( *l, *r );
-  }
-
-template<class _LIter, class _RIter, class _BinaryFunction>
-  inline _BinaryFunction
-  nest_for_earch( _LIter lbegin, _LIter lend,
-                  _RIter rbegin, _RIter rend,
-                  _BinaryFunction fnc )
-  {
-    for ( ; lbegin != lend; ++lbegin )
-      for ( _RIter r = rbegin; r != rend; ++r )
-        fnc( *lbegin, *r );
-    return fnc;
-  }
-
-template<class _Iter, class _BinaryFunction>
-  inline _BinaryFunction
-  nest_for_earch( _Iter begin, _Iter end,
-                  _BinaryFunction fnc )
-  { return nest_for_earch( begin, end, begin, end, fnc ); }
-
-
-template<class _Iter, class _Function>
-  inline void sym_compare( _Iter begin, _Iter end )
-  {
-    sym_compare( begin, end, _Function() );
-  }
-
-inline list<Arch> archList()
-{
-  list<Arch> ret;
-  ret.push_back( Arch_noarch );
-  ret.push_back( Arch_src );
-  ret.push_back( Arch_x86_64 );
-  ret.push_back( Arch_athlon );
-  ret.push_back( Arch_i686 );
-  ret.push_back( Arch_i586 );
-  ret.push_back( Arch_i486 );
-  ret.push_back( Arch_i386 );
-  ret.push_back( Arch_s390x );
-  ret.push_back( Arch_s390 );
-  ret.push_back( Arch_ppc64 );
-  ret.push_back( Arch_ppc );
-  ret.push_back( Arch_ia64 );
-  ret.push_back( Arch( "unknown" ) );
-  ret.push_back( Arch( "unknown2" ) );
-  ret.push_back( Arch() );
-  ret.push_back( Arch("") );
-  return ret;
-}
-
-static list<Arch> archlist( archList() );
-static set<Arch>  archset( archlist.begin(), archlist.end() );
-
-struct CompatTest
-{
-  void operator()( const Arch & lhs, const Arch & rhs ) const
-  {
-
-    DBG << str::form( "%-10s --> %-10s : %6s : %s",
-                      lhs.asString().c_str(),
-                      rhs.asString().c_str(),
-                      ( lhs.compatibleWith( rhs ) ? "COMPAT" : "no" ),
-                      compResult( lhs.compare( rhs ) ) )
-
-        << std::endl;
-  }
-};
-
-struct OrderByCompare : public std::binary_function<Arch, Arch, bool>
-{
-  bool operator()( const Arch & lhs, const Arch & rhs ) const
-  { return lhs.compare( rhs ) < 0; }
-};
-
-
-void dumpOn( const Arch::CompatSet & s )
-{
-  SEC << str::join( make_transform_iterator( s.begin(), std::mem_fun_ref(&Arch::asString) ),
-                    make_transform_iterator( s.end(), std::mem_fun_ref(&Arch::asString) ) )
-  << endl;
-}
-
-/******************************************************************
-**
-**      FUNCTION NAME : main
-**      FUNCTION TYPE : int
-*/
-int main( int argc, char * argv[] )
-{
-  INT << "===[START]==========================================" << endl;
-
-  // All archs in test
-  print( archlist );
-
-  // set ordering
-  print( archset );
-
-  // compatibleWith
-  sym_compare( archset.begin(), archset.end(), CompatTest() );
-
-  // compare order
-  typedef set<Arch,OrderByCompare> OrderedArch;
-
-  OrderedArch a( archset.begin(), archset.end() );
-  print( a );
-  OrderedArch b( archset.rbegin(), archset.rend() );
-  print( b );
-
-  dumpOn( Arch::compatSet( Arch_noarch ) );
-  dumpOn( Arch::compatSet( Arch_i486 ) );
-  dumpOn( Arch::compatSet( Arch_x86_64 ) );
-  dumpOn( Arch::compatSet( Arch("Foo") ) );
-
-  typedef set<Arch,CompareByGT<Arch> > AS;
-  Arch::CompatSet x( Arch::compatSet(Arch_x86_64) );
-  AS rx( x.begin(), x.end() );
-  INT << str::join( make_transform_iterator( rx.begin(), std::mem_fun_ref(&Arch::asString) ),
-                    make_transform_iterator( rx.end(), std::mem_fun_ref(&Arch::asString) ) )
-  << endl;
-
-
-  INT << "===[END]============================================" << endl << endl;
-  return 0;
-}
-
diff --git a/devel/devel.ma/testdrafts/BitField.cc b/devel/devel.ma/testdrafts/BitField.cc
deleted file mode 100644 (file)
index 2fefddf..0000000
+++ /dev/null
@@ -1,204 +0,0 @@
-#include <ctime>
-
-#include <iostream>
-#include <list>
-#include <map>
-#include <set>
-
-#include "Measure.h"
-#include "Printing.h"
-
-#include <zypp/base/Logger.h>
-#include <zypp/base/LogControl.h>
-#include <zypp/base/String.h>
-#include <zypp/base/Exception.h>
-#include <zypp/base/PtrTypes.h>
-#include <zypp/base/Iterator.h>
-#include <zypp/base/Algorithm.h>
-#include <zypp/base/Functional.h>
-
-#include "zypp/NVRAD.h"
-#include "zypp/ResPool.h"
-#include "zypp/ResFilters.h"
-
-#include <zypp/SourceFactory.h>
-#include <zypp/source/susetags/SuseTagsImpl.h>
-
-#include "zypp/ResPoolManager.h"
-#include "zypp/ResPoolProxy.h"
-
-using namespace std;
-using namespace zypp;
-using namespace zypp::ui;
-using namespace zypp::functor;
-
-///////////////////////////////////////////////////////////////////
-
-///////////////////////////////////////////////////////////////////
-
-template<class _IntT>
-  struct Counter
-  {
-    Counter()
-    : _value( _IntT(0) )
-    {}
-
-    Counter( _IntT value_r )
-    : _value( _IntT( value_r ) )
-    {}
-
-
-    operator _IntT &()
-    { return _value; }
-
-    operator const _IntT &() const
-    { return _value; }
-
-    _IntT _value;
-  };
-
-struct Rstats : public std::unary_function<ResObject::constPtr, void>
-{
-  void operator()( ResObject::constPtr ptr )
-  {
-    ++_total;
-    ++_perKind[ptr->kind()];
-  }
-
-  typedef std::map<ResolvableTraits::KindType,Counter<unsigned> > KindMap;
-  Counter<unsigned> _total;
-  KindMap           _perKind;
-};
-
-std::ostream & operator<<( std::ostream & str, const Rstats & obj )
-{
-  str << "Total: " << obj._total;
-  for( Rstats::KindMap::const_iterator it = obj._perKind.begin(); it != obj._perKind.end(); ++it )
-    {
-      str << endl << "  " << it->first << ":\t" << it->second;
-    }
-  return str;
-}
-
-template<class _Iterator>
-  void rstats( _Iterator begin, _Iterator end )
-  {
-    DBG << __PRETTY_FUNCTION__ << endl;
-    Rstats stats;
-    for_each( begin, end, functorRef<void,ResObject::constPtr>(stats) );
-    MIL << stats << endl;
-  }
-
-///////////////////////////////////////////////////////////////////
-
-struct XByInstalled : public std::unary_function<ui::Selectable::constPtr,bool>
-{
-  bool operator()( const ui::Selectable::constPtr & obj ) const
-  {
-    return obj->hasInstalledObj();
-  }
-};
-
-template<class FT>
-  void fieldInfo()
-  {
-    MIL << bit::asString(FT::Mask::value)    << '|' << FT::begin << '-' << FT::end << '|' << FT::size << endl;
-    MIL << bit::asString(FT::Mask::inverted) << endl;
-  }
-
-
-void testr()
-{
-  fieldInfo<ResStatus::StateField>();
-  DBG << bit::asString((ResStatus::FieldType)ResStatus::UNINSTALLED) << endl;
-  DBG << bit::asString((ResStatus::FieldType)ResStatus::INSTALLED) << endl;
-  fieldInfo<ResStatus::EstablishField>();
-  DBG << bit::asString((ResStatus::FieldType)ResStatus::UNDETERMINED) << endl;
-  DBG << bit::asString((ResStatus::FieldType)ResStatus::UNNEEDED) << endl;
-  DBG << bit::asString((ResStatus::FieldType)ResStatus::SATISFIED) << endl;
-  DBG << bit::asString((ResStatus::FieldType)ResStatus::INCOMPLETE) << endl;
-  fieldInfo<ResStatus::TransactField>();
-  DBG << bit::asString((ResStatus::FieldType)ResStatus::KEEP_STATE) << endl;
-  DBG << bit::asString((ResStatus::FieldType)ResStatus::TRANSACT) << endl;
-  fieldInfo<ResStatus::TransactByField>();
-  DBG << bit::asString((ResStatus::FieldType)ResStatus::SOLVER) << endl;
-  DBG << bit::asString((ResStatus::FieldType)ResStatus::APPL_LOW) << endl;
-  DBG << bit::asString((ResStatus::FieldType)ResStatus::APPL_HIGH) << endl;
-  DBG << bit::asString((ResStatus::FieldType)ResStatus::USER) << endl;
-  fieldInfo<ResStatus::TransactDetailField>();
-  DBG << bit::asString((ResStatus::FieldType)ResStatus::EXPLICIT_INSTALL) << endl;
-  DBG << bit::asString((ResStatus::FieldType)ResStatus::SOFT_INSTALL) << endl;
-  DBG << endl;
-  DBG << bit::asString((ResStatus::FieldType)ResStatus::EXPLICIT_REMOVE) << endl;
-  DBG << bit::asString((ResStatus::FieldType)ResStatus::SOFT_REMOVE) << endl;
-  DBG << bit::asString((ResStatus::FieldType)ResStatus::DUE_TO_OBSOLETE) << endl;
-  DBG << bit::asString((ResStatus::FieldType)ResStatus::DUE_TO_UNLINK) << endl;
-  fieldInfo<ResStatus::SolverStateField>();
-  DBG << bit::asString((ResStatus::FieldType)ResStatus::NORMAL) << endl;
-  DBG << bit::asString((ResStatus::FieldType)ResStatus::SEEN) << endl;
-  DBG << bit::asString((ResStatus::FieldType)ResStatus::IMPOSSIBLE) << endl;
-}
-
-
-
-///////////////////////////////////////////////////////////////////
-
-/******************************************************************
-**
-**      FUNCTION NAME : main
-**      FUNCTION TYPE : int
-*/
-int main( int argc, char * argv[] )
-{
-  INT << "===[START]==========================================" << endl;
-
-  string infile( "p" );
-  if (argc >= 2 )
-    infile = argv[1];
-
-  MIL << ResStatus::toBeUninstalledDueToUnlink << endl;
-  MIL << ResStatus::toBeUninstalledDueToObsolete << endl;
-  testr();
-  return 0;
-
-  NVRAD a( "foo", Edition("1.1") );
-  NVRAD b( "foo", Edition("1.0") );
-  SEC << (a==b) << endl;
-  SEC << (a!=b) << endl;
-  SEC << (a<b) << endl;
-  set<NVRAD> s;
-  s.insert(a);
-  s.insert(b);
-  SEC << s.size() << endl;
-  return 0;
-
-  Url url("dir:/Local/ma/zypp/libzypp/devel/devel.ma/CD1");
-  Measure x( "SourceFactory.create" );
-  Source_Ref src( SourceFactory().createFrom( url ) );
-  x.stop();
-  Source_Ref trg( SourceFactory().createFrom( url ) );
-
-  //Source_Ref src( SourceFactory().createFrom( new source::susetags::SuseTagsImpl(infile) ) );
-  //MIL << src.resolvables().size() << endl;
-
-  ResPoolManager pool;
-  x.start( "pool.insert" );
-  pool.insert( src.resolvables().begin(), src.resolvables().end() );
-  x.stop();
-  MIL << pool << endl;
-
-  ResPool query( pool.accessor() );
-  rstats( query.begin(), query.end() );
-
-  ResPoolProxy y2pm( query );
-
-  pool.insert( trg.resolvables().begin(), trg.resolvables().end(), true );
-  y2pm = ResPoolProxy( query );
-
-
-
-
-  INT << "===[END]============================================" << endl << endl;
-  return 0;
-}
-
diff --git a/devel/devel.ma/testdrafts/CapMatch.cc b/devel/devel.ma/testdrafts/CapMatch.cc
deleted file mode 100644 (file)
index c9ffe6f..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-#include <iostream>
-#include <ctime>
-
-#include <zypp/base/Logger.h>
-#include <zypp/base/Exception.h>
-
-#include <zypp/CapMatch.h>
-
-using namespace std;
-using namespace zypp;
-
-// work around flaw in y2logview
-template<class _Tp>
-  void printOnHack( const _Tp & obj )
-  {
-    MIL << obj << endl;
-  };
-
-///////////////////////////////////////////////////////////////////
-// Just for the stats
-struct Measure
-{
-  time_t _begin;
-  Measure()
-  : _begin( time(NULL) )
-  {
-    USR << "START MEASURE..." << endl;
-  }
-  ~Measure()
-  {
-    USR << "DURATION: " << (time(NULL)-_begin) << " sec." << endl;
-  }
-};
-
-///////////////////////////////////////////////////////////////////
-// Print stream status
-ostream & operator<<( ostream & str, const istream & obj ) {
-  return str
-  << (obj.good() ? 'g' : '_')
-  << (obj.eof()  ? 'e' : '_')
-  << (obj.fail() ? 'F' : '_')
-  << (obj.bad()  ? 'B' : '_');
-}
-
-namespace zypp
-{
-
-
-
-}
-
-using namespace zypp;
-
-/******************************************************************
-**
-**      FUNCTION NAME : main
-**      FUNCTION TYPE : int
-*/
-int main( int argc, char * argv[] )
-{
-  INT << "===[START]==========================================" << endl;
-
-  CapMatch u( CapMatch::irrelevant );
-  CapMatch y(true);
-  CapMatch n(false);
-
-#define OUT(X) DBG << #X << " " << (X) << endl
-
-  OUT( u );
-  OUT( u == y );
-  OUT( u != y );
-
-  OUT( u == true );
-  OUT( u == false );
-  OUT( true == u );
-  OUT( false == u );
-
-  OUT( u && y );
-  OUT( u && n );
-  OUT( u && u );
-
-  OUT( y && y );
-  OUT( y && n );
-  OUT( y && u );
-
-  OUT( n && y );
-  OUT( n && n );
-  OUT( n && u );
-
-  OUT( u || y );
-  OUT( u || n );
-  OUT( u || u );
-
-  OUT( y || y );
-  OUT( y || n );
-  OUT( y || u );
-
-  OUT( n || y );
-  OUT( n || n );
-  OUT( n || u );
-
-  OUT( !u );
-  OUT( !y );
-  OUT( !n );
-
-  INT << "===[END]============================================" << endl;
-  return 0;
-}
diff --git a/devel/devel.ma/testdrafts/CompareBy.cc b/devel/devel.ma/testdrafts/CompareBy.cc
deleted file mode 100644 (file)
index 62b4c17..0000000
+++ /dev/null
@@ -1,146 +0,0 @@
-#include <ctime>
-
-#include <iostream>
-#include <list>
-#include <map>
-#include <set>
-
-#include <zypp/base/Logger.h>
-#include <zypp/base/String.h>
-#include <zypp/base/Exception.h>
-#include <zypp/base/PtrTypes.h>
-#include <zypp/base/Iterator.h>
-#include <zypp/base/Algorithm.h>
-#include <zypp/base/Functional.h>
-
-#include "zypp/ResPool.h"
-#include "zypp/ResFilters.h"
-
-#include <zypp/SourceFactory.h>
-#include <zypp/source/susetags/SuseTagsImpl.h>
-
-#include "zypp/ResPoolManager.h"
-
-using namespace std;
-using namespace zypp;
-using namespace zypp::functor;
-using namespace zypp::resfilter;
-
-namespace zypp
-{
-}
-
-///////////////////////////////////////////////////////////////////
-
-struct Print : public std::unary_function<ResObject::constPtr, bool>
-{
-  bool operator()( ResObject::constPtr ptr )
-  {
-    USR << *ptr << endl;
-    return true;
-  }
-};
-
-///////////////////////////////////////////////////////////////////
-
-template<class _IntT>
-  struct Counter
-  {
-    Counter()
-    : _value( _IntT(0) )
-    {}
-
-    Counter( _IntT value_r )
-    : _value( _IntT( value_r ) )
-    {}
-
-    operator _IntT &()
-    { return _value; }
-
-    operator const _IntT &() const
-    { return _value; }
-
-    _IntT _value;
-  };
-
-struct Rstats : public std::unary_function<ResObject::constPtr, void>
-{
-  void operator()( ResObject::constPtr ptr )
-  {
-    ++_total;
-    ++_perKind[ptr->kind()];
-  }
-
-  typedef std::map<ResolvableTraits::KindType,Counter<unsigned> > KindMap;
-  Counter<unsigned> _total;
-  KindMap           _perKind;
-};
-
-std::ostream & operator<<( std::ostream & str, const Rstats & obj )
-{
-  str << "Total: " << obj._total;
-  for( Rstats::KindMap::const_iterator it = obj._perKind.begin(); it != obj._perKind.end(); ++it )
-    {
-      str << endl << "  " << it->first << ":\t" << it->second;
-    }
-  return str;
-}
-
-template<class _Iterator>
-  void rstats( _Iterator begin, _Iterator end )
-  {
-    DBG << __PRETTY_FUNCTION__ << endl;
-    Rstats stats;
-    for_each( begin, end, functorRef<void,ResObject::constPtr>(stats) );
-    MIL << stats << endl;
-  }
-
-///////////////////////////////////////////////////////////////////
-
-void test( ResPool::const_iterator begin, ResPool::const_iterator end, const Edition & ed, Rel op = Rel::EQ )
-{
-  SEC << "Serach for editions " << op << ' ' << ed << ':' << endl;
-  SEC << invokeOnEach( begin, end,
-
-                       resfilter::byEdition( Edition("2.0-1"), CompareBy<Edition>(op) ),
-
-                       Print() ) << endl;
-}
-
-/******************************************************************
-**
-**      FUNCTION NAME : main
-**      FUNCTION TYPE : int
-*/
-int main( int argc, char * argv[] )
-{
-  string infile( "p" );
-  if (argc >= 2 )
-    infile = argv[1];
-
-  Source_Ref src( SourceFactory().createFrom( new source::susetags::SuseTagsImpl(infile) ) );
-  MIL << src.resolvables().size() << endl;
-
-  ResPoolManager pool;
-  pool.insert( src.resolvables().begin(), src.resolvables().end() );
-  MIL << pool << endl;
-
-  ResPool query( pool.accessor() );
-  rstats( query.begin(), query.end() );
-
-  SEC << invokeOnEach( query.begin(), query.end(),
-                       Print() ) << endl;
-
-  test( query.begin(), query.end(), Edition("2.0-1"), Rel::LT );
-  test( query.begin(), query.end(), Edition("2.0-1"), Rel::LE );
-  test( query.begin(), query.end(), Edition("2.0-1"), Rel::EQ );
-  test( query.begin(), query.end(), Edition("2.0-1"), Rel::GE );
-  test( query.begin(), query.end(), Edition("2.0-1"), Rel::GT );
-  test( query.begin(), query.end(), Edition("2.0-1"), Rel::ANY );
-  test( query.begin(), query.end(), Edition("2.0-1"), Rel::NONE );
-
-
-
-  return 0;
-}
-
diff --git a/devel/devel.ma/testdrafts/EditionRangeOvelap.cc b/devel/devel.ma/testdrafts/EditionRangeOvelap.cc
deleted file mode 100644 (file)
index 33b23fd..0000000
+++ /dev/null
@@ -1,107 +0,0 @@
-#include <iostream>
-#include <ctime>
-
-#include <zypp/base/Logger.h>
-#include <zypp/base/Exception.h>
-
-#include <zypp/Edition.h>
-
-using namespace std;
-using namespace zypp;
-
-// work around flaw in y2logview
-template<class _Tp>
-  void printOnHack( const _Tp & obj )
-  {
-    MIL << obj << endl;
-  };
-
-///////////////////////////////////////////////////////////////////
-// Just for the stats
-struct Measure
-{
-  time_t _begin;
-  Measure()
-  : _begin( time(NULL) )
-  {
-    USR << "START MEASURE..." << endl;
-  }
-  ~Measure()
-  {
-    USR << "DURATION: " << (time(NULL)-_begin) << " sec." << endl;
-  }
-};
-
-///////////////////////////////////////////////////////////////////
-// Print stream status
-ostream & operator<<( ostream & str, const istream & obj ) {
-  return str
-  << (obj.good() ? 'g' : '_')
-  << (obj.eof()  ? 'e' : '_')
-  << (obj.fail() ? 'F' : '_')
-  << (obj.bad()  ? 'B' : '_');
-}
-
-namespace zypp
-{
-
-
-
-}
-
-using namespace zypp;
-
-/******************************************************************
-**
-**      FUNCTION NAME : main
-**      FUNCTION TYPE : int
-*/
-int main( int argc, char * argv[] )
-{
-  INT << "===[START]==========================================" << endl;
-
-  Edition::Range any;
-  DBG << any << endl;
-
-  Edition l( "1.0" );
-  Edition r( "2.0" );
-
-#define R(O,E) Edition::Range( Rel::O, E )
-
-#define NONE(E) R(NONE,E)
-#define ANY(E) R(ANY,E)
-#define LT(E) R(LT,E)
-#define LE(E) R(LE,E)
-#define EQ(E) R(EQ,E)
-#define GE(E) R(GE,E)
-#define GT(E) R(GT,E)
-#define NE(E) R(NE,E)
-
-#define OV(L,R) DBG << #L << " <> " << #R << " ==> " << Edition::Range::overlaps( L, R ) << endl
-
-  ERR << "Omitting Rel::NE" << endl;
-
-#define OVALL( L )  \
-  DBG << "----------------------------" << endl; \
-  OV( L, NONE(r) ); \
-  OV( L, ANY(r) );  \
-  OV( L, LT(r) );   \
-  OV( L, LE(r) );   \
-  OV( L, EQ(r) );   \
-  OV( L, GE(r) );   \
-  OV( L, GT(r) );   \
-  DBG << "----------------------------" << endl;
-
-  OVALL( NONE(l) );
-  OVALL( ANY(l) );
-  OVALL( LT(l) );
-  OVALL( LE(l) );
-  OVALL( EQ(l) );
-  OVALL( GE(l) );
-  OVALL( GT(l) );
-
-  // same for l > r and l == r
-
-  INT << "===[END]============================================" << endl;
-  return 0;
-}
diff --git a/devel/devel.ma/testdrafts/GzStream.cc b/devel/devel.ma/testdrafts/GzStream.cc
deleted file mode 100644 (file)
index 835d44a..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-#include <iostream>
-#include <list>
-#include <set>
-
-#include "Tools.h"
-
-#include <zypp/base/LogControl.h>
-#include <zypp/base/GzStream.h>
-#include <zypp/base/IOStream.h>
-
-using namespace std;
-using namespace zypp;
-
-std::ostream & operator<<( std::ostream & str, std::istream & obj )
-{
-  return str << "IN("
-             << ( obj.good() ? 'g' : '_' )
-             << ( obj.eof()  ? 'e' : '_' )
-             << ( obj.fail() ? 'F' : '_' )
-             << ( obj.bad()  ? 'B' : '_' )
-             << ' ' << obj.tellg() << ")";
-}
-std::ostream & operator<<( std::ostream & str, std::ostream & obj )
-{
-  return str << "OUT("
-             << ( obj.good() ? 'g' : '_' )
-             << ( obj.eof()  ? 'e' : '_' )
-             << ( obj.fail() ? 'F' : '_' )
-             << ( obj.bad()  ? 'B' : '_' )
-             << ' ' << obj.tellp() << ")";
-}
-
-
-/******************************************************************
-**
-**      FUNCTION NAME : main
-**      FUNCTION TYPE : int
-*/
-int main( int argc, char * argv[] )
-{
-  INT << "===[START]==========================================" << endl;
-
-  ifgzstream inf( "file" );
-  ofgzstream zout( "file.gz" );
-  MIL << inf << endl;
-  MIL << zout << endl;
-
-  inf >> noskipws;
-  copy( istream_iterator<char>(inf), istream_iterator<char>(),
-        ostream_iterator<char>(zout) );
-  MIL << inf << endl;
-  MIL << zout << endl;
-  zout.close();
-  MIL << zout << endl;
-
-  ifgzstream zinf( "file.gz" );
-  DBG << zinf << endl;
-  zinf >> noskipws;
-  copy( istream_iterator<char>(zinf), istream_iterator<char>(),
-        ostream_iterator<char>(DBG) );
-  DBG << endl;
-  MIL << zinf << endl;
-
-  INT << "===[END]============================================" << endl << endl;
-  return 0;
-}
-
diff --git a/devel/devel.ma/testdrafts/Locale.cc b/devel/devel.ma/testdrafts/Locale.cc
deleted file mode 100644 (file)
index 1644e70..0000000
+++ /dev/null
@@ -1,102 +0,0 @@
-#include <iostream>
-
-#include "zypp/base/LogControl.h"
-
-#include "zypp/Locale.h"
-
-
-using std::endl;
-using namespace zypp;
-
-inline std::string vstr( const char * str )
-{
-  std::string ret;
-  if ( str )
-    {
-      ret+="\"";
-      ret+=str;
-      ret+="\"";
-    }
-  return ret;
-}
-
-void test( const Locale & val_r )
-{
-  DBG << " <<:        " << (val_r) << endl;
-  DBG << " code:      " << (val_r.code()) << endl;
-  DBG << " name:      " << (val_r.name()) << endl;
-  DBG << " ==noCode:  " << (val_r == Locale::noCode) << endl;
-  DBG << " !=noCode:  " << (val_r != Locale::noCode) << endl;
-  DBG << " Language:  " << (val_r.language()) << endl;
-  DBG << " Country:   " << (val_r.country()) << endl;
-}
-
-void test( const LanguageCode & val_r )
-{
-  DBG << " <<:        " << (val_r) << endl;
-  DBG << " code:      " << (val_r.code()) << endl;
-  DBG << " name:      " << (val_r.name()) << endl;
-  DBG << " ==noCode:  " << (val_r == LanguageCode::noCode) << endl;
-  DBG << " !=noCode:  " << (val_r != LanguageCode::noCode) << endl;
-  DBG << " ==default: " << (val_r == LanguageCode::useDefault) << endl;
-  DBG << " !=default: " << (val_r != LanguageCode::useDefault) << endl;
-}
-
-void test( const CountryCode & val_r )
-{
-  DBG << " <<:       " << (val_r) << endl;
-  DBG << " code:     " << (val_r.code()) << endl;
-  DBG << " name:     " << (val_r.name()) << endl;
-  DBG << " ==noCode: " << (val_r == CountryCode::noCode) << endl;
-  DBG << " !=noCode: " << (val_r != CountryCode::noCode) << endl;
-}
-
-void testLocale( const char * str = 0 )
-{
-  MIL << "Locale(" << vstr(str) << ")" << endl;
-  test( str ? Locale( str ) : Locale() );
-}
-
-void testLanguage( const char * str = 0 )
-{
-  MIL << "Language(" << vstr(str) << ")" << endl;
-  test( str ? LanguageCode( str ) : LanguageCode() );
-}
-
-void testCountry( const char * str = 0 )
-{
-  MIL << "Country(" << vstr(str) << ")" << endl;
-  test( str ? CountryCode( str ) : CountryCode() );
-}
-
-/******************************************************************
-**
-**      FUNCTION NAME : main
-**      FUNCTION TYPE : int
-*/
-int main( int argc, char * argv[] )
-{
-  //zypp::base::LogControl::instance().logfile( "xxx" );
-  INT << "===[START]==========================================" << endl;
-
-  testLocale();
-  testLocale( "" );
-  testLocale( "en" );
-  testLocale( "de_DE" );
-  testLocale( "C" );
-  testLocale( "POSIX" );
-  testLocale( "default" );
-
-  testLanguage();
-  testLanguage( "" );
-  testLanguage( "en" );
-  testLanguage( "default" );
-
-  testCountry();
-  testCountry( "" );
-  testCountry( "US" );
-  testCountry( "DE" );
-
-  INT << "===[END]============================================" << endl;
-  return 0;
-}
diff --git a/devel/devel.ma/testdrafts/XmlExample.cc b/devel/devel.ma/testdrafts/XmlExample.cc
deleted file mode 100644 (file)
index 717e2cb..0000000
+++ /dev/null
@@ -1,270 +0,0 @@
-#include "Tools.h"
-
-extern "C"
-{
-#include <libxml/xmlreader.h>
-#include <libxml/xmlerror.h>
-}
-#include <iostream>
-#include <fstream>
-#include <list>
-#include <map>
-#include <set>
-
-#include <boost/call_traits.hpp>
-
-#include <zypp/base/LogControl.h>
-#include <zypp/base/LogTools.h>
-
-#include "zypp/base/Exception.h"
-#include "zypp/base/InputStream.h"
-#include "zypp/base/DefaultIntegral.h"
-#include <zypp/base/Function.h>
-#include <zypp/base/Iterator.h>
-#include <zypp/Pathname.h>
-#include <zypp/Edition.h>
-#include <zypp/CheckSum.h>
-#include <zypp/Date.h>
-#include <zypp/Rel.h>
-
-#include "zypp/parser/xml/Reader.h"
-
-using namespace std;
-using namespace zypp;
-
-///////////////////////////////////////////////////////////////////
-
-static const Pathname sysRoot( "/Local/ROOT" );
-
-///////////////////////////////////////////////////////////////////
-
-template<class _Cl>
-    void ti( const _Cl & c )
-{
-  SEC << __PRETTY_FUNCTION__ << endl;
-}
-
-///////////////////////////////////////////////////////////////////
-
-bool dump( xml::Reader & reader_r )
-{
-  MIL << *reader_r << endl;
-}
-
-///////////////////////////////////////////////////////////////////
-
-bool dumpNode( xml::Reader & reader_r )
-{
-  switch ( reader_r->nodeType() )
-  {
-    case XML_READER_TYPE_ELEMENT:
-      MIL << *reader_r << endl;
-      for ( int i = 0; i < reader_r->attributeCount(); ++i )
-      {
-       MIL << " attr no " << i << " '" << reader_r->getAttributeNo( i ) << "'" << endl;
-      }
-      break;
-
-    case XML_READER_TYPE_ATTRIBUTE:
-      WAR << *reader_r << endl;
-      break;
-
-    case XML_READER_TYPE_TEXT:
-    case XML_READER_TYPE_CDATA:
-      DBG << *reader_r << endl;
-      break;
-
-    default:
-      //ERR << *reader_r << endl;
-      break;
-  }
-  return true;
-}
-
-///////////////////////////////////////////////////////////////////
-
-bool dumpEd( xml::Reader & reader_r )
-{
-  static int num = 5;
-  if ( reader_r->nodeType() == XML_READER_TYPE_ELEMENT
-       && reader_r->name() == "version" )
-    {
-      MIL << *reader_r << endl;
-#define _show(x) DBG << #x << " = " << reader_r->getAttribute( #x ) << endl
-      _show( rel );
-      _show( ver );
-      _show( epoch );
-      WAR << Edition( reader_r->getAttribute( "ver" ).asString(),
-                      reader_r->getAttribute( "rel" ).asString(),
-                      reader_r->getAttribute( "epoch" ).asString() ) << endl;
-      --num;
-    }
-  return num;
-}
-
-///////////////////////////////////////////////////////////////////
-
-template<class _OutputIterator>
-  struct DumpDeps
-  {
-    DumpDeps( _OutputIterator result_r )
-    : _result( result_r )
-    {}
-
-    bool operator()( xml::Reader & reader_r )
-    {
-      if ( reader_r->nodeType()     == XML_READER_TYPE_ELEMENT
-           && reader_r->prefix()    == "rpm"
-           && reader_r->localName() == "entry" )
-        {
-          string n( reader_r->getAttribute( "name" ).asString() );
-          Rel op( reader_r->getAttribute( "flags" ).asString() );
-          if ( op != Rel::ANY )
-            {
-              n += " ";
-              n += op.asString();
-              n += " ";
-              n += reader_r->getAttribute( "ver" ).asString();
-              n += "-";
-              n += reader_r->getAttribute( "rel" ).asString();
-            }
-          *_result = n;
-          ++_result;
-        }
-      return true;
-    }
-
-    _OutputIterator _result;
-  };
-
-template<class _OutputIterator>
-  DumpDeps<_OutputIterator> dumpDeps( _OutputIterator result_r )
-  { return DumpDeps<_OutputIterator>( result_r ); }
-
-///////////////////////////////////////////////////////////////////
-
-/******************************************************************
-**
-**      FUNCTION NAME : main
-**      FUNCTION TYPE : int
-*/
-int main( int argc, char * argv[] )
-{
-  INT << "===[START]==========================================" << endl;
-
-  --argc;
-  ++argv;
-
-  Pathname repodata;
-  if ( argc )
-    {
-      repodata = *argv;
-    }
-  else
-    {
-      repodata = "/Local/FACTORY/repodata";
-      repodata /= "primary.xml";
-    }
-
-  if ( 1 )
-    {
-      Measure m( "Parse" );
-      xml::Reader reader( repodata );
-
-      switch ( 3 )
-      {
-       case 1:
-         reader.foreachNode( dumpNode );
-         break;
-       case 2:
-         reader.foreachNodeOrAttribute( dumpNode );
-         break;
-       case 3:
-         reader.foreachNode( dumpEd );
-         break;
-
-       default:
-         WAR << "NOP" << endl;
-         break;
-      }
-    }
-
-  INT << "===[END]============================================" << endl << endl;
-  return 0;
-}
-
-/*
-<?xml version="1.0" encoding="UTF-8"?>
-<metadata xmlns="http://linux.duke.edu/metadata/common" xmlns:rpm="http://linux.duke.edu/metadata/rpm" packages="23230">
-<package type="rpm">
-<name>fam-devel</name>
-<arch>ppc</arch>
-<version epoch="0" ver="2.6.10" rel="141"/>
-<checksum type="sha" pkgid="YES">59d6a65cdadd911fe8ceee87740a54305b2ab053</checksum>
-<summary>Include Files and Libraries Mandatory for Development</summary>
-<description>Fam is a file alteration monitoring service. This means that you can
-
-foreachNode( dumpNode )
-=======================
-START MEASURE(Parse)
-0:ELEMENT <metadata>  [attr 3]
- attr no 0 'http://linux.duke.edu/metadata/common'
- attr no 1 'http://linux.duke.edu/metadata/rpm'
- attr no 2 '23230'
-1: ELEMENT <package>  [attr 1]
- attr no 0 'rpm'
-2:  ELEMENT <name>  [noattr]
-3:   TEXT <#text>  [noattr] {fam-devel}
-2:  ELEMENT <arch>  [noattr]
-3:   TEXT <#text>  [noattr] {ppc}
-2:  ELEMENT <version>  [attr 3|empty]
- attr no 0 '0'
- attr no 1 '2.6.10'
- attr no 2 '141'
-2:  ELEMENT <checksum>  [attr 2]
- attr no 0 'sha'
- attr no 1 'YES'
-3:   TEXT <#text>  [noattr] {59d6a65cdadd911fe8ceee87740a54305b2ab053}
-2:  ELEMENT <summary>  [noattr]
-3:   TEXT <#text>  [noattr] {Include Files and Libraries Mandatory for Development}
-2:  ELEMENT <description>  [noattr]
-3:   TEXT <#text>  [noattr] {Fam is a file alteration monitoring service. This means that you can
-
-foreachNodeOrAttribute( dumpNode )
-==================================
-START MEASURE(Parse)
-0:ELEMENT <metadata>  [attr 3]
- attr no 0 'http://linux.duke.edu/metadata/common'
- attr no 1 'http://linux.duke.edu/metadata/rpm'
- attr no 2 '23230'
-1: ATTRIBUTE <xmlns>  [noattr] {http://linux.duke.edu/metadata/common}
-1: ATTRIBUTE <xmlns:rpm>  [noattr] {http://linux.duke.edu/metadata/rpm}
-1: ATTRIBUTE <packages>  [noattr] {23230}
-1: ELEMENT <package>  [attr 1]
- attr no 0 'rpm'
-2:  ATTRIBUTE <type>  [noattr] {rpm}
-2:  ELEMENT <name>  [noattr]
-3:   TEXT <#text>  [noattr] {fam-devel}
-2:  ELEMENT <arch>  [noattr]
-3:   TEXT <#text>  [noattr] {ppc}
-2:  ELEMENT <version>  [attr 3|empty]
- attr no 0 '0'
- attr no 1 '2.6.10'
- attr no 2 '141'
-3:   ATTRIBUTE <epoch>  [noattr] {0}
-3:   ATTRIBUTE <ver>  [noattr] {2.6.10}
-3:   ATTRIBUTE <rel>  [noattr] {141}
-2:  ELEMENT <checksum>  [attr 2]
- attr no 0 'sha'
- attr no 1 'YES'
-3:   ATTRIBUTE <type>  [noattr] {sha}
-3:   ATTRIBUTE <pkgid>  [noattr] {YES}
-3:   TEXT <#text>  [noattr] {59d6a65cdadd911fe8ceee87740a54305b2ab053}
-3:   ATTRIBUTE <type>  [noattr] {sha}
-3:   ATTRIBUTE <pkgid>  [noattr] {YES}
-2:  ELEMENT <summary>  [noattr]
-3:   TEXT <#text>  [noattr] {Include Files and Libraries Mandatory for Development}
-2:  ELEMENT <description>  [noattr]
-3:   TEXT <#text>  [noattr] {Fam is a file alteration monitoring service. This means that you can
-
-*/