Test "set width/height -1" (Re: [PATCH 2/2] Make 'show width/height' display "unlimited" when capped for readline)

Message ID 5e5690c4-56f5-dec6-d6e0-8e3ca75a7929@redhat.com
State New
Headers show
Series
  • Test "set width/height -1" (Re: [PATCH 2/2] Make 'show width/height' display "unlimited" when capped for readline)
Related show

Commit Message

Pedro Alves Feb. 27, 2019, 6:52 p.m.
On 02/27/2019 06:50 PM, Pedro Alves wrote:
> On 02/20/2019 11:01 PM, Kevin Buettner wrote:

>> On Wed, 20 Feb 2019 14:04:28 -0700

>> Tom Tromey <tom@tromey.com> wrote:

>>

>>>>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:  

>>>

>>> Pedro> So how about this version instead?  

>>>

>>> Pedro> And this as a follow up?  

>>>

>>> These both look good to me.

>>> Thanks for following up on this.

>>

>> LGTM too.

> Thanks.  I've checked these in now.


And this obvious follow up too.

From 5862844d0f443b9f65e8dd0d85c43f8818d3f355 Mon Sep 17 00:00:00 2001
From: Pedro Alves <palves@redhat.com>

Date: Wed, 27 Feb 2019 18:48:37 +0000
Subject: [PATCH] Test "set width/height -1"

As a follow up to the previous commit, add a test for "set
width/height -1", to make sure we don't overflow in readline with
negative values either.

gdb/testsuite/ChangeLog:
2019-02-27  Pedro Alves  <palves@redhat.com>

	* gdb.base/page.exp: Add tests for "set width/height -1".
---
 gdb/testsuite/ChangeLog         | 4 ++++
 gdb/testsuite/gdb.base/page.exp | 3 +++
 2 files changed, 7 insertions(+)

-- 
2.14.4

Patch

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index b5177c7e07..29b2832764 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,7 @@ 
+2019-02-27  Pedro Alves  <palves@redhat.com>
+
+	* gdb.base/page.exp: Add tests for "set width/height -1".
+
 2019-02-27  Pedro Alves  <palves@redhat.com>
 
 	* gdb.base/page.exp: Add tests for "set/show width/height" with
diff --git a/gdb/testsuite/gdb.base/page.exp b/gdb/testsuite/gdb.base/page.exp
index 8f1698c26e..68d94b38a3 100644
--- a/gdb/testsuite/gdb.base/page.exp
+++ b/gdb/testsuite/gdb.base/page.exp
@@ -118,6 +118,9 @@  foreach_with_prefix size {"0" "0x80000000" "unlimited"} {
 	"Number of lines gdb thinks are in a page is unlimited\\."
 }
 
+gdb_test "set width -1" "integer -1 out of range"
+gdb_test "set height -1" "integer -1 out of range"
+
 gdb_exit
 return 0