From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-3.6 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI,RCVD_IN_SORBS_SPAM, RP_MATCHES_RCVD shortcircuit=no autolearn=no autolearn_force=no version=3.4.0 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id BBAF12027C for ; Thu, 1 Jun 2017 08:22:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751363AbdFAIWN (ORCPT ); Thu, 1 Jun 2017 04:22:13 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:34747 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751294AbdFAIWK (ORCPT ); Thu, 1 Jun 2017 04:22:10 -0400 Received: by mail-wm0-f68.google.com with SMTP id d127so9276851wmf.1 for ; Thu, 01 Jun 2017 01:22:09 -0700 (PDT) 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; bh=v+xfbbVoOjF+S1W8inBt7UaDDyM9cwPXO6S+VvhteMw=; b=QEokdmxli+HP9gXsQybIBynzKDMOChw04PGRRTT56d32qLOKnpYrdSTp/pKGrG/qS6 RWrRf6Rt/hSDOrfHir2QFqR8B6NsuEDyP4o68zi5HRVfKR8j6mMf49SLkK4J3T9CbcrH pk72nWY73XCg04UeZulVe/U9SInYAmCFRejw/mfoB2M5yHO2KOrcEfLasv41JLlI411y x0EIA2yP604AoJmGRx3sI+owTSR/GbQ3fh+GwqIf0K263PWboqCsSQNK+P8UeYF1L5H7 DJJdqDbJis0oSnRREXEAAjAAIEK8iDD/YjIZGBC3/iFUm0GP1PwwALEN1//8mOJbZfif o+fg== 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; bh=v+xfbbVoOjF+S1W8inBt7UaDDyM9cwPXO6S+VvhteMw=; b=UREq1/ADct1CVhnfHRGoxnS0QQo9unvhw7eGb1SxvdSrI9MvEqqvOHOFyH02dEIEgG Azk/Ld2U4TMc+/KMNlqlMFnvUKrMDFtx9P8LajeFltU7SufOvfTe2Q02JTIM4hDPHNFE gWcERqwgDl82ec1f3DjLmyjfXVqxd/ORCKCtSUlwp7icr3k5/pNQ1ZB/iGx8BOLPaaqz /saj9tKFZvw7/0A2ogG2u7bpxPjKxRDD9XVsbSywYV71HgxrljXs6Epv4Po2Urm57EYr hU4OYvEY+EkKqI1np6QVXSauZ7573ITnMEzvYsRRPbY0mYPYVNYEL1nJpWU/1mDKjNQl Yj0A== X-Gm-Message-State: AODbwcC1hGRSRB+mCJYYnH8EevE5EIc9FLXwx+vp6KlRZeU9DqF69o+j 8W6Exub21U/9Pwsl X-Received: by 10.223.174.180 with SMTP id y49mr244679wrc.133.1496305328660; Thu, 01 Jun 2017 01:22:08 -0700 (PDT) Received: from slxBook4.fritz.box (p5DDB4864.dip0.t-ipconnect.de. [93.219.72.100]) by smtp.gmail.com with ESMTPSA id 140sm15351595wmu.23.2017.06.01.01.22.07 (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 01 Jun 2017 01:22:08 -0700 (PDT) From: Lars Schneider To: git@vger.kernel.org Cc: gitster@pobox.com, peff@peff.net, tboegi@web.de, e@80x24.org, ttaylorr@github.com, peartben@gmail.com Subject: [PATCH v5 3/5] t0021: write "OUT" only on success Date: Thu, 1 Jun 2017 10:22:01 +0200 Message-Id: <20170601082203.50397-4-larsxschneider@gmail.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170601082203.50397-1-larsxschneider@gmail.com> References: <20170601082203.50397-1-larsxschneider@gmail.com> Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org "rot13-filter.pl" used to write "OUT " to the debug log even in case of an abort or error. Fix this by writing "OUT " to the debug log only in the successful case if output is actually written. This is useful for the subsequent patch 'convert: add "status=delayed" to filter process protocol'. Signed-off-by: Lars Schneider --- t/t0021-conversion.sh | 6 +++--- t/t0021/rot13-filter.pl | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh index 0139b460e7..0c04d346a1 100755 --- a/t/t0021-conversion.sh +++ b/t/t0021-conversion.sh @@ -588,7 +588,7 @@ test_expect_success PERL 'process filter should restart after unexpected write f cat >expected.log <<-EOF && START init handshake complete - IN: smudge smudge-write-fail.r $SF [OK] -- OUT: $SF [WRITE FAIL] + IN: smudge smudge-write-fail.r $SF [OK] -- [WRITE FAIL] START init handshake complete IN: smudge test.r $S [OK] -- OUT: $S . [OK] @@ -634,7 +634,7 @@ test_expect_success PERL 'process filter should not be restarted if it signals a cat >expected.log <<-EOF && START init handshake complete - IN: smudge error.r $SE [OK] -- OUT: 0 [ERROR] + IN: smudge error.r $SE [OK] -- [ERROR] IN: smudge test.r $S [OK] -- OUT: $S . [OK] IN: smudge test2.r $S2 [OK] -- OUT: $S2 . [OK] STOP @@ -673,7 +673,7 @@ test_expect_success PERL 'process filter abort stops processing of all further f cat >expected.log <<-EOF && START init handshake complete - IN: smudge abort.r $SA [OK] -- OUT: 0 [ABORT] + IN: smudge abort.r $SA [OK] -- [ABORT] STOP EOF test_cmp_exclude_clean expected.log debug.log && diff --git a/t/t0021/rot13-filter.pl b/t/t0021/rot13-filter.pl index 0b943bb377..5e43faeec1 100644 --- a/t/t0021/rot13-filter.pl +++ b/t/t0021/rot13-filter.pl @@ -153,9 +153,6 @@ while (1) { die "bad command '$command'"; } - print $debug "OUT: " . length($output) . " "; - $debug->flush(); - if ( $pathname eq "error.r" ) { print $debug "[ERROR]\n"; $debug->flush(); @@ -178,6 +175,9 @@ while (1) { die "${command} write error"; } + print $debug "OUT: " . length($output) . " "; + $debug->flush(); + while ( length($output) > 0 ) { my $packet = substr( $output, 0, $MAX_PACKET_CONTENT_SIZE ); packet_bin_write($packet); -- 2.13.0