From fe9f9afffd872cd2912683c819f8481fdd4b0f92 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Wed, 6 Aug 2014 08:48:19 +0100 Subject: [PATCH] racket/draw and racket/snip: avoid some undefined-checking wrappers The changes to `pen%` and `brush%` are related to the `racket/class` repair of the previous commit, while the `style%` change is because I didn't look at it before. original commit: fd67feddab577f8e756c78a9c2b89a9b4a66dbb5 --- pkgs/gui-pkgs/gui-test/tests/gracket/dc.rktl | 7 +++++++ pkgs/gui-pkgs/gui-test/tests/gracket/editor.rktl | 10 ++++++++++ 2 files changed, 17 insertions(+) diff --git a/pkgs/gui-pkgs/gui-test/tests/gracket/dc.rktl b/pkgs/gui-pkgs/gui-test/tests/gracket/dc.rktl index 2ea5e800..da20a6d6 100644 --- a/pkgs/gui-pkgs/gui-test/tests/gracket/dc.rktl +++ b/pkgs/gui-pkgs/gui-test/tests/gracket/dc.rktl @@ -843,6 +843,13 @@ (st #f (make-bitmap 1000000 1000000) ok?) +;; ---------------------------------------- +;; No # checks on certain class instances + +(test #f 'undef-pen (impersonator? (new pen%))) +(test #f 'undef-brush (impersonator? (new brush%))) +(test #f 'undef-color (impersonator? (new color%))) + ;; ---------------------------------------- (report-errs) diff --git a/pkgs/gui-pkgs/gui-test/tests/gracket/editor.rktl b/pkgs/gui-pkgs/gui-test/tests/gracket/editor.rktl index bdfaf93d..dd454e76 100644 --- a/pkgs/gui-pkgs/gui-test/tests/gracket/editor.rktl +++ b/pkgs/gui-pkgs/gui-test/tests/gracket/editor.rktl @@ -649,6 +649,16 @@ (unless (<= 0 count2 (/ N 2)) (error 'notifications "not weak enough? ~e" count2))) +;; ---------------------------------------- +;; No # checks on certain class instances + +(test #f 'undef-snip (impersonator? (new snip%))) +(test #f 'undef-string-snip% (impersonator? (new string-snip%))) +(test #f 'undef-tab-snip% (impersonator? (new tab-snip%))) +(test #f 'undef-image-snip% (impersonator? (new image-snip%))) +(test #f 'undef-style-delta% (impersonator? (new style-delta%))) +(test #f 'undef-style<%> (impersonator? (send (new style-list%) basic-style))) + ;; ---------------------------------------- (report-errs)