Skip to content

Commit

Permalink
Fix and test PCRE error message getter. (#35728)
Browse files Browse the repository at this point in the history
  • Loading branch information
maleadt authored May 5, 2020
1 parent 6b53e02 commit 9c2492e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion base/pcre.jl
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ free_match_context(context) =
function err_message(errno)
buffer = Vector{UInt8}(undef, 256)
ccall((:pcre2_get_error_message_8, PCRE_LIB), Cvoid,
(Int32, Ptr{UInt8}, Csize_t), errno, buffer, sizeof(buffer))
(UInt32, Ptr{UInt8}, Csize_t), errno, buffer, sizeof(buffer))
GC.@preserve buffer unsafe_string(pointer(buffer))
end

Expand Down
3 changes: 3 additions & 0 deletions test/regex.jl
Original file line number Diff line number Diff line change
Expand Up @@ -139,4 +139,7 @@
# Test that PCRE throws the correct kind of error
# TODO: Uncomment this once the corresponding change has propagated to CI
#@test_throws ErrorException Base.PCRE.info(C_NULL, Base.PCRE.INFO_NAMECOUNT, UInt32)

# test that we can get the error message of negative error codes
@test Base.PCRE.err_message(Base.PCRE.ERROR_NOMEMORY) isa String
end

0 comments on commit 9c2492e

Please sign in to comment.