Skip to content

Commit

Permalink
Test for bad pointer conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
kshyatt committed Apr 5, 2020
1 parent adfacde commit 5f94713
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/memory.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@ for srcTy in [Mem.Device, Mem.Host, Mem.Unified],
else
@test !CUDAdrv.is_managed(typed_pointer(src, T))
end
# Test conversion to Ptr throwing an error
if isa(src, Mem.Device)
@test_throws ArgumentError convert(Ptr, src)
end

Mem.free(src)
Mem.free(dst)
Expand Down

0 comments on commit 5f94713

Please sign in to comment.