From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-f46.google.com (mail-wr1-f46.google.com [209.85.221.46]) by sourceware.org (Postfix) with ESMTPS id 8D55B3888C58 for ; Wed, 30 Mar 2022 19:29:39 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 8D55B3888C58 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f46.google.com with SMTP id u3so30750900wrg.3 for ; Wed, 30 Mar 2022 12:29:39 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=n9wYqyeqDt85OIaJ5XwLiny79iixPcDHj70rc4lS+hY=; b=00WniO+beNT2yzB704iDAeNhidtEN1sHnKD8FobmuT1EyxN0zmnegPRbE3apNuBqgi Cmu9zEcj5Npp7vQ3WxMeA29ExDw6Ai/Hv2rSJw9ej0rJDMCefecng2Xbdmr2DSg6RSbb zzmnKDGlrWtfRhSjoLxOeCQoRkpNaCidNziMNxjoPF0LLP/i/G2a/7cIVhxUg1O7A6+S AHHlLrJVPLxZuKrdUAvam6GthD5pckSIvqV2s52DSRssE4lNiqGqR2zFZI27aNGeX6+G WG0wtFy7S6virLD6xhaTBC7rePOnRklXjXCdGp0nittCZzfA7SnNx/4kMF2i0JAGE7Fe Q6tg== X-Gm-Message-State: AOAM532EPI8NEeP0wh8c4X37FXFK0E5tUzsFTWlhzUT4EVDeCyQ8i1Ao u9jzox95C8F4WGd+88+HdvcDGnFPPm4= X-Google-Smtp-Source: ABdhPJxemS734m1U95HgIxjgtb1BV2dXQClCM31ODxTO8ZzN5j33F+8iz/x9TjlFZUZGAY08RiqPUg== X-Received: by 2002:adf:fad0:0:b0:205:ad54:e51e with SMTP id a16-20020adffad0000000b00205ad54e51emr1016649wrs.650.1648668577917; Wed, 30 Mar 2022 12:29:37 -0700 (PDT) Received: from localhost ([2001:8a0:f924:2600:209d:85e2:409e:8726]) by smtp.gmail.com with ESMTPSA id k5-20020a05600c1c8500b0038ce140fec1sm5508837wms.16.2022.03.30.12.29.36 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 30 Mar 2022 12:29:37 -0700 (PDT) From: Pedro Alves To: gdb-patches@sourceware.org Subject: [PATCH 3/5] Fix bogus gdb_test invocations Date: Wed, 30 Mar 2022 20:29:27 +0100 Message-Id: <20220330192929.3161015-4-pedro@palves.net> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20220330192929.3161015-1-pedro@palves.net> References: <20220330192929.3161015-1-pedro@palves.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-9.5 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Mar 2022 19:29:41 -0000 A following patch will make gdb_test error out if bogus arguments are passed, which exposed bugs in a few testcases: - gdb.python/py-parameter.exp, passing a spurious "1" as extra parameter, resulting in: ERROR: Unexpected arguments: {set test-file-param bar.txt} {The name of the file has been changed to bar.txt} {set new file parameter} 1 - gdb.python/py-xmethods.exp, a missing test message, resulting in the next gdb_test being interpreted as message, question and response! With the enforcing patch, this was caught with: ERROR: Unexpected arguments: {p g.mul('a')} {From Python G<>::mul.*} gdb_test {p g_ptr->mul('a')} {From Python G<>::mul.*} {after: g_ptr->mul('a')} - gdb.base/pointers.exp, missing a quote. Change-Id: I66f2db4412025a64121db7347dfb0b48240d46d4 --- gdb/testsuite/gdb.base/pointers.exp | 2 +- gdb/testsuite/gdb.python/py-parameter.exp | 2 +- gdb/testsuite/gdb.python/py-xmethods.exp | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/gdb/testsuite/gdb.base/pointers.exp b/gdb/testsuite/gdb.base/pointers.exp index bca8377637b..db60b2bf540 100644 --- a/gdb/testsuite/gdb.base/pointers.exp +++ b/gdb/testsuite/gdb.base/pointers.exp @@ -209,7 +209,7 @@ gdb_test "print **ptr_to_ptr_to_float" " = 100" \ gdb_test "break marker1" ".*" "" gdb_test "cont" "Break.* marker1 \\(\\) at .*:$decimal.*" \ - continue to marker1" + "continue to marker1" gdb_test "up" "more_code.*" "up from marker1" gdb_test "print *pUC" " = 21 \'.025\'.*" "print value of *pUC" diff --git a/gdb/testsuite/gdb.python/py-parameter.exp b/gdb/testsuite/gdb.python/py-parameter.exp index 98d4b2d4684..199d3bc16ec 100644 --- a/gdb/testsuite/gdb.python/py-parameter.exp +++ b/gdb/testsuite/gdb.python/py-parameter.exp @@ -199,7 +199,7 @@ proc_with_prefix test_file_parameter { } { "The name of the file is foo.txt.*" "show initial file value" gdb_test "set test-file-param bar.txt" \ "The name of the file has been changed to bar.txt" \ - "set new file parameter" 1 + "set new file parameter" gdb_test "show test-file-param" \ "The name of the file is bar.txt.*" "show new file value" gdb_test "python print (test_file_param.value)" \ diff --git a/gdb/testsuite/gdb.python/py-xmethods.exp b/gdb/testsuite/gdb.python/py-xmethods.exp index f879e9c15a2..18057782143 100644 --- a/gdb/testsuite/gdb.python/py-xmethods.exp +++ b/gdb/testsuite/gdb.python/py-xmethods.exp @@ -130,6 +130,7 @@ gdb_test "p g.size_mul< 5 >()" "From Python G<>::size_mul.*" \ gdb_test "p g.mul(2.0)" "From Python G<>::mul.*" \ "after: g.mul(2.0)" gdb_test "p g.mul('a')" "From Python G<>::mul.*" \ + "after: g.mul('a')" gdb_test "p g_ptr->mul('a')" "From Python G<>::mul.*" \ "after: g_ptr->mul('a')" -- 2.26.2