diff options
Diffstat (limited to 'tests/cancel.lua')
-rw-r--r-- | tests/cancel.lua | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/tests/cancel.lua b/tests/cancel.lua index 42ae839..d6c293d 100644 --- a/tests/cancel.lua +++ b/tests/cancel.lua | |||
@@ -38,7 +38,8 @@ if not next(which_tests) or which_tests.genlock then | |||
38 | 38 | ||
39 | -- check that cancelled lindas give cancel_error as they should | 39 | -- check that cancelled lindas give cancel_error as they should |
40 | linda:cancel() | 40 | linda:cancel() |
41 | assert( linda:get( "empty") == lanes.cancel_error) | 41 | local _status, _err = linda:get( "empty") |
42 | assert(_status == nil and _err == lanes.cancel_error) | ||
42 | assert( lanes.genlock( linda, "any", 1) == lanes.cancel_error) | 43 | assert( lanes.genlock( linda, "any", 1) == lanes.cancel_error) |
43 | assert( lanes.genatomic( linda, "any") == lanes.cancel_error) | 44 | assert( lanes.genatomic( linda, "any") == lanes.cancel_error) |
44 | 45 | ||
@@ -102,14 +103,14 @@ local laneBody = function( mode_, payload_) | |||
102 | io.stdout:write( " lane busy waiting ... ") | 103 | io.stdout:write( " lane busy waiting ... ") |
103 | for i = 1, payload_ do | 104 | for i = 1, payload_ do |
104 | -- force a non-jitable call | 105 | -- force a non-jitable call |
105 | local a = linda:get( "val") | 106 | local _, a = linda:get( "val") |
106 | a = a * 2 | 107 | a = a * 2 |
107 | end | 108 | end |
108 | print( "again?") | 109 | print( "again?") |
109 | elseif mode_ == "busy" then | 110 | elseif mode_ == "busy" then |
110 | -- busy wait mode in pure Lua code | 111 | -- busy wait mode in pure Lua code |
111 | io.stdout:write( " lane busy waiting ... ") | 112 | io.stdout:write( " lane busy waiting ... ") |
112 | local a = linda:get( "val") | 113 | local _, a = linda:get( "val") |
113 | for i = 1, payload_ do | 114 | for i = 1, payload_ do |
114 | a = a * 2 | 115 | a = a * 2 |
115 | a = math.sin( a) * math.sin( a) + math.cos( a) * math.cos( a) -- aka 1 | 116 | a = math.sin( a) * math.sin( a) + math.cos( a) * math.cos( a) -- aka 1 |