diff options
author | Alexey Melnichuk <alexeymelnichuck@gmail.com> | 2018-09-05 07:59:44 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-05 07:59:44 +0300 |
commit | 53adf5621d285952d6f56be889262127741c26cb (patch) | |
tree | 1d626db1933134cc1f127d526ad5cdb30a9775b0 /test/test_error.lua | |
parent | 00ca97711b657c7d395d91212364a82dac1d4625 (diff) | |
parent | d534bfc9586c1260d3255f949b7aa6f48511af3a (diff) | |
download | lua-llthreads2-53adf5621d285952d6f56be889262127741c26cb.tar.gz lua-llthreads2-53adf5621d285952d6f56be889262127741c26cb.tar.bz2 lua-llthreads2-53adf5621d285952d6f56be889262127741c26cb.zip |
Merge pull request #17 from osch/master
avoid NULL as parameter to fputs()
Diffstat (limited to 'test/test_error.lua')
-rw-r--r-- | test/test_error.lua | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/test/test_error.lua b/test/test_error.lua new file mode 100644 index 0000000..341105e --- /dev/null +++ b/test/test_error.lua | |||
@@ -0,0 +1,41 @@ | |||
1 | local llthreads = require"llthreads" | ||
2 | local utils = require "utils" | ||
3 | |||
4 | local include = utils.thread_init .. [[ | ||
5 | local llthreads = require"llthreads" | ||
6 | ]] | ||
7 | |||
8 | do | ||
9 | local thread = llthreads.new(include .. [[ | ||
10 | error({}) | ||
11 | ]]) | ||
12 | |||
13 | thread:start() | ||
14 | local ok, err = thread:join() | ||
15 | print(ok, err) | ||
16 | assert(not ok) | ||
17 | end | ||
18 | do | ||
19 | local thread = llthreads.new(include .. [[ | ||
20 | llthreads.set_logger(function(msg) print("XXX", msg) end) | ||
21 | error({}) | ||
22 | ]]) | ||
23 | |||
24 | thread:start() | ||
25 | local ok, err = thread:join() | ||
26 | print(ok, err) | ||
27 | assert(not ok) | ||
28 | end | ||
29 | do | ||
30 | local thread = llthreads.new(include .. [[ | ||
31 | llthreads.set_logger(function(msg) end) | ||
32 | error({}) | ||
33 | ]]) | ||
34 | |||
35 | thread:start() | ||
36 | local ok, err = thread:join() | ||
37 | print(ok, err) | ||
38 | assert(not ok) | ||
39 | end | ||
40 | print("Done!") | ||
41 | |||