Skip to content

Commit

Permalink
Fix test_CheckLicense (#120)
Browse files Browse the repository at this point in the history
  • Loading branch information
odow authored Jun 12, 2024
1 parent c6f655b commit e2cf00f
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions test/C_API.jl
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,6 @@ function runtests()
end
end
end
if get(ENV, "CI", "false") == "true"
@testset "manual_test_CheckLicense" begin
# Calling this test twice seems to lead to segfaults, so test it
# only if we are running on CI.
# manual_test_CheckLicense()
end
end
return
end

Expand All @@ -40,9 +33,16 @@ function test_License_SetString()
return
end

function manual_test_CheckLicense()
@test PATHSolver.c_api_Path_CheckLicense(1, 1) == 1
@test PATHSolver.c_api_Path_CheckLicense(1_000, 1_000) == 0
function test_CheckLicense()
out_io = IOBuffer()
output_data = PATHSolver.OutputData(out_io)
output_interface = PATHSolver.OutputInterface(output_data)
GC.@preserve output_data output_interface begin
# The output_interface needs to be set before calling CheckLicense
PATHSolver.c_api_Output_SetInterface(output_interface)
@test PATHSolver.c_api_Path_CheckLicense(1, 1) == 1
@test PATHSolver.c_api_Path_CheckLicense(1_000, 1_000) == 0
end
n = 1_000
M = zeros(n, n)
for i in 1:n
Expand Down

0 comments on commit e2cf00f

Please sign in to comment.