diff options
| author | Pietro Gagliardi <[email protected]> | 2014-03-08 21:59:03 -0500 |
|---|---|---|
| committer | Pietro Gagliardi <[email protected]> | 2014-03-08 21:59:03 -0500 |
| commit | a67eaaf9babd5448a78a4887c0569b445932c83b (patch) | |
| tree | 1231642609bf591c96201df186a6616c690b4c03 /test/main.go | |
| parent | b253bccadc2f995758e632c3d755166069c27a75 (diff) | |
Added a flag to the test program to evaluate illegal deletions on Mac OS X, necessary before I make it panic myself.
Diffstat (limited to 'test/main.go')
| -rw-r--r-- | test/main.go | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/test/main.go b/test/main.go index fb21024..c8da803 100644 --- a/test/main.go +++ b/test/main.go @@ -35,6 +35,8 @@ func gridWindow() (*Window, error) { return w, w.Open(g) } +var macCrashTest = flag.Bool("maccrash", false, "attempt crash on Mac OS X on deleting too far (debug lack of panic on 32-bit)") + func myMain() { w := NewWindow("Main Window", 320, 240) w.Closing = Event() @@ -111,10 +113,18 @@ mainloop: } doAdjustments() case <-b2.Clicked: - cb1.Delete(1) - cb2.Delete(2) - lb1.Delete(3) - lb2.Delete(4) + if cb1.Len() > 1 { + cb1.Delete(1) + } + if cb2.Len() > 2 { + cb2.Delete(2) + } + if lb1.Len() > 3 || *macCrashTest { + lb1.Delete(3) + } + if lb2.Len() > 4 { + lb2.Delete(4) + } case <-b3.Clicked: MsgBox("List Info", "cb1: %d %q (len %d)\ncb2: %d %q (len %d)\nlb1: %d %q (len %d)\nlb2: %d %q (len %d)", |
