summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2013-08-05 10:49:15 +0200
committerLionel Elie Mamane <lionel@mamane.lu>2013-08-06 12:19:09 +0200
commit586d0ad6f260a00365b1238ed69c98f488fa611a (patch)
tree4d1140b1761de52b2d90a9c9c68447757ff94cb1
parentf2a8e85f9a175ae0f6868eff464e0827d1c66c0b (diff)
Fix uses of Java == on css.uno.Date/Time
...introduced with 8ee69b0ba13f74d1515fac71df92947eb6328ab1 "fdo#67235 adapt form control code to time nanosecond API change, step 3." Change-Id: Ifdd449715ce0be602b7bc2d304d503385195eb66
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XDateField.java20
-rw-r--r--qadevOOo/tests/java/ifc/awt/_XTimeField.java20
2 files changed, 20 insertions, 20 deletions
diff --git a/qadevOOo/tests/java/ifc/awt/_XDateField.java b/qadevOOo/tests/java/ifc/awt/_XDateField.java
index c57106bf3ad7..f54fa70134b4 100644
--- a/qadevOOo/tests/java/ifc/awt/_XDateField.java
+++ b/qadevOOo/tests/java/ifc/awt/_XDateField.java
@@ -68,8 +68,8 @@ public class _XDateField extends MultiMethodTest {
boolean result = true ;
oObj.setDate(new Date((short)1, (short)1, (short)1900)) ;
-
- result = oObj.getDate() == new Date((short)1, (short)1, (short)1900); ;
+ Date date = oObj.getDate();
+ result = date.Day == 1 && date.Month == 1 && date.Year == 1900;
if (! result ) {
System.out.println("getDate: " + oObj.getDate() + " , expected 1900-01-01");
@@ -102,8 +102,8 @@ public class _XDateField extends MultiMethodTest {
boolean result = true ;
oObj.setMin(new Date((short)5, (short)2, (short)1963));
-
- result = oObj.getMin() == new Date((short)5, (short)2, (short)1963);
+ Date date = oObj.getMin();
+ result = date.Day == 5 && date.Month == 2 && date.Year == 1963;
tRes.tested("setMin()", result) ;
}
@@ -132,8 +132,8 @@ public class _XDateField extends MultiMethodTest {
boolean result = true ;
oObj.setMax(new Date((short)18, (short)9, (short)2117)) ;
-
- result = oObj.getMax() == new Date((short)18, (short)9, (short)2117) ;
+ Date date = oObj.getMax();
+ result = date.Day == 18 && date.Month == 9 && date.Year == 2117;
tRes.tested("setMax()", result) ;
}
@@ -162,8 +162,8 @@ public class _XDateField extends MultiMethodTest {
boolean result = true ;
oObj.setFirst(new Date((short)7, (short)12, (short)1972)) ;
-
- result = oObj.getFirst() == new Date((short)7, (short)12, (short)1972) ;
+ Date date = oObj.getFirst();
+ result = date.Day == 7 && date.Month == 12 && date.Year == 1972;
if (!result) {
log.println("Set to " + 5118 + " but returned " + oObj.getFirst()) ;
@@ -198,8 +198,8 @@ public class _XDateField extends MultiMethodTest {
boolean result = true ;
oObj.setLast(new Date((short)23, (short)8, (short)2053)) ;
-
- result = oObj.getLast() == new Date((short)23, (short)8, (short)2053) ;
+ Date date = oObj.getLast();
+ result = date.Day == 23 && date.Month == 8 && date.Year == 2053;
if (!result) {
log.println("Set to 2053-08-23 but returned " + oObj.getLast()) ;
diff --git a/qadevOOo/tests/java/ifc/awt/_XTimeField.java b/qadevOOo/tests/java/ifc/awt/_XTimeField.java
index 955b56d7aea9..5a7641ab5504 100644
--- a/qadevOOo/tests/java/ifc/awt/_XTimeField.java
+++ b/qadevOOo/tests/java/ifc/awt/_XTimeField.java
@@ -64,8 +64,8 @@ public class _XTimeField extends MultiMethodTest {
boolean result = true ;
oObj.setTime(new Time(0, (short)0, (short)15, (short)11, false));
-
- result = oObj.getTime() == new Time(0, (short)0, (short)15, (short)11, false) ;
+ Time time = oObj.getTime();
+ result = time.NanoSeconds == 0 && time.Seconds == 0 && time.Minutes == 15 && time.Hours == 11 && !time.IsUTC;
if (! result ) {
System.out.println("Getting " + oObj.getTime() + " expected 11:15");
@@ -98,8 +98,8 @@ public class _XTimeField extends MultiMethodTest {
boolean result = true ;
oObj.setMin(new Time(0, (short)14, (short)18, (short)6, false));
-
- result = oObj.getMin() == new Time(0, (short)14, (short)18, (short)6, false) ;
+ Time time = oObj.getMin();
+ result = time.NanoSeconds == 0 && time.Seconds == 14 && time.Minutes == 18 && time.Hours == 6 && !time.IsUTC;
tRes.tested("setMin()", result) ;
}
@@ -128,8 +128,8 @@ public class _XTimeField extends MultiMethodTest {
boolean result = true ;
oObj.setMax(new Time(855447, (short)31, (short)23, (short)22, false)) ;
-
- result = oObj.getMax() == new Time(855447, (short)31, (short)23, (short)22, false) ;
+ Time time = oObj.getMax();
+ result = time.NanoSeconds == 855447 && time.Seconds == 31 && time.Minutes == 23 && time.Hours == 22 && !time.IsUTC;
tRes.tested("setMax()", result) ;
}
@@ -158,8 +158,8 @@ public class _XTimeField extends MultiMethodTest {
boolean result = true ;
oObj.setFirst(new Time(0, (short)0, (short)30, (short)7, false)) ;
-
- result = oObj.getFirst() == new Time(0, (short)0, (short)30, (short)7, false);
+ Time time = oObj.getFirst();
+ result = time.NanoSeconds == 0 && time.Seconds == 0 && time.Minutes == 30 && time.Hours == 7 && !time.IsUTC;
if (!result) {
log.println("Set to 07:30 but returned " + oObj.getFirst()) ;
@@ -194,8 +194,8 @@ public class _XTimeField extends MultiMethodTest {
boolean result = true ;
oObj.setLast(new Time(500000, (short)31, (short)30, (short)18, false)) ;
-
- result = oObj.getLast() == new Time(500000, (short)31, (short)30, (short)18, false);
+ Time time = oObj.getLast();
+ result = time.NanoSeconds == 500000 && time.Seconds == 31 && time.Minutes == 30 && time.Hours == 18 && !time.IsUTC;
if (!result) {
log.println("Set to 18:30:31.5 but returned " + oObj.getLast()) ;