From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from [87.239.111.99] (localhost [127.0.0.1]) by dev.tarantool.org (Postfix) with ESMTP id 803CA6EC5B; Tue, 30 Mar 2021 10:20:02 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 803CA6EC5B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tarantool.org; s=dev; t=1617088802; bh=0ndCM8esRA9IPQFNFGTMQ0EDoe28LduW6JLZ3OpVK+A=; h=Date:To:References:In-Reply-To:Subject:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=TAviuZPmcdvDQdNGlQ76VdYgVJZ0AVEk3rpKNVAJB7BBwv+tTxR8sTfum7sEcccSk 5zz1Oj2bjyTzCGy9Fy/o2kc2UAvmQtKBUhJWe7AtwyiXp9Fg42kqPadtR/oX9a2+pZ 5aL2KEFI/mOo5lfAAm2kWImPOPPimjkm8Zcl7qCM= Received: from mail-lj1-f182.google.com (mail-lj1-f182.google.com [209.85.208.182]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 5414C6EC5B for ; Tue, 30 Mar 2021 10:20:00 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 dev.tarantool.org 5414C6EC5B Received: by mail-lj1-f182.google.com with SMTP id f26so18743866ljp.8 for ; Tue, 30 Mar 2021 00:20:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=A9XN+nCVwSwB3C02xDZzZYoAMqp5e6vIql+HlZSff7c=; b=RQrCgzz9yj8D2PSnNw68MfzCPLMtm7fuImYN8h+/qJvSJZzApZQGQCQOoVjvnhKqBJ 4I42yw2TNHOKUADs59kIq3+ihDZMtDztYrbo+jTmOC9NsEFkJ98p6bErZ649mnkZEwqO Qovio0iQNZYfIh9Z6Hqqe5PFGTtegNaJT2ZsPIgDcPdOaCQhMZrXeiqBxxFR7xTTtYI4 2O9su4k6rJlgbD9yqOmiuXPyveDyjn72bImFAeGxzaaacL2eoev9Gwj3oqeH8/aCJONy TFe7OZxRSUGkeJ7FQlNiGbI1drXyaWGtO9KsXNmuI0oaddNB8Te+WntLTd7Wzu4O0GX9 uS8w== X-Gm-Message-State: AOAM53043/UsFY0D/YaPGgRxwxCp2aktJvpv1tQv5I6jmXJFINuN7vWM BAVzWIj1CbxMqqJK29crqFau43s25geI+A== X-Google-Smtp-Source: ABdhPJz3VcwhM8plVwBRkYAtmi/HPuDC49N+j2pzYskLRYQ6evlHsl41H9Sq9nImE71RmzLi8kAXvA== X-Received: by 2002:a2e:9c1:: with SMTP id 184mr20624656ljj.481.1617088798993; Tue, 30 Mar 2021 00:19:58 -0700 (PDT) Received: from grain.localdomain ([5.18.171.94]) by smtp.gmail.com with ESMTPSA id j18sm102310lfm.209.2021.03.30.00.19.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Mar 2021 00:19:57 -0700 (PDT) Received: by grain.localdomain (Postfix, from userid 1000) id 77A835601D4; Tue, 30 Mar 2021 10:19:56 +0300 (MSK) Date: Tue, 30 Mar 2021 10:19:56 +0300 To: Vladislav Shpilevoy Message-ID: References: <20210327111310.37504-1-gorcunov@gmail.com> <20210327111310.37504-3-gorcunov@gmail.com> <5195a08c-aaa7-7aa4-8324-352a9433955f@tarantool.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5195a08c-aaa7-7aa4-8324-352a9433955f@tarantool.org> User-Agent: Mutt/2.0.5 (2021-01-21) Subject: Re: [Tarantool-patches] [PATCH v6 2/3] test: add a test for wal_cleanup_delay option X-BeenThere: tarantool-patches@dev.tarantool.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Cyrill Gorcunov via Tarantool-patches Reply-To: Cyrill Gorcunov Cc: tml Errors-To: tarantool-patches-bounces@dev.tarantool.org Sender: "Tarantool-patches" On Tue, Mar 30, 2021 at 12:56:47AM +0200, Vladislav Shpilevoy wrote: > > > > Wait, I just don't understand. is_paused is a boolean type and > > I compare it with a boolean value. Could you simply point me > > the preferred way to compare if some particular value is false. > > I used assert() 'cause I found similar code, if there some more > > suiatble way to test the value, sure thing I can use whatever > > you prefer, just point me an example. > > Ok, I open the latest replication test we added (gh-5536), and > I see the line > > assert(box.space.test:count() == 10) > > It does not look like this: > > assert((box.space.test:count() == 10) == true) > > does it? Because it is pointless to have 'boolean' type in a This is because the count() is a numeric value. What had been there if 'count()' would return a boolean? > language if you do the manual comparison with the boolean > constants anyway. > > The same as in C you don't code like this: > > bool ok = func(); > if (ok == false) > error(); > > You do: > > bool ok = func(); > if (!ok) > error(); > I still don't get it. The examples I see is the following test/sql/checks.result:assert(box.space.TEST.ck_constraint.CK.is_enabled == false) test/sql/checks.result:assert(box.space.TEST.ck_constraint.CK.is_enabled == true) Vlad, lets move another way. I suspect there are 3 ways to compare 1) assert(is_paused == false) 2) assert(not is_paused) 3) is_running = not is_paused assert(is_running) so which of them I should use?