From: Vladislav Shpilevoy via Tarantool-patches <tarantool-patches@dev.tarantool.org> To: Cyrill Gorcunov <gorcunov@gmail.com>, tml <tarantool-patches@dev.tarantool.org> Subject: Re: [Tarantool-patches] [PATCH v21 6/6] test: add box.lib test Date: Sun, 11 Apr 2021 17:43:02 +0200 [thread overview] Message-ID: <edaea916-5afa-9a5a-7b65-30df8859c493@tarantool.org> (raw) In-Reply-To: <YG9RJDOFFr3jeo4+@grain> Thanks for the patch! See below 4 comments, my diff in the end of the email, and on the branch in a separate commit. > diff --git a/test/box/lib.result b/test/box/lib.result > new file mode 100644 > index 000000000..2986df049 > --- /dev/null > +++ b/test/box/lib.result > @@ -0,0 +1,527 @@ <...> > + > +-- Cleanup new module data. > +new_cfunc_nop:unload() > + | --- > + | - true > + | ... > +new_cfunc_multireturn:unload() > + | --- > + | - true > + | ... > +new_cfunc_fetch_seq_evens:unload() > + | --- > + | - true > + | ... > +new_cfunc_args:unload() > + | --- > + | - true > + | ... > +new_cfunc_sum:unload() > + | --- > + | - true > + | ... > +new_module:unload() > + | --- > + | - true > + | ... > + > +-- Cleanup the generated symlink. > +_ = pcall(fio.unlink(cfunc_path)) > + | --- > + | ... > + > +-- Test double hashing: create function > +-- in box.schema.fun so that it should > +-- appear in box.lib hash. > +fio.symlink(cfunc3_path, cfunc_path) > + | --- > + | - true > + | ... > +box.schema.func.create('cfunc.cfunc_add', {language = "C"}) > + | --- > + | ... > +box.schema.user.grant('guest', 'execute', 'function', 'cfunc.cfunc_add') > + | --- > + | ... > +box.func['cfunc.cfunc_add']:call({1,2}) > + | --- > + | - 3 > + | ... > + > +old_module = box.lib.load('cfunc') > + | --- > + | ... > +assert(old_module['debug_refs'] == 3) -- box.lib + 2 box.schema.func 1. Why +2? There is only one function loaded from that module in box.schema.func. > + | --- > + | - true > + | ... > +old_func = old_module:load('cfunc_add') > + | --- > + | ... > +assert(old_module['debug_refs'] == 4) -- plus function instance > + | --- > + | - true > + | ... > +old_func(1,2) > + | --- > + | - 3 > + | ... > + > +-- Now update on disk and reload the module. > +_ = pcall(fio.unlink(cfunc_path)) > + | --- > + | ... > +fio.symlink(cfunc4_path, cfunc_path) > + | --- > + | - true > + | ... > + > +box.schema.func.reload("cfunc") > + | --- > + | ... > +box.func['cfunc.cfunc_add']:call({1,2}) > + | --- > + | - 13 > + | ... > + > +-- The box.lib instance should carry own > +-- references to the module and old > +-- function. And reloading must not > +-- affect old functions. Thus one for > +-- box.lib and one for box.lib function. 2. What do you mean "one for box.lib"? > +assert(old_module['debug_refs'] == 2) > + | --- > + | - true > + | ... > +old_func(1,2) > + | --- > + | - 3 > + | ... > +old_func:unload() > + | --- > + | - true > + | ... > +old_module:unload() > + | --- > + | - true > + | ... > + > +-- Same time the reload should update > +-- low level module cache, thus two > +-- for box and box function plus one 3. The same question. What is "for box"? What exactly keeps these references? > +-- new box.lib. > +new_module = box.lib.load('cfunc') > + | --- > + | ... > +assert(new_module['debug_refs'] == 3) > + | --- > + | - true > + | ... > + 4. In the previous review I asked you to add tests for automatic unload via GC. Please, add them. You can use collectgarbage('collect') functions, and setmetatable(..., {__mode = 'v'}) if it will help with anything. See below my review fixes and on the branch in a separate commit. ==================== diff --git a/test/box/cfunc1.c b/test/box/cfunc1.c index f6829372a..2ab0e8d78 100644 --- a/test/box/cfunc1.c +++ b/test/box/cfunc1.c @@ -1,7 +1,3 @@ -#include <stdio.h> -#include <stdbool.h> -#include <msgpuck.h> - #include "module.h" /* @@ -15,44 +11,17 @@ int cfunc_nop(box_function_ctx_t *ctx, const char *args, const char *args_end) { - (void)ctx; - (void)args; - (void)args_end; - return 0; -} - -int -cfunc_fetch_seq_evens(box_function_ctx_t *ctx, const char *args, const char *args_end) -{ - (void)ctx; - (void)args; - (void)args_end; - return 0; -} - -int -cfunc_multireturn(box_function_ctx_t *ctx, const char *args, const char *args_end) -{ - (void)ctx; - (void)args; - (void)args_end; return 0; } int -cfunc_args(box_function_ctx_t *ctx, const char *args, const char *args_end) +cfunc_echo(box_function_ctx_t *ctx, const char *args, const char *args_end) { - (void)ctx; - (void)args; - (void)args_end; return 0; } int cfunc_sum(box_function_ctx_t *ctx, const char *args, const char *args_end) { - (void)ctx; - (void)args; - (void)args_end; return 0; } diff --git a/test/box/cfunc2.c b/test/box/cfunc2.c index 8c583e993..6de40b866 100644 --- a/test/box/cfunc2.c +++ b/test/box/cfunc2.c @@ -1,7 +1,6 @@ -#include <stdio.h> -#include <stdbool.h> -#include <msgpuck.h> ==================== As I said earlier, for non-system headers we use "", not <>. ==================== +#include <stdlib.h> +#include "msgpuck.h" #include "module.h" /* @@ -10,9 +9,6 @@ int cfunc_nop(box_function_ctx_t *ctx, const char *args, const char *args_end) { - (void)ctx; - (void)args; - (void)args_end; return 0; } @@ -21,99 +17,22 @@ cfunc_nop(box_function_ctx_t *ctx, const char *args, const char *args_end) * arguments is not screwed). */ int -cfunc_fetch_seq_evens(box_function_ctx_t *ctx, const char *args, const char *args_end) -{ ==================== After more thinkning I still couldn't find a reason why this function has to be so complex. Why not solve an integral equation then? Or calculcate Fibonachi numbers? For your purpose a simple 'echo' function would solve both the arguments sanity check, and the miltireturn check. ==================== - int arg_count = mp_decode_array(&args); - if (arg_count != 1) { - return box_error_set(__FILE__, __LINE__, ER_PROC_C, "%s", - "invalid argument count"); - } - int field_count = mp_decode_array(&args); - if (field_count < 1) { - return box_error_set(__FILE__, __LINE__, ER_PROC_C, "%s", - "invalid array size"); - } - - /* - * We expect even numbers sequence here. The idea is - * to test invalid data an issue an error from inside - * of C function. - */ - for (int i = 1; i <= field_count; i++) { - int val = mp_decode_uint(&args); - int needed = 2 * i; - if (val != needed) { - char res[128]; - snprintf(res, sizeof(res), "%s %d != %d", - "invalid argument", val, needed); - return box_error_set(__FILE__, __LINE__, - ER_PROC_C, "%s", res); - } - } - - return 0; -} - -/* - * Return one element array twice. - */ -int -cfunc_multireturn(box_function_ctx_t *ctx, const char *args, const char *args_end) -{ - char tuple_buf[512]; - char *d = tuple_buf; - d = mp_encode_array(d, 1); - d = mp_encode_uint(d, 1); - assert(d <= tuple_buf + sizeof(tuple_buf)); - - box_tuple_format_t *fmt = box_tuple_format_default(); - box_tuple_t *tuple_a = box_tuple_new(fmt, tuple_buf, d); - if (tuple_a == NULL) - return -1; - int rc = box_return_tuple(ctx, tuple_a); - if (rc == 0) - return box_return_tuple(ctx, tuple_a); - return rc; -} - -/* - * Encode int + string pair back. - */ -int -cfunc_args(box_function_ctx_t *ctx, const char *args, const char *args_end) +cfunc_echo(box_function_ctx_t *ctx, const char *args, const char *args_end) { + const char *pos = args; + if (mp_check(&pos, args_end) != 0) + abort(); + if (mp_typeof(*args) != MP_ARRAY) + abort(); uint32_t arg_count = mp_decode_array(&args); - if (arg_count != 2) { - return box_error_set(__FILE__, __LINE__, ER_PROC_C, "%s", - "invalid argument count"); + for (uint32_t i = 0; i < arg_count; ++i) { + pos = args; + mp_next(&pos); + if (box_return_mp(ctx, args, pos) != 0) + return -1; + args = pos; } - - if (mp_typeof(*args) != MP_UINT) { - return box_error_set(__FILE__, __LINE__, ER_PROC_C, "%s", - "tuple field must be uint"); - } - uint32_t num = mp_decode_uint(&args); - - if (mp_typeof(*args) != MP_STR) { - return box_error_set(__FILE__, __LINE__, ER_PROC_C, "%s", - "tuple field must be string"); - } - const char *str = args; - uint32_t len = mp_decode_strl(&str); - - char tuple_buf[512]; - char *d = tuple_buf; - d = mp_encode_array(d, 2); - d = mp_encode_uint(d, num); - d = mp_encode_str(d, str, len); - assert(d <= tuple_buf + sizeof(tuple_buf)); - - box_tuple_format_t *fmt = box_tuple_format_default(); - box_tuple_t *tuple = box_tuple_new(fmt, tuple_buf, d); - if (tuple == NULL) - return -1; - - return box_return_tuple(ctx, tuple); + return 0; } /* diff --git a/test/box/cfunc3.c b/test/box/cfunc3.c index 668790fbf..71fe2717a 100644 --- a/test/box/cfunc3.c +++ b/test/box/cfunc3.c @@ -1,7 +1,4 @@ -#include <stdio.h> -#include <stdbool.h> -#include <msgpuck.h> - +#include "msgpuck.h" #include "module.h" /* diff --git a/test/box/cfunc4.c b/test/box/cfunc4.c index cc079b335..a03a23026 100644 --- a/test/box/cfunc4.c +++ b/test/box/cfunc4.c @@ -1,7 +1,4 @@ -#include <stdio.h> -#include <stdbool.h> #include <msgpuck.h> - #include "module.h" /* diff --git a/test/box/lib.result b/test/box/lib.result index 2986df049..58acb9c06 100644 --- a/test/box/lib.result +++ b/test/box/lib.result @@ -82,19 +82,13 @@ assert(old_module['debug_refs'] == 1) old_cfunc_nop = old_module:load('cfunc_nop') | --- | ... -old_cfunc_fetch_seq_evens = old_module:load('cfunc_fetch_seq_evens') - | --- - | ... -old_cfunc_multireturn = old_module:load('cfunc_multireturn') - | --- - | ... -old_cfunc_args = old_module:load('cfunc_args') +old_cfunc_echo = old_module:load('cfunc_echo') | --- | ... old_cfunc_sum = old_module:load('cfunc_sum') | --- | ... -assert(old_module['debug_refs'] == 6) +assert(old_module['debug_refs'] == 4) | --- | - true | ... @@ -112,13 +106,7 @@ assert(err ~= nil) old_cfunc_nop() | --- | ... -old_cfunc_fetch_seq_evens() - | --- - | ... -old_cfunc_multireturn() - | --- - | ... -old_cfunc_args() +old_cfunc_echo() | --- | ... old_cfunc_sum() @@ -133,20 +121,14 @@ old_module:unload() | - true | ... -- Test refs via function name. -assert(old_cfunc_nop['debug_module_refs'] == 5) +assert(old_cfunc_nop['debug_module_refs'] == 3) | --- | - true | ... old_cfunc_nop() | --- | ... -old_cfunc_fetch_seq_evens() - | --- - | ... -old_cfunc_multireturn() - | --- - | ... -old_cfunc_args() +old_cfunc_echo() | --- | ... old_cfunc_sum() @@ -170,15 +152,7 @@ old_cfunc_nop:unload() | --- | - true | ... -old_cfunc_fetch_seq_evens:unload() - | --- - | - true - | ... -old_cfunc_multireturn:unload() - | --- - | - true - | ... -old_cfunc_args:unload() +old_cfunc_echo:unload() | --- | - true | ... @@ -239,13 +213,7 @@ assert(old_module_ptr ~= new_module_ptr) old_cfunc_nop = old_module:load('cfunc_nop') | --- | ... -old_cfunc_fetch_seq_evens = old_module:load('cfunc_fetch_seq_evens') - | --- - | ... -old_cfunc_multireturn = old_module:load('cfunc_multireturn') - | --- - | ... -old_cfunc_args = old_module:load('cfunc_args') +old_cfunc_echo = old_module:load('cfunc_echo') | --- | ... old_cfunc_sum = old_module:load('cfunc_sum') @@ -255,15 +223,7 @@ assert(old_cfunc_nop['debug_module_ptr'] == old_module_ptr) | --- | - true | ... -assert(old_cfunc_fetch_seq_evens['debug_module_ptr'] == old_module_ptr) - | --- - | - true - | ... -assert(old_cfunc_multireturn['debug_module_ptr'] == old_module_ptr) - | --- - | - true - | ... -assert(old_cfunc_args['debug_module_ptr'] == old_module_ptr) +assert(old_cfunc_echo['debug_module_ptr'] == old_module_ptr) | --- | - true | ... @@ -271,7 +231,7 @@ assert(old_cfunc_sum['debug_module_ptr'] == old_module_ptr) | --- | - true | ... -assert(old_module['debug_refs'] == 6) +assert(old_module['debug_refs'] == 4) | --- | - true | ... @@ -280,13 +240,7 @@ assert(old_module['debug_refs'] == 6) new_cfunc_nop = new_module:load('cfunc_nop') | --- | ... -new_cfunc_fetch_seq_evens = new_module:load('cfunc_fetch_seq_evens') - | --- - | ... -new_cfunc_multireturn = new_module:load('cfunc_multireturn') - | --- - | ... -new_cfunc_args = new_module:load('cfunc_args') +new_cfunc_echo = new_module:load('cfunc_echo') | --- | ... new_cfunc_sum = new_module:load('cfunc_sum') @@ -296,15 +250,7 @@ assert(new_cfunc_nop['debug_module_ptr'] == new_module_ptr) | --- | - true | ... -assert(new_cfunc_fetch_seq_evens['debug_module_ptr'] == new_module_ptr) - | --- - | - true - | ... -assert(new_cfunc_multireturn['debug_module_ptr'] == new_module_ptr) - | --- - | - true - | ... -assert(new_cfunc_args['debug_module_ptr'] == new_module_ptr) +assert(new_cfunc_echo['debug_module_ptr'] == new_module_ptr) | --- | - true | ... @@ -312,7 +258,7 @@ assert(new_cfunc_sum['debug_module_ptr'] == new_module_ptr) | --- | - true | ... -assert(new_module['debug_refs'] == 6) +assert(new_module['debug_refs'] == 4) | --- | - true | ... @@ -321,13 +267,7 @@ assert(new_module['debug_refs'] == 6) old_cfunc_nop() | --- | ... -old_cfunc_fetch_seq_evens() - | --- - | ... -old_cfunc_multireturn() - | --- - | ... -old_cfunc_args() +old_cfunc_echo() | --- | ... old_cfunc_sum() @@ -338,27 +278,21 @@ old_cfunc_sum() new_cfunc_nop() | --- | ... -new_cfunc_multireturn() +new_cfunc_echo({1, 2, 3}) | --- - | - [1] - | - [1] + | - [1, 2, 3] | ... -new_cfunc_fetch_seq_evens({2,4,6}) +new_cfunc_echo(1, 2, 3) | --- - | ... -new_cfunc_fetch_seq_evens({1,2,3}) -- error, odd numbers sequence - | --- - | - error: invalid argument 1 != 2 - | ... -new_cfunc_args(1, "hello") - | --- - | - [1, 'hello'] + | - 1 + | - 2 + | - 3 | ... new_cfunc_sum(1) -- error, one arg passed | --- | - error: invalid argument count | ... -new_cfunc_sum(1,2) +new_cfunc_sum(1, 2) | --- | - 3 | ... @@ -368,15 +302,7 @@ old_cfunc_nop:unload() | --- | - true | ... -old_cfunc_fetch_seq_evens:unload() - | --- - | - true - | ... -old_cfunc_multireturn:unload() - | --- - | - true - | ... -old_cfunc_args:unload() +old_cfunc_echo:unload() | --- | - true | ... @@ -394,15 +320,7 @@ new_cfunc_nop:unload() | --- | - true | ... -new_cfunc_multireturn:unload() - | --- - | - true - | ... -new_cfunc_fetch_seq_evens:unload() - | --- - | - true - | ... -new_cfunc_args:unload() +new_cfunc_echo:unload() | --- | - true | ... @@ -433,7 +351,7 @@ box.schema.func.create('cfunc.cfunc_add', {language = "C"}) box.schema.user.grant('guest', 'execute', 'function', 'cfunc.cfunc_add') | --- | ... -box.func['cfunc.cfunc_add']:call({1,2}) +box.func['cfunc.cfunc_add']:call({1, 2}) | --- | - 3 | ... @@ -452,7 +370,7 @@ assert(old_module['debug_refs'] == 4) -- plus function instance | --- | - true | ... -old_func(1,2) +old_func(1, 2) | --- | - 3 | ... @@ -469,7 +387,7 @@ fio.symlink(cfunc4_path, cfunc_path) box.schema.func.reload("cfunc") | --- | ... -box.func['cfunc.cfunc_add']:call({1,2}) +box.func['cfunc.cfunc_add']:call({1, 2}) | --- | - 13 | ... @@ -483,7 +401,7 @@ assert(old_module['debug_refs'] == 2) | --- | - true | ... -old_func(1,2) +old_func(1, 2) | --- | - 3 | ... @@ -509,7 +427,7 @@ assert(new_module['debug_refs'] == 3) | ... -- Box function should carry own module. -box.func['cfunc.cfunc_add']:call({1,2}) +box.func['cfunc.cfunc_add']:call({1, 2}) | --- | - 13 | ... diff --git a/test/box/lib.test.lua b/test/box/lib.test.lua index 387c813c4..e0e4b9e4d 100644 --- a/test/box/lib.test.lua +++ b/test/box/lib.test.lua @@ -32,11 +32,9 @@ assert(old_module_copy['debug_refs'] == 2) old_module_copy:unload() assert(old_module['debug_refs'] == 1) old_cfunc_nop = old_module:load('cfunc_nop') -old_cfunc_fetch_seq_evens = old_module:load('cfunc_fetch_seq_evens') -old_cfunc_multireturn = old_module:load('cfunc_multireturn') -old_cfunc_args = old_module:load('cfunc_args') +old_cfunc_echo = old_module:load('cfunc_echo') old_cfunc_sum = old_module:load('cfunc_sum') -assert(old_module['debug_refs'] == 6) +assert(old_module['debug_refs'] == 4) -- Test for error on nonexisting function. _, err = pcall(old_module.load, old_module, 'no-such-func') @@ -44,9 +42,7 @@ assert(err ~= nil) -- Make sure they all are callable. old_cfunc_nop() -old_cfunc_fetch_seq_evens() -old_cfunc_multireturn() -old_cfunc_args() +old_cfunc_echo() old_cfunc_sum() -- Unload the module but keep old functions alive, so @@ -54,11 +50,9 @@ old_cfunc_sum() -- and still callable. old_module:unload() -- Test refs via function name. -assert(old_cfunc_nop['debug_module_refs'] == 5) +assert(old_cfunc_nop['debug_module_refs'] == 3) old_cfunc_nop() -old_cfunc_fetch_seq_evens() -old_cfunc_multireturn() -old_cfunc_args() +old_cfunc_echo() old_cfunc_sum() -- The module is unloaded I should not be able @@ -69,9 +63,7 @@ old_module:unload() -- Clean old functions. old_cfunc_nop:unload() -old_cfunc_fetch_seq_evens:unload() -old_cfunc_multireturn:unload() -old_cfunc_args:unload() +old_cfunc_echo:unload() assert(old_cfunc_sum['debug_module_refs'] == 1) old_cfunc_sum:unload() @@ -96,59 +88,43 @@ assert(old_module_ptr ~= new_module_ptr) -- All functions from old module should be loadable. old_cfunc_nop = old_module:load('cfunc_nop') -old_cfunc_fetch_seq_evens = old_module:load('cfunc_fetch_seq_evens') -old_cfunc_multireturn = old_module:load('cfunc_multireturn') -old_cfunc_args = old_module:load('cfunc_args') +old_cfunc_echo = old_module:load('cfunc_echo') old_cfunc_sum = old_module:load('cfunc_sum') assert(old_cfunc_nop['debug_module_ptr'] == old_module_ptr) -assert(old_cfunc_fetch_seq_evens['debug_module_ptr'] == old_module_ptr) -assert(old_cfunc_multireturn['debug_module_ptr'] == old_module_ptr) -assert(old_cfunc_args['debug_module_ptr'] == old_module_ptr) +assert(old_cfunc_echo['debug_module_ptr'] == old_module_ptr) assert(old_cfunc_sum['debug_module_ptr'] == old_module_ptr) -assert(old_module['debug_refs'] == 6) +assert(old_module['debug_refs'] == 4) -- Lookup for updated symbols. new_cfunc_nop = new_module:load('cfunc_nop') -new_cfunc_fetch_seq_evens = new_module:load('cfunc_fetch_seq_evens') -new_cfunc_multireturn = new_module:load('cfunc_multireturn') -new_cfunc_args = new_module:load('cfunc_args') +new_cfunc_echo = new_module:load('cfunc_echo') new_cfunc_sum = new_module:load('cfunc_sum') assert(new_cfunc_nop['debug_module_ptr'] == new_module_ptr) -assert(new_cfunc_fetch_seq_evens['debug_module_ptr'] == new_module_ptr) -assert(new_cfunc_multireturn['debug_module_ptr'] == new_module_ptr) -assert(new_cfunc_args['debug_module_ptr'] == new_module_ptr) +assert(new_cfunc_echo['debug_module_ptr'] == new_module_ptr) assert(new_cfunc_sum['debug_module_ptr'] == new_module_ptr) -assert(new_module['debug_refs'] == 6) +assert(new_module['debug_refs'] == 4) -- Call old functions. old_cfunc_nop() -old_cfunc_fetch_seq_evens() -old_cfunc_multireturn() -old_cfunc_args() +old_cfunc_echo() old_cfunc_sum() -- Call new functions. new_cfunc_nop() -new_cfunc_multireturn() -new_cfunc_fetch_seq_evens({2,4,6}) -new_cfunc_fetch_seq_evens({1,2,3}) -- error, odd numbers sequence -new_cfunc_args(1, "hello") +new_cfunc_echo({1, 2, 3}) +new_cfunc_echo(1, 2, 3) new_cfunc_sum(1) -- error, one arg passed -new_cfunc_sum(1,2) +new_cfunc_sum(1, 2) -- Cleanup old module's functions. old_cfunc_nop:unload() -old_cfunc_fetch_seq_evens:unload() -old_cfunc_multireturn:unload() -old_cfunc_args:unload() +old_cfunc_echo:unload() old_cfunc_sum:unload() old_module:unload() -- Cleanup new module data. new_cfunc_nop:unload() -new_cfunc_multireturn:unload() -new_cfunc_fetch_seq_evens:unload() -new_cfunc_args:unload() +new_cfunc_echo:unload() new_cfunc_sum:unload() new_module:unload() @@ -161,20 +137,20 @@ _ = pcall(fio.unlink(cfunc_path)) fio.symlink(cfunc3_path, cfunc_path) box.schema.func.create('cfunc.cfunc_add', {language = "C"}) box.schema.user.grant('guest', 'execute', 'function', 'cfunc.cfunc_add') -box.func['cfunc.cfunc_add']:call({1,2}) +box.func['cfunc.cfunc_add']:call({1, 2}) old_module = box.lib.load('cfunc') assert(old_module['debug_refs'] == 3) -- box.lib + 2 box.schema.func old_func = old_module:load('cfunc_add') assert(old_module['debug_refs'] == 4) -- plus function instance -old_func(1,2) +old_func(1, 2) -- Now update on disk and reload the module. _ = pcall(fio.unlink(cfunc_path)) fio.symlink(cfunc4_path, cfunc_path) box.schema.func.reload("cfunc") -box.func['cfunc.cfunc_add']:call({1,2}) +box.func['cfunc.cfunc_add']:call({1, 2}) -- The box.lib instance should carry own -- references to the module and old @@ -182,7 +158,7 @@ box.func['cfunc.cfunc_add']:call({1,2}) -- affect old functions. Thus one for -- box.lib and one for box.lib function. assert(old_module['debug_refs'] == 2) -old_func(1,2) +old_func(1, 2) old_func:unload() old_module:unload() @@ -194,7 +170,7 @@ new_module = box.lib.load('cfunc') assert(new_module['debug_refs'] == 3) -- Box function should carry own module. -box.func['cfunc.cfunc_add']:call({1,2}) +box.func['cfunc.cfunc_add']:call({1, 2}) -- Cleanup. _ = pcall(fio.unlink(cfunc_path))
next prev parent reply other threads:[~2021-04-11 15:43 UTC|newest] Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-04-08 16:41 [Tarantool-patches] [PATCH v21 0/6] box: implement box.lib Lua module Cyrill Gorcunov via Tarantool-patches 2021-04-08 16:41 ` [Tarantool-patches] [PATCH v21 1/6] box/func: fix modules functions restore Cyrill Gorcunov via Tarantool-patches 2021-04-09 23:31 ` Vladislav Shpilevoy via Tarantool-patches 2021-04-10 15:02 ` Cyrill Gorcunov via Tarantool-patches 2021-04-08 16:41 ` [Tarantool-patches] [PATCH v21 2/6] box/func: module_reload -- drop redundant argument Cyrill Gorcunov via Tarantool-patches 2021-04-08 16:41 ` [Tarantool-patches] [PATCH v21 3/6] box/module_cache: introduce modules subsystem Cyrill Gorcunov via Tarantool-patches 2021-04-09 23:54 ` Vladislav Shpilevoy via Tarantool-patches 2021-04-10 14:59 ` Cyrill Gorcunov via Tarantool-patches 2021-04-08 16:41 ` [Tarantool-patches] [PATCH v21 4/6] box/schema.func: switch to new module api Cyrill Gorcunov via Tarantool-patches 2021-04-09 23:55 ` Vladislav Shpilevoy via Tarantool-patches 2021-04-10 15:00 ` Cyrill Gorcunov via Tarantool-patches 2021-04-08 16:41 ` [Tarantool-patches] [PATCH v21 5/6] box: implement box.lib module Cyrill Gorcunov via Tarantool-patches 2021-04-11 15:38 ` Vladislav Shpilevoy via Tarantool-patches 2021-04-11 22:38 ` Cyrill Gorcunov via Tarantool-patches 2021-04-12 22:08 ` Vladislav Shpilevoy via Tarantool-patches 2021-04-12 22:34 ` Cyrill Gorcunov via Tarantool-patches 2021-04-08 16:41 ` [Tarantool-patches] [PATCH v21 6/6] test: add box.lib test Cyrill Gorcunov via Tarantool-patches 2021-04-08 18:53 ` Cyrill Gorcunov via Tarantool-patches 2021-04-11 15:43 ` Vladislav Shpilevoy via Tarantool-patches [this message] 2021-04-11 21:56 ` Cyrill Gorcunov via Tarantool-patches 2021-04-11 22:36 ` Cyrill Gorcunov via Tarantool-patches 2021-04-12 22:08 ` Vladislav Shpilevoy via Tarantool-patches 2021-04-13 7:10 ` Cyrill Gorcunov via Tarantool-patches 2021-04-13 21:53 ` [Tarantool-patches] [PATCH v21 0/6] box: implement box.lib Lua module Vladislav Shpilevoy via Tarantool-patches 2021-04-14 8:07 ` Kirill Yukhin via Tarantool-patches
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=edaea916-5afa-9a5a-7b65-30df8859c493@tarantool.org \ --to=tarantool-patches@dev.tarantool.org \ --cc=gorcunov@gmail.com \ --cc=v.shpilevoy@tarantool.org \ --subject='Re: [Tarantool-patches] [PATCH v21 6/6] test: add box.lib test' \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox