[Nice-commit] Nice/testsuite/compiler/null inference.testsuite,1.6,1.7
Brought to you by:
bonniot
|
From: <bo...@us...> - 2003-03-12 03:27:11
|
Update of /cvsroot/nice/Nice/testsuite/compiler/null
In directory sc8-pr-cvs1:/tmp/cvs-serv18990/testsuite/compiler/null
Modified Files:
inference.testsuite
Log Message:
Handle nullness tests on the right side of && and || expressions.
Index: inference.testsuite
===================================================================
RCS file: /cvsroot/nice/Nice/testsuite/compiler/null/inference.testsuite,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** inference.testsuite 17 Feb 2003 14:40:07 -0000 1.6
--- inference.testsuite 12 Mar 2003 03:26:35 -0000 1.7
***************
*** 13,16 ****
--- 13,23 ----
+ /// FAIL
+ ?int x = null;
+ if (x != null)
+ x++;
+ else
+ /* /// FAIL HERE */ x++;
+
/// PASS
?int x = null;
***************
*** 301,302 ****
--- 308,362 ----
while ( (x1 = null) == null)
x1 = x1 + "";
+
+
+ /// COMMENT && expressions
+
+ /// PASS
+ ?String x = null;
+ boolean b = x != null && x.length() > 3 && x.length() > 4;
+
+ /// FAIL
+ ?String x = null;
+ boolean b = x != null && x.length() > 3;
+ b = x.length() > 3;
+
+ /// PASS
+ ?String x = null;
+ if (x != null && x.length() > 3 && x.length() > 4)
+ x.length();
+
+ /// PASS
+ ?String x = null;
+ boolean b = x != null && x.length() > 3 && (x = null) == null;
+
+ /// FAIL
+ ?String x = null;
+ boolean b = x != null && (x = null) == null && x.length() > 3;
+
+
+ /// COMMENT || expressions
+
+ /// PASS
+ ?String x = null;
+ boolean b = x == null || x.length() > 3 || x.length() > 4;
+
+ /// FAIL
+ ?String x = null;
+ boolean b = x == null || x.length() > 3;
+ b = x.length() > 3;
+
+ /// PASS
+ ?String x = null;
+ if (x == null || x.length() > 3 || x.length() > 4)
+ ;
+ else
+ x.length();
+
+ /// PASS
+ ?String x = null;
+ boolean b = x == null || x.length() > 3 || (x = null) == null;
+
+ /// FAIL
+ ?String x = null;
+ boolean b = x == null || (x = null) == "" || x.length() > 3;
+
|