Skip to content

Commit 3e1ca9b

Browse files
committed
java/ql/test: update library-tests
1 parent 8483c76 commit 3e1ca9b

File tree

5 files changed

+9
-8
lines changed

5 files changed

+9
-8
lines changed

java/ql/test/library-tests/constants/constants/Values.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ void values(final int notConstant) {
3131
byte downcast_byte_5 = (byte) (-214); // 42
3232
short downcast_short = (short) 32768; // -32768
3333
int cast_of_non_constant = (int) '*'; //42
34-
long cast_to_long = (long) 42; //Not handled
34+
long cast_to_long = (long) 42; // 42
3535

3636
int unary_plus = +42; //42
3737
int parameter_plus = +notConstant; //Not constant

java/ql/test/library-tests/constants/getIntValue.expected

+1
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
| constants/Values.java:31:32:31:44 | (...)... | 42 |
2020
| constants/Values.java:32:32:32:44 | (...)... | -32768 |
2121
| constants/Values.java:33:36:33:44 | (...)... | 42 |
22+
| constants/Values.java:34:29:34:37 | (...)... | 42 |
2223
| constants/Values.java:36:26:36:28 | +... | 42 |
2324
| constants/Values.java:39:27:39:29 | -... | -42 |
2425
| constants/Values.java:43:27:43:28 | ~... | -1 |
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import semmle.code.java.Variable
22

3-
from Variable v, CompileTimeConstantExpr init, RefType enclosing, int constant
3+
from Variable v, CompileTimeConstantExpr init, RefType enclosing, QlBuiltins::BigInt constant
44
where
55
v.getInitializer() = init and
66
init.getEnclosingCallable().getDeclaringType() = enclosing and
77
enclosing.hasQualifiedName("constants", "Values") and
8-
constant = init.getIntValue()
9-
select init, constant
8+
constant = init.getBigIntValue()
9+
select init, constant.toString()

java/ql/test/library-tests/dataflow/modulus-analysis/ModulusAnalysis.ql

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ import java
22
import semmle.code.java.dataflow.ModulusAnalysis
33
import semmle.code.java.dataflow.Bound
44

5-
from Expr e, Bound b, int delta, int mod
5+
from Expr e, Bound b, QlBuiltins::BigInt delta, QlBuiltins::BigInt mod
66
where exprModulus(e, b, delta, mod) and e.getCompilationUnit().fromSource()
7-
select e, b.toString(), delta, mod
7+
select e, b.toString(), delta.toString(), mod.toString()

java/ql/test/library-tests/dataflow/range-analysis/RangeAnalysis.ql

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ private string getDirectionString(boolean d) {
77
result = "lower" and d = false
88
}
99

10-
from Expr e, Bound b, int delta, boolean upper, Reason reason
10+
from Expr e, Bound b, QlBuiltins::BigInt delta, boolean upper, Reason reason
1111
where bounded(e, b, delta, upper, reason) and e.getCompilationUnit().fromSource()
12-
select e, b.toString(), delta, getDirectionString(upper), reason
12+
select e, b.toString(), delta.toString(), getDirectionString(upper), reason

0 commit comments

Comments
 (0)