[FYI] Fix new py-value.exp test case

Message ID 20190226191341.24238-1-tromey@adacore.com
State New, archived
Headers

Commit Message

Tom Tromey Feb. 26, 2019, 7:13 p.m. UTC
  The new test case in py-value.exp fails -- the code was changed to
throw ValueError, but the test still checks for TypeError.  This patch
fixes the problem.

I'm checking this in.  Tested on x86-64 Fedora 29.

gdb/testsuite/ChangeLog
2019-02-26  Tom Tromey  <tromey@adacore.com>

	* gdb.python/py-value.exp (test_value_from_buffer): Check for
	ValueError, not TypeError.
---
 gdb/testsuite/ChangeLog               | 5 +++++
 gdb/testsuite/gdb.python/py-value.exp | 2 +-
 2 files changed, 6 insertions(+), 1 deletion(-)
  

Comments

Kevin Buettner Feb. 26, 2019, 9:45 p.m. UTC | #1
On Tue, 26 Feb 2019 12:13:41 -0700
Tom Tromey <tromey@adacore.com> wrote:

> The new test case in py-value.exp fails -- the code was changed to
> throw ValueError, but the test still checks for TypeError.  This patch
> fixes the problem.
> 
> I'm checking this in.  Tested on x86-64 Fedora 29.

Thanks for fixing this.  Not sure how I missed it in my testing.

Kevin
  

Patch

diff --git a/gdb/testsuite/gdb.python/py-value.exp b/gdb/testsuite/gdb.python/py-value.exp
index d42aff90f3b..b3d90b52272 100644
--- a/gdb/testsuite/gdb.python/py-value.exp
+++ b/gdb/testsuite/gdb.python/py-value.exp
@@ -530,7 +530,7 @@  proc test_value_from_buffer {} {
   gdb_test "python v=gdb.Value(b\[2*size_a0:\],tp); print(v)" "3" \
            "convert 3rd elem of buffer to value"
   gdb_test "python v=gdb.Value(b\[2*size_a0+1:\],tp); print(v)" \
-           "TypeError: Size of type is larger than that of buffer object\..*" \
+           "ValueError: Size of type is larger than that of buffer object\..*" \
 	   "attempt to convert smaller buffer than size of type"
   gdb_py_test_silent_cmd "python atp=tp.array(2) ; print(atp)" \
                          "make array type" 0