Skip to content

Commit 3c6bb6f

Browse files
committed
Add tests
1 parent 2cf420a commit 3c6bb6f

File tree

2 files changed

+26
-1
lines changed

2 files changed

+26
-1
lines changed

Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ version = "0.1.0"
55

66
[deps]
77
OpenBLAS32_jll = "656ef2d0-ae68-5445-9ca0-591084a874a2"
8+
libblastrampoline_jll = "8e850b90-86db-534c-a0d3-1478176c7d93"
89
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
910

1011
[compat]

test/runtests.jl

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,30 @@
1-
using OpenBLAS32
1+
using OpenBLAS32, LinearAlgebra
22
using Test
33

44
@testset "OpenBLAS32.jl" begin
55
# Write your tests here.
6+
function testswap(x::Vector{Float64}, y::Vector{Float64})
7+
ccall((:dswap_, BLAS.libblas), Cvoid,
8+
(Ref{Int32}, Ptr{Float64}, Ref{Int32}, Ptr{Float64}, Ref{Int32}),
9+
size(x,1), x, 1, y, 1)
10+
end
11+
12+
x = [1.0, 1.0]
13+
y = [2.0, 2.0]
14+
testswap(x,y)
15+
@test x == [2.0,2.0]
16+
@test y == [1.0,1.0]
17+
18+
if Base.USE_BLAS64
19+
function testswap64(x::Vector{Float64}, y::Vector{Float64})
20+
ccall((:dswap_64_, BLAS.libblas), Cvoid,
21+
(Ref{Int64}, Ptr{Float64}, Ref{Int64}, Ptr{Float64}, Ref{Int64}),
22+
size(x,1), x, 1, y, 1)
23+
end
24+
25+
testswap64(x,y)
26+
@test x == [1.0,1.0]
27+
@test y == [2.0,2.0]
28+
end
29+
630
end

0 commit comments

Comments
 (0)