From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp60.i.mail.ru (smtp60.i.mail.ru [217.69.128.40]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id EC072469719 for ; Fri, 16 Oct 2020 00:37:46 +0300 (MSK) Date: Fri, 16 Oct 2020 00:38:06 +0300 From: Alexander Turenko Message-ID: <20201015213806.gfujc6qpd4utizf3@tkn_work_nb> References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Subject: Re: [Tarantool-patches] [PATCH 2.X v4 1/4] module api: export box_tuple_validate List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Timur Safin Cc: tarantool-patches@dev.tarantool.org, v.shpilevoy@tarantool.org LGTM for the patch. Just few notes, feel free to ignore. > +/* > + * Validate tuple with format of single boolean field > + */ Nits: /* -> /**; period at the end. > +static int > +test_tuple_validate_formatted(lua_State *L) > +{ > + int valid = 0; > + box_tuple_t *tuple = luaT_istuple(L, -1); > + > + if (tuple != NULL) { > + uint32_t fields[] = { 0 }; > + uint32_t types[] = { FIELD_TYPE_BOOLEAN }; > + box_key_def_t *key_defs[] = { > + box_key_def_new(fields, types, 1) > + }; > + assert(key_defs[0] != NULL); > + struct tuple_format *format = > + box_tuple_format_new(key_defs, 1); > + assert(format); > + > + valid = box_tuple_validate(tuple, format) == 0; Nit: I would call box_tuple_format_unref() and box_key_def_delete(). I know, it is just test, so you can ignore this comment. I'm personally a bit afraid of using bad patterns without a proper comment even in tests. What if someone will copy it somewhere..?