diff options
author | Benoit Germain <benoit.germain@ubisoft.com> | 2024-06-14 16:55:17 +0200 |
---|---|---|
committer | Benoit Germain <benoit.germain@ubisoft.com> | 2024-06-14 16:55:17 +0200 |
commit | 28ffb99fe2d9a4df1c60d35a39de47992076167f (patch) | |
tree | 8b7dfe0962ef8a736b7bc078979d2bd15f3fc303 | |
parent | e3f3288597dc62c9c26d89f92e396bc3abf4b408 (diff) | |
download | lanes-28ffb99fe2d9a4df1c60d35a39de47992076167f.tar.gz lanes-28ffb99fe2d9a4df1c60d35a39de47992076167f.tar.bz2 lanes-28ffb99fe2d9a4df1c60d35a39de47992076167f.zip |
Fix deeptest.lua
-rw-r--r-- | deep_test/deeptest.lua | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/deep_test/deeptest.lua b/deep_test/deeptest.lua index bab91d9..1c34cf8 100644 --- a/deep_test/deeptest.lua +++ b/deep_test/deeptest.lua | |||
@@ -74,7 +74,9 @@ local performTest = function( obj_) | |||
74 | l:set( "key", obj_, t) | 74 | l:set( "key", obj_, t) |
75 | -- when obj_ is a deep userdata, out is the same userdata as obj_ (not another one pointing on the same deep memory block) because of an internal cache table [deep*] -> proxy) | 75 | -- when obj_ is a deep userdata, out is the same userdata as obj_ (not another one pointing on the same deep memory block) because of an internal cache table [deep*] -> proxy) |
76 | -- when obj_ is a clonable userdata, we get a different clone everytime we cross a linda or lane barrier | 76 | -- when obj_ is a clonable userdata, we get a different clone everytime we cross a linda or lane barrier |
77 | printDeep( "out of linda:", l:get( "key", 2)) | 77 | local _n, _val1, _val2 = l:get( "key", 2) |
78 | assert(_n == (_val2 and 2 or 1)) | ||
79 | printDeep( "out of linda:", _val1, _val2) | ||
78 | 80 | ||
79 | -- send the object in a lane through parameter passing, the lane body returns it as return value, read the contents | 81 | -- send the object in a lane through parameter passing, the lane body returns it as return value, read the contents |
80 | local g = lanes.gen( | 82 | local g = lanes.gen( |
@@ -88,7 +90,9 @@ local performTest = function( obj_) | |||
88 | -- read contents inside lane: obj_ and t by upvalue | 90 | -- read contents inside lane: obj_ and t by upvalue |
89 | printDeep( "in lane, as upvalues:", obj_, t) | 91 | printDeep( "in lane, as upvalues:", obj_, t) |
90 | -- read contents inside lane: in linda | 92 | -- read contents inside lane: in linda |
91 | printDeep( "in lane, from linda:", l:get("key", 2)) | 93 | local _n, _val1, _val2 = l:get( "key", 2) |
94 | assert(_n == (_val2 and 2 or 1)) | ||
95 | printDeep( "in lane, from linda:", _val1, _val2) | ||
92 | return arg_, t_ | 96 | return arg_, t_ |
93 | end | 97 | end |
94 | ) | 98 | ) |