This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[patch] charset.exp: If UTF-16 is not available, skip char16_t, String16 tests.
- From: dje at google dot com (Doug Evans)
- To: gdb-patches at sourceware dot org
- Date: Wed, 11 May 2011 17:46:10 -0700 (PDT)
- Subject: [patch] charset.exp: If UTF-16 is not available, skip char16_t, String16 tests.
Hi.
No doubt this is rare, but it can happen that UTF-16 support is not available.
I will check this in in a couple of days if there are no objections.
2011-05-11 Doug Evans <dje@google.com>
* gdb.base/charset.exp: If UTF-16 is not available, skip char16_t, String16 tests.
Index: charset.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.base/charset.exp,v
retrieving revision 1.27
diff -u -p -r1.27 charset.exp
--- charset.exp 1 Jan 2011 15:33:41 -0000 1.27
+++ charset.exp 12 May 2011 00:43:12 -0000
@@ -546,6 +546,12 @@ if {$wchar_ok} {
}
set ucs2_ok [expr {[get_sizeof char16_t 99] == 2}]
+
+if ![valid_host_charset "UTF-16"] {
+ verbose -log "Disabling UTF-16 tests."
+ set ucs2_ok 0
+}
+
if {$ucs2_ok} {
test_wide_or_unicode u UTF-16
}
@@ -606,11 +612,13 @@ proc string_display { var_name set_prefi
gdb_test "x /2${x_size}s ${var_name}" ".* ${x_type}\"Test String\"\[\r\n\]+.* ${x_type}\"with zeroes\"" "Display String ${var_name} with x/${x_size}s"
}
-string_display String16 u h u
-if {$wchar_size == 2} {
- string_display String16 L h u
+if { $ucs2_ok } {
+ string_display String16 u h u
+ if {$wchar_size == 2} {
+ string_display String16 L h u
+ }
}
-
+
string_display String32 U w U
if {$wchar_size == 4} {
string_display String32 L w U