Skip to content

Commit b816633

Browse files
committed
test:disk_cap: improve test
1 parent 6c416a8 commit b816633

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

+stdlib/+python/disk_capacity.m

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
% int64 first is for Matlab <= R2022a
1111
catch e
1212
warning(e.identifier, "disk_capacity(%s) failed: %s", p, e.message);
13-
f = 0;
1413
end
1514

1615
f = uint64(f);

+stdlib/+sys/disk_capacity.m

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
[s, t] = system(cmd);
1717
if s == 0
1818
t = str2double(t);
19-
else
20-
t = 0;
2119
end
2220

2321
t = uint64(t);

test/TestDisk.m

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,14 @@ function test_disk_capacity(tc, Ps, disk_capacity_fun)
4747

4848
zero = uint64(0);
4949

50+
dc = disk_capacity_fun(Ps);
51+
52+
tc.verifyClass(dc, 'uint64')
53+
5054
if stdlib.exists(Ps)
51-
tc.verifyGreaterThan(disk_capacity_fun(Ps), zero)
55+
tc.verifyGreaterThan(dc, zero)
5256
else
53-
tc.verifyEqual(disk_capacity_fun(Ps), zero)
57+
tc.verifyEqual(dc, zero)
5458
end
5559
end
5660

0 commit comments

Comments
 (0)