public inbox for mauve-patches@sourceware.org
 help / color / mirror / Atom feed
* FYI: SpinnerDateModel - additional checks
@ 2006-02-15 11:10 David Gilbert
  0 siblings, 0 replies; only message in thread
From: David Gilbert @ 2006-02-15 11:10 UTC (permalink / raw)
  To: mauve-patches

[-- Attachment #1: Type: text/plain, Size: 466 bytes --]

This patch adds the same checks for SpinnerDateModel that I added 
earlier today for SpinnerNumberModel:

2006-02-15  David Gilbert  <david.gilbert@object-refinery.com>

    * gnu/testlet/javax/swing/SpinnerDateModel/getNextValue.java
    (test): Add checks for model without bounds,
    * gnu/testlet/javax/swing/SpinnerDateModel/getPreviousValue.java
    (test): Likewise.

Our implementation of SpinnerDateModel already passes these new checks...

Regards,

Dave

[-- Attachment #2: diff.txt --]
[-- Type: text/plain, Size: 2034 bytes --]

Index: gnu/testlet/javax/swing/SpinnerDateModel/getNextValue.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/javax/swing/SpinnerDateModel/getNextValue.java,v
retrieving revision 1.1
diff -u -r1.1 getNextValue.java
--- gnu/testlet/javax/swing/SpinnerDateModel/getNextValue.java	8 Feb 2006 16:38:35 -0000	1.1
+++ gnu/testlet/javax/swing/SpinnerDateModel/getNextValue.java	15 Feb 2006 11:07:03 -0000
@@ -52,5 +52,14 @@
     harness.check(m.getNextValue(), end);
     m.setValue(end);
     harness.check(m.getNextValue(), null);
+    
+    // repeat for model without bounds
+    m = new SpinnerDateModel(now, null, null, Calendar.MILLISECOND);
+    harness.check(m.getValue(), now);
+    harness.check(m.getNextValue(), next);
+
+    // accessing the next value doesn't update the current value
+    harness.check(m.getValue(), now);    
+
   }
 }
Index: gnu/testlet/javax/swing/SpinnerDateModel/getPreviousValue.java
===================================================================
RCS file: /cvs/mauve/mauve/gnu/testlet/javax/swing/SpinnerDateModel/getPreviousValue.java,v
retrieving revision 1.1
diff -u -r1.1 getPreviousValue.java
--- gnu/testlet/javax/swing/SpinnerDateModel/getPreviousValue.java	8 Feb 2006 16:38:35 -0000	1.1
+++ gnu/testlet/javax/swing/SpinnerDateModel/getPreviousValue.java	15 Feb 2006 11:07:04 -0000
@@ -31,6 +31,7 @@
 import java.util.Date;
 
 import javax.swing.SpinnerDateModel;
+import javax.swing.SpinnerNumberModel;
 
 public class getPreviousValue implements Testlet {
 
@@ -52,5 +53,13 @@
     harness.check(m.getPreviousValue(), start);
     m.setValue(start);
     harness.check(m.getPreviousValue(), null);
+    
+    // repeat for model without bounds
+    m = new SpinnerDateModel(now, null, null, Calendar.MILLISECOND);
+    harness.check(m.getValue(), now);
+    harness.check(m.getPreviousValue(), prev);
+
+    // accessing the previous value doesn't update the current value
+    harness.check(m.getValue(), now);    
   }
 }

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-02-15 11:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-02-15 11:10 FYI: SpinnerDateModel - additional checks David Gilbert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).