This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

FYI: fix charset.exp failures with libiconv


I'm checking this in.

charset.exp refers to some character sets not supplied by libiconv.
This patch fixes charset.exp to skip these tests.

I don't know how I missed this when testing builds against libiconv
:(.  Obviously I made some mistake.

Tom

2009-03-25  Tom Tromey  <tromey@redhat.com>

	* gdb.base/charset.exp (valid_target_charset): New proc.
	Use it to skip tests on invalid charsets.

Index: gdb.base/charset.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/charset.exp,v
retrieving revision 1.12
diff -u -r1.12 charset.exp
--- gdb.base/charset.exp	20 Mar 2009 23:04:39 -0000	1.12
+++ gdb.base/charset.exp	25 Mar 2009 19:16:40 -0000
@@ -131,6 +131,11 @@
     return [expr {[info exists charsets($charset)] && $charsets($charset)}]
 }
 
+proc valid_target_charset {charset} {
+    global charsets
+    return [info exists charsets($charset)]
+}
+
 send_gdb "set host-charset\n"
 gdb_expect {
     -re "Requires an argument. Valid arguments are (\[^ \t\n\r,.\]*)" {
@@ -238,6 +243,9 @@
         # Now try setting every possible target character set,
         # given that host charset.
         foreach target_charset $charset_subset {
+	    if {![valid_target_charset $target_charset]} {
+		continue
+	    }
             set testname "try `set target-charset $target_charset'"
             send_gdb "set target-charset $target_charset\n"
             gdb_expect {
@@ -376,6 +384,10 @@
 
 gdb_test "set host-charset ASCII" ""
 foreach target_charset $charset_subset {
+    if {![valid_target_charset $target_charset]} {
+	continue
+    }
+
     if {$target_charset == "UCS-4" || $target_charset == "UCS-2"} {
 	set param target-wide-charset
 	set L L


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]