[v2,2/3] Add varobj zero-hexadecimal format tests.

Message ID 1431020207-14371-3-git-send-email-lgustavo@codesourcery.com
State New, archived
Headers

Commit Message

Luis Machado May 7, 2015, 5:36 p.m. UTC
  This patch adds a few tests to exercise the new zero-hexadecimal format for
varobj's. I see 5 FAIL's without the zero-hexadecimal format support and full
passes with a zero-hexadecimal format support.

I renamed some of the tests to make them unique.

gdb/testsuite/ChangeLog:

2015-05-07  Luis Machado  <lgustavo@codesourcery.com>

	* gdb.mi/mi-var-display.exp: Add new checks for the zero-hexadecimal
	  format and change test names to make them unique.
---
 gdb/testsuite/gdb.mi/mi-var-display.exp | 25 +++++++++++++++++++++++--
 1 file changed, 23 insertions(+), 2 deletions(-)
  

Comments

Joel Brobecker May 8, 2015, 5:30 p.m. UTC | #1
> 2015-05-07  Luis Machado  <lgustavo@codesourcery.com>
> 
> 	* gdb.mi/mi-var-display.exp: Add new checks for the zero-hexadecimal
> 	  format and change test names to make them unique.

Looks good!
  

Patch

diff --git a/gdb/testsuite/gdb.mi/mi-var-display.exp b/gdb/testsuite/gdb.mi/mi-var-display.exp
index 31bdce4..6aedb53 100644
--- a/gdb/testsuite/gdb.mi/mi-var-display.exp
+++ b/gdb/testsuite/gdb.mi/mi-var-display.exp
@@ -81,6 +81,11 @@  mi_gdb_test "-var-evaluate-expression bar" \
 	"eval variable bar"
 
 # Test: c_variable-6.5
+# Desc: change format of bar to zero-padded hexadecimal
+mi_gdb_test "-var-set-format bar zero-hexadecimal" \
+	"\\^done,format=\"zero-hexadecimal\",value=\"0x0.*849\"" \
+	"set format variable bar in zero-padded hexadecimal"
+
 # Desc: change format of bar to hex
 mi_gdb_test "-var-set-format bar hexadecimal" \
 	"\\^done,format=\"hexadecimal\",value=\"0x849\"" \
@@ -241,7 +246,7 @@  mi_gdb_test "-var-set-format weird.func_ptr hexadecimal" \
 
 mi_gdb_test "-var-show-format weird.func_ptr" \
 	"\\^done,format=\"hexadecimal\"" \
-	"show format variable weird.func_ptr"
+	"show format variable weird.func_ptr (hex)"
 
 mi_gdb_test "-var-set-format weird.func_ptr_ptr hexadecimal" \
 	"\\^done,format=\"hexadecimal\",value=\"$hex\"" \
@@ -249,7 +254,23 @@  mi_gdb_test "-var-set-format weird.func_ptr_ptr hexadecimal" \
 
 mi_gdb_test "-var-show-format weird.func_ptr_ptr" \
 	"\\^done,format=\"hexadecimal\"" \
-	"show format variable weird.func_ptr_ptr"
+	"show format variable weird.func_ptr_ptr (hex)"
+
+mi_gdb_test "-var-set-format weird.func_ptr zero-hexadecimal" \
+	"\\^done,format=\"zero-hexadecimal\",value=\"$hex\"" \
+	"set format variable weird.func_ptr in zero-padded hex"
+
+mi_gdb_test "-var-show-format weird.func_ptr" \
+	"\\^done,format=\"zero-hexadecimal\"" \
+	"show format variable weird.func_ptr (zhex)"
+
+mi_gdb_test "-var-set-format weird.func_ptr_ptr zero-hexadecimal" \
+	"\\^done,format=\"zero-hexadecimal\",value=\"$hex\"" \
+	"set format variable weird.func_ptr_ptr in zero-padded hex"
+
+mi_gdb_test "-var-show-format weird.func_ptr_ptr" \
+	"\\^done,format=\"zero-hexadecimal\"" \
+	"show format variable weird.func_ptr_ptr (zhex)"
 
 # Test: c_variable-6.24
 # Desc: format of weird and children