summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorArch Librarian <arch@canonical.com>2004-09-20 16:54:11 +0000
committerArch Librarian <arch@canonical.com>2004-09-20 16:54:11 +0000
commit2fd65468b3cb25c725a709f9b470ced0ab4823a6 (patch)
treeca4ae9007380e92eac7b4c9b0ac14f0335413543 /test
parent29f7b36cd63f16ceab825531b5c131eac4b99f9b (diff)
Fixed handling of missing files
Author: jgg Date: 1999-07-04 23:22:53 GMT Fixed handling of missing files
Diffstat (limited to 'test')
-rw-r--r--test/scratch.cc54
1 files changed, 53 insertions, 1 deletions
diff --git a/test/scratch.cc b/test/scratch.cc
index d3ca58a77..c48f3f594 100644
--- a/test/scratch.cc
+++ b/test/scratch.cc
@@ -1,11 +1,63 @@
+#include <string>
+/*void basic_string<char,string_char_traits<char>,alloc>::Rep::release()
+{
+ cout << "Release " << (void *)this << ' ' << ref << endl;
+ if (--ref == 0) delete this;
+}
+
+basic_string<char,string_char_traits<char>,alloc>::~basic_string()
+{
+ cout << "Destroy " << (void *)this << ',' << rep()->ref << endl;
+ rep ()->release ();
+}*/
+
+
+
#include <apt-pkg/tagfile.h>
#include <apt-pkg/strutl.h>
+#include <apt-pkg/cachefile.h>
+#include <apt-pkg/pkgrecords.h>
+#include <apt-pkg/error.h>
+#include <apt-pkg/init.h>
+
#include <signal.h>
#include <stdio.h>
+#include <malloc.h>
+
+struct Rep
+{
+ size_t len, res, ref;
+ bool selfish;
+};
int main(int argc,char *argv[])
{
+ pkgCacheFile Cache;
+ OpProgress Prog;
+ pkgInitialize(*_config);
+ if (Cache.Open(Prog,false) == false)
+ {
+ _error->DumpErrors();
+ return 0;
+ }
+
+ pkgRecords rec(*Cache);
+ while (1)
+ {
+ pkgCache::VerIterator V = (*Cache)[Cache->PkgBegin()].CandidateVerIter(*Cache);
+ pkgRecords::Parser &Parse = rec.Lookup(V.FileList());
+ string Foo = Parse.ShortDesc();
+
+ cout << (reinterpret_cast<Rep *>(Foo.begin()) - 1)[0].ref << endl;
+
+// cout << Foo << endl;
+
+// cout << rec.Lookup(V.FileList()).ShortDesc() << endl;
+ malloc_stats();
+ }
+
+#if 0
URI U(argv[1]);
cout << U.Access << endl;
cout << U.User << endl;
@@ -26,6 +78,6 @@ int main(int argc,char *argv[])
Sect.FindS("Version");
Sect.FindI("Size");
};*/
-
+#endif
return 0;
}