From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.1 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 4A21B1FAF0 for ; Sat, 10 Dec 2022 10:01:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1670666504; bh=5Son0H6dNFMTfbSUofpkXWDL8NTbIn+qpsA+3rOF5/s=; h=From:To:Subject:Date:In-Reply-To:References:From; b=NSOlzbNH6XSYyLd+pSyXOz/Bkgjbq7B/8L6hK8UAe6fwSnvlD1ZcXmL2uRkNbZR8q 1JMrjZpaOf8KF8GQ7Jvs3QbcjSdll0M6Sl4uCxf4wpB2p+0tSSlI6RDWI1uIAwIgEF xO+qX9pIOX63RfDRdho5VF4m4Y2mmWNer1EBGl28= From: Eric Wong To: mwrap-perl@80x24.org Subject: [PATCH 1/4] t/httpd-unit: extra test for fencepost errors Date: Sat, 10 Dec 2022 10:01:41 +0000 Message-Id: <20221210100144.19796-2-e@80x24.org> In-Reply-To: <20221210100144.19796-1-e@80x24.org> References: <20221210100144.19796-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: I'm terrible at this stuff :< --- t/httpd-unit.t | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/t/httpd-unit.t b/t/httpd-unit.t index 049d5fc..30d1717 100644 --- a/t/httpd-unit.t +++ b/t/httpd-unit.t @@ -95,4 +95,11 @@ open STDERR, '>', $err; isnt(system(@vg, $exe, "socket_dir:$s"), 0, "listen dir on socket fails"); like($end_err->(), qr/stat.*directory/, 'stat failure shown'); +# check for fencepost errors +my $len = 108 - length("$tmp"); +$len -= length("\0//$TEST_PID.sock"); +my $max = "$tmp/".('x'x$len); +is(system(@vg, $exe, "socket_dir:$max"), 0, "listen dir on max"); +isnt(system(@vg, $exe, "socket_dir:$max+"), 0, "listen dir too long"); + done_testing;