about summary refs log tree commit diff stats
path: root/test
diff options
context:
space:
mode:
authorserpilliere <serpilliere@users.noreply.github.com>2016-04-19 20:31:49 +0200
committerserpilliere <serpilliere@users.noreply.github.com>2016-04-19 20:31:49 +0200
commitb127dbdfe5832a12f7f328dc560344a9900e8918 (patch)
treeac30c66e67d4fea785e0db89cfd92268af7b9b68 /test
parent5d8ade642dc0cd888af50464cc1686e73d7382ef (diff)
parent98a7703963a9cb5c1e0e4a381a3ce1025a2bf174 (diff)
downloadmiasm-b127dbdfe5832a12f7f328dc560344a9900e8918.tar.gz
miasm-b127dbdfe5832a12f7f328dc560344a9900e8918.zip
Merge pull request #342 from fmonjalet/fix_types
Fix miasm2.core.types API
Diffstat (limited to 'test')
-rw-r--r--test/core/test_types.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/test/core/test_types.py b/test/core/test_types.py
index bb1d5da1..f6e5cb13 100644
--- a/test/core/test_types.py
+++ b/test/core/test_types.py
@@ -108,7 +108,7 @@ assert other == other2 # But same value
 ## Same stuff for Ptr to MemField
 alloc_addr = my_heap.vm_alloc(jitter.vm,
                               mstruct.get_type().get_field_type("i")
-                                     .dst_type.sizeof())
+                                     .dst_type.size)
 mstruct.i = alloc_addr
 mstruct.i.deref.val = 8
 assert mstruct.i.deref.val == 8
@@ -154,6 +154,9 @@ assert memstr3.val == memstr.val # But the python value is the same
 
 
 # Array tests
+# Construction methods
+assert Array(MyStruct) == Array(MyStruct.get_type())
+assert Array(MyStruct, 10) == Array(MyStruct.get_type(), 10)
 # Allocate buffer manually, since memarray is unsized
 alloc_addr = my_heap.vm_alloc(jitter.vm, 0x100)
 memarray = Array(Num("I")).lval(jitter.vm, alloc_addr)