From patchwork Thu Feb 21 22:37:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= X-Patchwork-Id: 10824817 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D5CA9922 for ; Thu, 21 Feb 2019 22:38:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C75BD313D8 for ; Thu, 21 Feb 2019 22:38:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BBF55313DB; Thu, 21 Feb 2019 22:38:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7132C313D8 for ; Thu, 21 Feb 2019 22:38:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726381AbfBUWiO (ORCPT ); Thu, 21 Feb 2019 17:38:14 -0500 Received: from mail-wr1-f68.google.com ([209.85.221.68]:33879 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726074AbfBUWiO (ORCPT ); Thu, 21 Feb 2019 17:38:14 -0500 Received: by mail-wr1-f68.google.com with SMTP id f14so276418wrg.1 for ; Thu, 21 Feb 2019 14:38:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zYwhCnigIGvuKzgeqzXxmU3okoSOlqsYdlNMuROM5yA=; b=SWXoPqV1y6AyQHW4uuRDxEtrMn8VJEjw0bFWCzdHLZ6byj49KJT5oMbxGk4SYZlhOj /543WOiGInIpwfMU2dzXSljTGO6qA8P2+0sNGHlQAyhijNb46cclNIGuqBE0lyDJ21j1 0uN92lBri2sAtopwjw401F7Crl5PvFviicCnFYX99wQ9X8sidLVmP2D6MwdyuB8qJCEg w2R9F2JHSYLnyg1EvonpexmFWvSn4h4rlQhPID/RcdgpmgzX/GoQx1NII0THe6PO7JhH SGjqT/qOb3KT7e1QjVYaUZEILufzIfSW49sbSZA2At2p8/OiD/XYARwjvjMF302o44Hc 7P+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zYwhCnigIGvuKzgeqzXxmU3okoSOlqsYdlNMuROM5yA=; b=YQyrYwGKjJC9mvsYBa6t88ordAjpRmxw7OoJv5g8rShBM+tpb30yMKL1u9yS3bm6Ut 1Smr/0NwqbI+zWGWYYOTAF3+fO+tBgTC9TgLaHL4jPyxCbVaDEbY7aNA3Vquf7FlY+tq m64RNCJUXQ7/rVdEnkMKL45tGdrAk/VqbZWb9ogLBX1rPrQyxvbdcGNJYnd1zy13Pz/Z /07xDQw+JbuiIfzcE5sv8lo0FCK2XOndddGBnSQIvAK5B6hwOrRkWEOA+HEBBnsk4fua JY6Yix2Z22qkwBnK0TaP81GxlY+Hor09lU5hPahqCViUSrWdjFiwhwqpwC1rMcenyzjZ 2rDA== X-Gm-Message-State: AHQUAuaFKQRNcoe0OdTDVpJdHeVBdCI9I6eaDaQbTc7VgWAU+sxK8dmp ytVDpS3B+o/U0oj9ezpoolreBYNJ3Do= X-Google-Smtp-Source: AHgI3IY3PX0mPFVxB2+102Tfdc0svANQUDIguqF/XYABJ75VQNLuIXWqmx71Xn77vqKvXGr/D6Bpjg== X-Received: by 2002:adf:efc8:: with SMTP id i8mr588713wrp.164.1550788691801; Thu, 21 Feb 2019 14:38:11 -0800 (PST) Received: from vm.nix.is ([2a01:4f8:120:2468::2]) by smtp.gmail.com with ESMTPSA id v196sm110803wmf.15.2019.02.21.14.38.09 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Thu, 21 Feb 2019 14:38:09 -0800 (PST) From: =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= To: git@vger.kernel.org Cc: Junio C Hamano , Derrick Stolee , =?utf-8?b?w4Z2YXIgQXJuZmrDtnLDsCBCamFybWFzb24=?= Subject: [PATCH 2/8] commit-graph tests: test a graph that's too small Date: Thu, 21 Feb 2019 23:37:47 +0100 Message-Id: <20190221223753.20070-3-avarab@gmail.com> X-Mailer: git-send-email 2.21.0.rc0.258.g878e2cd30e In-Reply-To: <20190221223753.20070-1-avarab@gmail.com> References: <20190221223753.20070-1-avarab@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use the recently split-up components of the corrupt_graph_and_verify() function to assert that we error on graphs that are too small. The error was added in 2a2e32bdc5 ("commit-graph: implement git commit-graph read", 2018-04-10), but there was no test for it. Signed-off-by: Ævar Arnfjörð Bjarmason --- t/t5318-commit-graph.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/t/t5318-commit-graph.sh b/t/t5318-commit-graph.sh index 725b7ce51f..733be2ed30 100755 --- a/t/t5318-commit-graph.sh +++ b/t/t5318-commit-graph.sh @@ -399,6 +399,12 @@ corrupt_graph_and_verify() { } +test_expect_success 'detect too small' ' + corrupt_graph_setup && + echo "a small graph" >$objdir/info/commit-graph && + corrupt_graph_verify "too small" +' + test_expect_success 'detect bad signature' ' corrupt_graph_and_verify 0 "\0" \ "graph signature"