diff options
| author | Michael Vogt <egon@bottom> | 2007-11-29 12:25:33 +0100 |
|---|---|---|
| committer | Michael Vogt <egon@bottom> | 2007-11-29 12:25:33 +0100 |
| commit | 0fc4aa9466d57ddc4a54191eeb8775e41ad35525 (patch) | |
| tree | 93b7f4e949c3c013309d397de200d058ec7b5af5 /tests | |
| parent | be3ddb25ea0baa259f20936f1d7a62cafa019b99 (diff) | |
| parent | abf6c5801c6b162a9dcda5099e8eb746525dc826 (diff) | |
| download | python-apt-0fc4aa9466d57ddc4a54191eeb8775e41ad35525.tar.gz | |
* apt/package.py:
- fix apt.package.Dependency.relation initialization
* python/string.cc:
- fix overflow in SizeToStr()
* python/metaindex.cc:
- added support for the metaIndex objects
* python/sourceslist.cc:
- support new "List" attribute that returns the list of
metaIndex source entries
* python/depcache.cc:
- be more threading friendly
* python/tag.cc
- support "None" as default in
ParseSection(control).get(field, default), LP: #44470
* python/progress.cc:
- fix refcount problem in OpProgress
- fix refcount problem in FetchProgress
- fix refcount problem in CdromProgress
* apt/README.apt:
- fix typo (thanks to Thomas Schoepf, closes: #387787)
* po/fr.po:
- merge update, thanks to Christian Perrier (closes: #435918)
Diffstat (limited to 'tests')
| -rwxr-xr-x | tests/refcount.py | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/tests/refcount.py b/tests/refcount.py new file mode 100755 index 00000000..f3230bd3 --- /dev/null +++ b/tests/refcount.py @@ -0,0 +1,54 @@ +#!/usr/bin/python-dbg + +from pprint import pprint,pformat +import apt +import sys +import gc +import difflib + +# get initial cache +print sys.gettotalrefcount() +progress= apt.progress.OpTextProgress() +c = apt.Cache(progress) +print "refcount after first cache instance: ", sys.gettotalrefcount() + +# test open() +c.open(progress) +print "refcount after cache open: ", sys.gettotalrefcount() +#pprint(sys.getobjects(10)) + +c.open(apt.progress.OpProgress()) +print "refcount after seconf cache open: ", sys.gettotalrefcount() +#pprint(sys.getobjects(10)) + +# FIXME: find a way to get a efficient diff +#before = gc.get_objects() +#c.open(apt.progress.OpProgress()) +#after = gc.get_objects() + + +# test update() +print "refcount before cache.update(): ", sys.gettotalrefcount() +c.update() +gc.collect() +print "refcount after cache.update(): ", sys.gettotalrefcount() +c.update() +gc.collect() +print "refcount after second cache.update(): ", sys.gettotalrefcount() +#pprint(sys.getobjects(20)) + + +# test install() +c.open(apt.progress.OpProgress()) +gc.collect() +print "refcount before cache['hello'].markInstall(): ", sys.gettotalrefcount() +c["hello"].markInstall() +c.commit(apt.progress.FetchProgress(), apt.progress.InstallProgress()) +gc.collect() +print "refcount after: ", sys.gettotalrefcount() +c.open(apt.progress.OpProgress()) +c["hello"].markDelete() +c.commit(apt.progress.FetchProgress(), apt.progress.InstallProgress()) +gc.collect() +print "refcount after: ", sys.gettotalrefcount() +pprint(sys.getobjects(10)) |
