Skip to content

Commit 7055806

Browse files
committed
Fix tests, don't use compare.
We need to make sure we got a GPU array, and not just verify its contents.
1 parent 95833da commit 7055806

File tree

1 file changed

+21
-6
lines changed

1 file changed

+21
-6
lines changed

test/testsuite/construction.jl

Lines changed: 21 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,27 @@ end
100100

101101
@testsuite "construct/convenience" AT->begin
102102
for T in supported_eltypes()
103-
@test compare((a,b)->fill!(a, b), AT, rand(T, 3), rand(T))
104-
105-
@test compare(a->zero(a), AT, rand(T, 2))
106-
@test compare(a->zero(a), AT, rand(T, 2, 2))
107-
@test compare(a->zero(a), AT, rand(T, 2, 2, 2))
108-
@test compare(a->one(a), AT, rand(T, 2, 2))
103+
A = AT(rand(T, 3))
104+
b = rand(T)
105+
fill!(A, b)
106+
@test A isa AT{T,1}
107+
@test Array(A) == fill(b, 3)
108+
109+
A = zero(AT(rand(T, 2)))
110+
@test A isa AT{T,1}
111+
@test Array(A) == zero(rand(T, 2))
112+
113+
A = zero(AT(rand(T, 2, 2)))
114+
@test A isa AT{T,2}
115+
@test Array(A) == zero(rand(T, 2, 2))
116+
117+
A = zero(AT(rand(T, 2, 2, 2)))
118+
@test A isa AT{T,3}
119+
@test Array(A) == zero(rand(T, 2, 2, 2))
120+
121+
A = one(AT(rand(T, 2, 2)))
122+
@test A isa AT{T,2}
123+
@test Array(A) == one(rand(T, 2, 2))
109124
end
110125
end
111126

0 commit comments

Comments
 (0)