From 148ac50e89b66c1d7934f464195ba559f5cc8cd0 Mon Sep 17 00:00:00 2001 From: Lancelot SIX Date: Sun, 21 Nov 2021 01:55:43 +0000 Subject: [PATCH] gdb/testsuite: Remove duplicates from gdb.base/pointers.exp MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit When I run the testsuite, I have : Running .../gdb/testsuite/gdb.base/pointers.exp ... DUPLICATE: gdb.base/pointers.exp: pointer assignment Fix by placing the sections with duplication in with_test_prefix blocks. This removes the duplication and gives a better organization the file. Tested on x86_64-linux. Co-Authored-By: Pedro Alves --- gdb/testsuite/gdb.base/pointers.exp | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/gdb/testsuite/gdb.base/pointers.exp b/gdb/testsuite/gdb.base/pointers.exp index 8a26c548515..bca8377637b 100644 --- a/gdb/testsuite/gdb.base/pointers.exp +++ b/gdb/testsuite/gdb.base/pointers.exp @@ -145,18 +145,20 @@ gdb_test "print v_int_pointer < v_int_pointer2" " = $true" \ gdb_test "print v_int_pointer > v_int_pointer2" " = $false" \ "pointer1>pointer2" -gdb_test_no_output "set variable y = *v_int_pointer++" \ - "set y = *v_int_pointer++" -gdb_test "print y" " = 6" "pointer assignment" -gdb_test "print *v_int_pointer" " = 18" "and post-increment" - - +with_test_prefix "post-increment" { + gdb_test_no_output "set variable y = *v_int_pointer++" \ + "set y = *v_int_pointer++" + gdb_test "print y" " = 6" "pointer assignment" + gdb_test "print *v_int_pointer" " = 18" "and post-increment" +} -gdb_test_no_output "set variable y = *--v_int_pointer2" \ - "set y = *--v_int_pointer2" -gdb_test "print y" " = 6" "pointer assignment" -gdb_test "print *v_int_pointer2" " = 6" "and pre-decrement" +with_test_prefix "pre-decrement" { + gdb_test_no_output "set variable y = *--v_int_pointer2" \ + "set y = *--v_int_pointer2" + gdb_test "print y" " = 6" "pointer assignment" + gdb_test "print *v_int_pointer2" " = 6" "and pre-decrement" +} gdb_test_no_output "set variable y =v_int_pointer-v_int_pointer2" \ -- 2.30.2