# HG changeset patch # User Thinker K.F. Li # Date 1306894205 -28800 # Node ID 712e76c3d7911c98b4c75e440e26fb8723a56a1a # Parent c98be35b572b01b7645a5449b8d722e1c7538379 unittest for dexfile.py diff -r c98be35b572b -r 712e76c3d791 paraspace/__init__.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/paraspace/__init__.py Wed Jun 01 10:10:05 2011 +0800 @@ -0,0 +1,1 @@ +# keep me diff -r c98be35b572b -r 712e76c3d791 paraspace/tests/__init__.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/paraspace/tests/__init__.py Wed Jun 01 10:10:05 2011 +0800 @@ -0,0 +1,1 @@ +# keep me diff -r c98be35b572b -r 712e76c3d791 paraspace/tests/dexfile_test.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/paraspace/tests/dexfile_test.py Wed Jun 01 10:10:05 2011 +0800 @@ -0,0 +1,26 @@ +from paraspace import dexfile +import os + +def block_sizes_test(): + srcdir = os.path.dirname(__file__) + srcroot = os.path.join(srcdir, '..', '..') + testdatapath = os.path.join(srcroot, 'data', 'testdata1.dex') + dex = dexfile.DEXFile.open(testdatapath) + assert dex.stringIds.data_size == 5384 + assert dex.typeIds.data_size == 704 + assert dex.protoIds.data_size == 1776 + assert dex.fieldIds.data_size == 1944 + assert dex.methodIds.data_size == 3552 + assert dex.classDefs.data_size == 1600 + assert dex.classDatas.data_size == 2052 + assert dex.typeLists.data_size == 838 + assert dex.codeItems.data_size == 30688 + assert dex.annotationSetItems.data_size == 412 + assert dex.annotationsDirectoryItems.data_size == 792 + assert dex.annotationItems.data_size == 642 + assert dex.encodedArrayItems.data_size == 139 + assert dex.debugInfoItems.data_size == 6353 + assert dex.stringDataItems.data_size == 23492 + pass + +