Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [testsuite] Use [string compare] instead of eq and ne
@ 2007-10-29 23:36 Pedro Alves
  2007-10-30  1:19 ` Daniel Jacobowitz
  0 siblings, 1 reply; 3+ messages in thread
From: Pedro Alves @ 2007-10-29 23:36 UTC (permalink / raw)
  To: gdb-patches

[-- 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.



^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-10-30 19:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-29 23:36 [testsuite] Use [string compare] instead of eq and ne Pedro Alves
2007-10-30  1:19 ` Daniel Jacobowitz
2007-10-30 19:38   ` Pedro Alves

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox