summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Kanis <kanis@comcard.de>2015-08-05 18:09:38 +0200
committerLars Kanis <kanis@comcard.de>2015-08-05 18:09:38 +0200
commit51713b76283ebe76d3d82aa2ac60c3737588dcac (patch)
treec316d8fab0445e0dae4bcf52abc7a1a1c52bc04a
parentc1f91d47806af07ed2c109eda67663c35165ffb4 (diff)
downloadffi-51713b76283ebe76d3d82aa2ac60c3737588dcac.tar.gz
Fix :blocking=>true test, so that it acctually fails on :blocking=>false.
-rw-r--r--spec/ffi/function_spec.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/spec/ffi/function_spec.rb b/spec/ffi/function_spec.rb
index ab08f35..c55259b 100644
--- a/spec/ffi/function_spec.rb
+++ b/spec/ffi/function_spec.rb
@@ -64,14 +64,14 @@ describe FFI::Function do
it 'can wrap a blocking function' do
fp = FFI::Function.new(:void, [ :int ], @libtest.find_function('testBlocking'), :blocking => true)
+ time = Time.now
threads = 10.times.map do |x|
Thread.new do
- time = Time.now
- fp.call(2)
- expect(Time.now - time).to be >= 2
+ fp.call(1)
end
end
threads.each { |t| t.join }
+ expect(Time.now - time).to be < 9 # 10 * 1 seconds - 1 second granularity
end
it 'autorelease flag is set to true by default' do