Skip to content

Commit 9aaa542

Browse files
committed
test hdf4
1 parent 1f9e408 commit 9aaa542

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

+stdlib/h4exists.m

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
% * variable: path of variable in file
77
%%% Outputs
88
% * exists: boolean
9-
arguments
10-
file
11-
variable (1,1) string
12-
end
9+
% arguments
10+
% file
11+
% variable (1,1) string
12+
% end
1313

1414
sds = hdfinfo(file).SDS;
1515
exists = ismember(variable, sds.Name);

+stdlib/h4size.m

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
% fsize: vector of variable size per dimension. Empty if scalar variable.
88

99
function fsize = h4size(file, variable)
10-
arguments
11-
file
12-
variable (1,1) string
13-
end
10+
% arguments
11+
% file
12+
% variable (1,1) string
13+
% end
1414

1515
sds = hdfinfo(file).SDS;
1616

17-
i = {sds.Name} == variable;
17+
i = strcmp({sds.Name}, variable);
1818
if ~any(i)
1919
error(variable + " is not an SDS in " + file)
2020
end

test/TestHDF4.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
classdef (SharedTestFixtures={ matlab.unittest.fixtures.PathFixture(fileparts(fileparts(mfilename('fullpath'))))}, ...
2-
TestTags = {'R2019b', 'hdf4'}) ...
2+
TestTags = {'R2017b', 'hdf4'}) ...
33
TestHDF4 < matlab.unittest.TestCase
44

55
properties
@@ -8,7 +8,7 @@
88

99
methods (TestClassSetup)
1010
function check_file(tc)
11-
tc.assumeThat(tc.file, matlab.unittest.constraints.IsFile)
11+
tc.assumeTrue(isfile(tc.file), "HDF4 file not found: " + tc.file)
1212
end
1313
end
1414

0 commit comments

Comments
 (0)