From 85ceec7c27be1387cb68ab17c05c4311a4fdffaf Mon Sep 17 00:00:00 2001 From: Nick Robinson Date: Sat, 17 Aug 2019 12:56:37 +0100 Subject: [PATCH] Revert "Remove `@test` from (un)lock! calls" This reverts commit b006f13c1c58bee2dbc0c5bd5734367a33f88bc6. --- test/runtests.jl | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index b70c9f3..89a27f6 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -33,7 +33,8 @@ end # Single-threaded @test rwlock.writer == false @test rwlock.readers == 0 for i = 1:NUM_LOCKS - lock!(rlock) + @test lock!(rlock) == nothing + # lock(rlock) @test rwlock.readers == i end end @@ -46,7 +47,7 @@ end # Single-threaded @test rwlock.writer == false @test rwlock.readers == NUM_LOCKS for i in NUM_LOCKS:-1:1 - unlock!(rlock) + @test unlock!(rlock) == nothing @test rwlock.readers == i - 1 end @test rwlock.readers == 0 @@ -69,12 +70,12 @@ end # Single-threaded @async begin @test rwlock.writer == false @test rwlock.readers == 0 - lock!(rlock) + @test lock!(wlock) == nothing @test rwlock.writer == true @test rwlock.readers == 0 @test take!(c) == :pretest put!(c, :prelock) - lock!(rlock) + @test lock!(wlock) == nothing # this code should never be reached @test take!(c) == :prelock @@ -100,12 +101,12 @@ end # Single-threaded @async begin @test rwlock.writer == false @test rwlock.readers == 0 - lock!(rlock) + @test lock!(wlock) == nothing @test rwlock.writer == true @test rwlock.readers == 0 @test take!(c) == :pretest put!(c, :preunlock) - unlock!(rlock) + @test unlock!(wlock) == nothing @test take!(c) == :preunlock put!(c, :postunlock) end @@ -132,12 +133,12 @@ end # Single-threaded @async begin @test rwlock.writer == false @test rwlock.readers == 0 - lock!(wlock) + @test lock!(wlock) == nothing @test rwlock.writer == true @test rwlock.readers == 0 @test take!(c) == :pretest put!(c, :prelock) - lock!(wlock) + @test lock!(rlock) == nothing # this code should never be reached @test take!(c) == :prelock @@ -164,12 +165,12 @@ end # Single-threaded @async begin @test rwlock.writer == false @test rwlock.readers == 0 - lock!(wlock) + @test lock!(rlock) == nothing @test rwlock.writer == false @test rwlock.readers == 1 @test take!(c) == :pretest put!(c, :prelock) - lock!(wlock) + @test lock!(wlock) == nothing # this code should never be reached @test take!(c) == :prelock