From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1551) id C0F0F3858D3C; Tue, 17 May 2022 10:15:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C0F0F3858D3C Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Pedro Alves To: gdb-cvs@sourceware.org Subject: [binutils-gdb] Fix bogus gdb_test invocations X-Act-Checkin: binutils-gdb X-Git-Author: Pedro Alves X-Git-Refname: refs/heads/master X-Git-Oldrev: 35b72e4e5baabef35b34db7f12c627e7232ee204 X-Git-Newrev: 1fe69430d166bf287fe94a7fcecc7f867666ae5a Message-Id: <20220517101509.C0F0F3858D3C@sourceware.org> Date: Tue, 17 May 2022 10:15:09 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 17 May 2022 10:15:09 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D1fe69430d166= bf287fe94a7fcecc7f867666ae5a commit 1fe69430d166bf287fe94a7fcecc7f867666ae5a Author: Pedro Alves Date: Wed Mar 30 14:31:56 2022 +0100 Fix bogus gdb_test invocations =20 A following patch will make gdb_test error out if bogus arguments are passed, which exposed bugs in a few testcases: =20 - gdb.python/py-parameter.exp, passing a spurious "1" as extra parameter, resulting in: =20 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 =20 - 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: =20 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')} =20 - gdb.base/pointers.exp, missing a quote. =20 Change-Id: I66f2db4412025a64121db7347dfb0b48240d46d4 Diff: --- 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/p= ointers.exp index 15f7879a27f..e6406613318 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" " =3D 100" \ =20 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" =20 gdb_test "print *pUC" " =3D 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.p= ython/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')"