Skip to content

Commit 33f821e

Browse files
committed
test:parameterize
1 parent 59cc72a commit 33f821e

File tree

1 file changed

+13
-14
lines changed

1 file changed

+13
-14
lines changed

test/TestHDF5.m

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77
properties (TestParameter)
88
str = {"string", 'char'}
9+
type = {"single", "double", "float64", "float32",...
10+
"int8", "int16", "int32", "int64", ...
11+
"uint8", "uint16", "uint32", "uint64", "string"}
912
end
1013

1114
methods(TestClassSetup)
@@ -60,7 +63,7 @@ function setup_file(tc)
6063
end
6164

6265

63-
methods (Test)
66+
methods (Test, ParameterCombination = 'sequential')
6467

6568
function test_auto_chunk_size(tc)
6669

@@ -213,24 +216,20 @@ function test_shape(tc)
213216
end
214217

215218

216-
function test_coerce(tc)
219+
function test_coerce(tc, type)
217220
basic = tc.TestData.basic;
218221

219-
for type = ["single", "double", "float64", "float32",...
220-
"int8", "int16", "int32", "int64", ...
221-
"uint8", "uint16", "uint32", "uint64", "string"]
222-
223-
stdlib.h5save(basic, type, 0, "type",type)
222+
stdlib.h5save(basic, type, 0, "type",type)
224223

225-
switch type
226-
case "string", vt = 'char';
227-
case "float64", vt = 'double';
228-
case "float32", vt = 'single';
229-
otherwise, vt = type;
230-
end
231-
tc.verifyClass(h5read(basic, "/"+type), vt)
224+
switch type
225+
case "string", vt = 'char';
226+
case "float64", vt = 'double';
227+
case "float32", vt = 'single';
228+
otherwise, vt = type;
232229
end
233230

231+
tc.verifyClass(h5read(basic, "/"+type), vt)
232+
234233
end
235234

236235

0 commit comments

Comments
 (0)