@@ -51,6 +51,11 @@ def test_empty(self):
5151 self .assertEqual (a .access_flags , 'readwrite' )
5252 self .assertEqual (nd .type_of (a ), ndt .make_fixed_dim (3 , ndt .int32 ))
5353 self .assertEqual (a .shape , (3 ,))
54+ # Constructor from type with cfixed dimension
55+ a = nd .empty ('cfixed[3] * int32' )
56+ self .assertEqual (a .access_flags , 'readwrite' )
57+ self .assertEqual (nd .type_of (a ), ndt .make_cfixed_dim (3 , ndt .int32 ))
58+ self .assertEqual (a .shape , (3 ,))
5459 # Constructor from type with fixed dimension, accesskwarg
5560 a = nd .empty ('3 * int32' , access = 'rw' )
5661 self .assertEqual (a .access_flags , 'readwrite' )
@@ -549,27 +554,27 @@ def test_nested_struct_array(self):
549554
550555 def test_missing_field (self ):
551556 self .assertRaises (RuntimeError , nd .array ,
552- [0 , 1 ], type = '{x:int32, y:int32, z:int32}' )
557+ [0 , 1 ], type = 'c {x:int32, y:int32, z:int32}' )
553558 # With dtype= parameter instead of type=
554559 self .assertRaises (RuntimeError , nd .array ,
555- [0 , 1 ], dtype = '{x:int32, y:int32, z:int32}' )
560+ [0 , 1 ], dtype = 'c {x:int32, y:int32, z:int32}' )
556561 self .assertRaises (RuntimeError , nd .array ,
557- {'x' :0 , 'z' :1 }, type = '{x:int32, y:int32, z:int32}' )
562+ {'x' :0 , 'z' :1 }, type = 'c {x:int32, y:int32, z:int32}' )
558563 # With dtype= parameter instead of type=
559564 self .assertRaises (RuntimeError , nd .array ,
560- {'x' :0 , 'z' :1 }, dtype = '{x:int32, y:int32, z:int32}' )
565+ {'x' :0 , 'z' :1 }, dtype = 'c {x:int32, y:int32, z:int32}' )
561566
562567 def test_extra_field (self ):
563568 self .assertRaises (RuntimeError , nd .array ,
564- [0 , 1 , 2 , 3 ], type = '{x:int32, y:int32, z:int32}' )
569+ [0 , 1 , 2 , 3 ], type = 'c {x:int32, y:int32, z:int32}' )
565570 # With dtype= parameter instead of type=
566571 self .assertRaises (RuntimeError , nd .array ,
567- [0 , 1 , 2 , 3 ], dtype = '{x:int32, y:int32, z:int32}' )
572+ [0 , 1 , 2 , 3 ], dtype = 'c {x:int32, y:int32, z:int32}' )
568573 self .assertRaises (RuntimeError , nd .array ,
569- {'x' :0 ,'y' :1 ,'z' :2 ,'w' :3 }, type = '{x:int32, y:int32, z:int32}' )
574+ {'x' :0 ,'y' :1 ,'z' :2 ,'w' :3 }, type = 'c {x:int32, y:int32, z:int32}' )
570575 # With dtype= parameter instead of type=
571576 self .assertRaises (RuntimeError , nd .array ,
572- {'x' :0 ,'y' :1 ,'z' :2 ,'w' :3 }, dtype = '{x:int32, y:int32, z:int32}' )
577+ {'x' :0 ,'y' :1 ,'z' :2 ,'w' :3 }, dtype = 'c {x:int32, y:int32, z:int32}' )
573578
574579class TestIteratorConstruct (unittest .TestCase ):
575580 # Test dynd construction from iterators
@@ -731,8 +736,8 @@ def test_simple_fromiter_medsize(self):
731736 def test_ragged_fromiter (self ):
732737 # Strided array of var from list of iterators
733738 a = nd .array ([(1 + x for x in range (3 )), (5 * x - 10 for x in range (5 )),
734- [2 , 10 ]], type = 'M * var * int32' )
735- self .assertEqual (nd .type_of (a ), ndt .type ('M * var * int32' ))
739+ [2 , 10 ]], type = 'strided * var * int32' )
740+ self .assertEqual (nd .type_of (a ), ndt .type ('strided * var * int32' ))
736741 self .assertEqual (nd .as_py (a ),
737742 [[1 ,2 ,3 ], [- 10 , - 5 , 0 , 5 , 10 ], [2 , 10 ]])
738743 # Var array of var from iterator of iterators
0 commit comments