1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-03 04:22:09 +03:00

talloc: Add python talloc module, move convenience functions to it.

Autobuild-User: Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date: Fri Nov  5 02:48:21 UTC 2010 on sn-devel-104
This commit is contained in:
Jelmer Vernooij
2010-11-05 03:00:45 +01:00
parent 4edabb3256
commit cd172e7724
7 changed files with 102 additions and 63 deletions

View File

@ -17,15 +17,16 @@ sys.path.insert(0, "bin/python")
import samba
import samba.tests
from samba.dcerpc import drsuapi
import talloc
samba.talloc_enable_null_tracking()
talloc.enable_null_tracking()
class TallocTests(samba.tests.TestCase):
'''test talloc behaviour of pidl generated python code'''
def check_blocks(self, object, num_expected):
'''check that the number of allocated blocks is correct'''
nblocks = samba.talloc_total_blocks(object)
nblocks = talloc.total_blocks(object)
if object is None:
nblocks -= self.initial_blocks
self.assertEquals(nblocks, num_expected)
@ -61,7 +62,7 @@ class TallocTests(samba.tests.TestCase):
self.check_blocks(None, 6)
def test_run(self):
self.initial_blocks = samba.talloc_total_blocks(None)
self.initial_blocks = talloc.total_blocks(None)
self.check_blocks(None, 0)
self.pas_test()
self.check_blocks(None, 0)