Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <pedro_alves@portugalmail.pt>
To: gdb-patches@sourceware.org
Subject: [testsuite] Use [string compare] instead of eq and ne
Date: Mon, 29 Oct 2007 23:36:00 -0000	[thread overview]
Message-ID: <4726649E.2060201@portugalmail.pt> (raw)

[-- Attachment #1: Type: text/plain, Size: 300 bytes --]

Hi,

My kubuntu 6.06 comes with a version of expect that doesn't
understand eq or ne operators.  I can't see them being used
anywhere else in the whole testsuite, so I take it they
shouldn't really be used.

Without this patch, the sepdebug.exp was untested
due to tcl errors.

Cheers,
Pedro Alves



[-- Attachment #2: sepdebug.exp.diff --]
[-- Type: text/x-diff, Size: 2031 bytes --]

2007-10-29  Pedro Alves  <pedro_alves@portugalmail.pt>

	* lib/gdb.exp, gdb.base/sepdebug.exp: Replace usage of eq and ne
	with [string compare].

---
 gdb/testsuite/gdb.base/sepdebug.exp |    6 +++---
 gdb/testsuite/lib/gdb.exp           |    2 +-
 2 files changed, 4 insertions(+), 4 deletions(-)

Index: src/gdb/testsuite/gdb.base/sepdebug.exp
===================================================================
--- src.orig/gdb/testsuite/gdb.base/sepdebug.exp	2007-10-29 20:33:26.000000000 +0000
+++ src/gdb/testsuite/gdb.base/sepdebug.exp	2007-10-29 20:34:20.000000000 +0000
@@ -955,7 +955,7 @@ test_different_dir debuglink "${objdir}/
 # NT_GNU_BUILD_ID / .note.gnu.build-id test:
 
 set build_id_debug_filename [build_id_debug_filename_get $binfile]
-if {$build_id_debug_filename eq ""} {
+if ![string compare $build_id_debug_filename ""] then {
     unsupported "build-id is not supported by the compiler"
 
     # Spare debug files may confuse testsuite runs in the future.
@@ -964,10 +964,10 @@ if {$build_id_debug_filename eq ""} {
     set build_id_debugself_filename [build_id_debug_filename_get $debugfile]
     set test "build-id support by binutils"
     set xfail 0
-    if {$build_id_debugself_filename eq ""} {
+    if ![string compare $build_id_debugself_filename ""] then {
 	unsupported $test
 	set xfail 1
-    } elseif {$build_id_debugself_filename ne $build_id_debug_filename} {
+    } elseif {[string compare $build_id_debugself_filename $build_id_debug_filename] != 0} then {
 	fail $test
     } else {
 	pass $test
Index: src/gdb/testsuite/lib/gdb.exp
===================================================================
--- src.orig/gdb/testsuite/lib/gdb.exp	2007-10-29 20:33:14.000000000 +0000
+++ src/gdb/testsuite/lib/gdb.exp	2007-10-29 20:33:30.000000000 +0000
@@ -2505,7 +2505,7 @@ proc build_id_debug_filename_get { exec 
     set data [read $fi]
     close $fi
     file delete $tmp
-    if {$data eq ""} {
+    if ![string compare $data ""] then {
 	return ""
     }
     # Convert it to hex.



             reply	other threads:[~2007-10-29 22:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-29 23:36 Pedro Alves [this message]
2007-10-30  1:19 ` Daniel Jacobowitz
2007-10-30 19:38   ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4726649E.2060201@portugalmail.pt \
    --to=pedro_alves@portugalmail.pt \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox