@@ -109,6 +109,16 @@ function nonExistentArray(testcase)
109109 testcase .verifyError(@()zarrread(' nonexistent/' ),errID );
110110 end
111111
112+ function tooBigArray(testcase )
113+ % Verify zarrread error when a user tries to read data that is
114+ % too large
115+
116+ bigDataPath = " bigData/myzarr" ;
117+ zarrcreate(bigDataPath , [100000 ,100000 ], Datatype= ' single' );
118+ errID = ' MATLAB:Zarr:OutOfMemory' ;
119+ testcase .verifyError(@()zarrread(bigDataPath ),errID );
120+ end
121+
112122 function invalidFilePath(testcase )
113123 % Verify zarrread error when an invalid file path is used.
114124
@@ -147,7 +157,7 @@ function invalidPartialReadParams(testcase)
147157 testcase .verifyError(@()zarrread(zpath ,Count= wrongDims ),errID );
148158
149159 % Invalid type
150- errID = ' MATLAB:validators:mustBeNumericOrLogical ' ;
160+ errID = ' MATLAB:validators:mustBeNumeric ' ;
151161 testcase .verifyError(@()zarrread(zpath ," Start" ," " ),errID );
152162 testcase .verifyError(@()zarrread(zpath ," Stride" ," " ),errID );
153163 testcase .verifyError(@()zarrread(zpath ," Count" ," " ),errID );
@@ -159,12 +169,17 @@ function invalidPartialReadParams(testcase)
159169 testcase .verifyError(@()zarrread(zpath ," Stride" ,inpVal ),errID );
160170 testcase .verifyError(@()zarrread(zpath ," Count" ,inpVal ),errID );
161171
162- % Input out of bounds
172+
173+ % Parameters out of bounds
163174 inpVal = [100 200 ];
164- errID = ' MATLAB:Python:PyException ' ;
175+ errID = ' MATLAB:Zarr:PartialReadOutOfBounds ' ;
165176 testcase .verifyError(@()zarrread(zpath ," Start" ,inpVal ),errID );
166- % testcase.verifyError(@()zarrread(zpath,"Stride",inpVal),errID);
177+ testcase .verifyError(@()zarrread(zpath ," Stride" ,inpVal ),errID );
167178 testcase .verifyError(@()zarrread(zpath ," Count" ,inpVal ),errID );
179+
180+ % Combination of parameters out of bounds
181+ testcase .verifyError(...
182+ @()zarrread(zpath ,Start= [3 4 ],Count= [2 2 ]),errID )
168183 end
169184 end
170185end
0 commit comments