From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id BBD866DE0F9A for ; Sun, 5 May 2019 03:49:21 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.034 X-Spam-Level: X-Spam-Status: No, score=-0.034 tagged_above=-999 required=5 tests=[AWL=-0.033, SPF_PASS=-0.001] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id eBCQy4EGInMv for ; Sun, 5 May 2019 03:49:20 -0700 (PDT) Received: from fethera.tethera.net (fethera.tethera.net [198.245.60.197]) by arlo.cworth.org (Postfix) with ESMTPS id B2BFE6DE0F4F for ; Sun, 5 May 2019 03:49:20 -0700 (PDT) Received: from remotemail by fethera.tethera.net with local (Exim 4.89) (envelope-from ) id 1hNEhp-0000XB-GM; Sun, 05 May 2019 06:49:17 -0400 Received: (nullmailer pid 24459 invoked by uid 1000); Sun, 05 May 2019 10:49:16 -0000 From: David Bremner To: Tomi Ollila , Rob Browning , notmuch@notmuchmail.org Subject: Re: [PATCH 1/2] test/raw: add some messages likely to be multiples of buffer size In-Reply-To: References: <20190428162906.20062-3-david@tethera.net> <20190505001027.28627-1-david@tethera.net> <20190505001027.28627-2-david@tethera.net> Date: Sun, 05 May 2019 07:49:16 -0300 Message-ID: <875zqpgor7.fsf@tethera.net> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 05 May 2019 10:49:21 -0000 Tomi Ollila writes: > On Sun, May 05 2019, Tomi Ollila wrote: > >> On Sat, May 04 2019, David Bremner wrote: >> >>> >>> +test_python <>> +from email.message import EmailMessage >>> +for pow in range(12,21): >> >> .......................^ space. i.e. (12, 21) >> >> from 4KiB to 1MiB. uh, perhaps I should have kept my fingers crossed. >> (that said, my range would have been 10, 17 (1024 - 65536)) > > except that... > > if fread(3) (and friends) used 1024 byte buffer, for 4096 byte message > it would read full buffer 4 times (and not yet noticing EOF), and then > next fread() would return 0 (and now flag EOF)... I originally started from a 1024 byte message, but it was a bit messy to mark some sizes as broken and others not. Perhaps that's not a good reason in retrospect, since the the fact that >= 4096 is broken is specific to some libc (and kernel?). This means that if someome has a libc where the buffer size is bigger then 4096, this test might return non-zero. My take away from that is that I should probably squash these two commits into one. d