Skip to content

Commit 5be275e

Browse files
committed
2 parents ccd616d + ff7756f commit 5be275e

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

test/matfile.jl

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ using MATLAB
22
using Base.Test
33

44
# test MMAT file I/O
5+
fn = "$(tempname()).mat"
56

67
a32 = Int32[1 2 3; 4 5 6]
78
a64 = Int64[1 2 3; 4 5 6]
@@ -17,9 +18,9 @@ end
1718

1819
ss = S[S(1.0, true, [1., 2.]), S(2.0, false, [3., 4.])]
1920

20-
write_matfile("test.mat"; a32=a32, a64=a64, b=b, c=c, d=d, ss=mxstructarray(ss))
21+
write_matfile(fn; a32=a32, a64=a64, b=b, c=c, d=d, ss=mxstructarray(ss))
2122

22-
r = read_matfile("test.mat")
23+
r = read_matfile(fn)
2324
@test isa(r, Dict{String, MxArray})
2425
@test length(r) == 6
2526

@@ -49,6 +50,8 @@ gc() # make sure that ra, rb, rc, rd remain valid
4950
@test jvector(get_field(rss, 2, "z")) == ss[2].z
5051

5152
# segfault on deleted references
52-
s = MatFile("test.mat", "r")
53+
s = MatFile(fn)
5354
close(s)
5455
@test_throws UndefRefError close(s)
56+
57+
rm(fn)

0 commit comments

Comments
 (0)