Skip to content

Commit 755b0bb

Browse files
committed
PY: update tests to not use deleted deprecations
1 parent 61e282d commit 755b0bb

File tree

4 files changed

+14
-6
lines changed

4 files changed

+14
-6
lines changed

python/ql/test/library-tests/PointsTo/new/SSA.expected

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
WARNING: Predicate ssa_variable_points_to has been deprecated and may be removed in future (SSA.ql:10,3-35)
21
| __init__.py:0 | __name___0 = ScopeEntryDefinition | 'code' | builtin-class str |
32
| __init__.py:0 | __name___0 = ScopeEntryDefinition | 'code.package' | builtin-class str |
43
| __init__.py:0 | __name___0 = ScopeEntryDefinition | 'code.test_package' | builtin-class str |

python/ql/test/library-tests/PointsTo/new/SSA.ql

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,21 @@ private import semmle.python.pointsto.PointsTo
33
private import semmle.python.pointsto.PointsToContext
44
import Util
55

6+
predicate ssa_variable_points_to(
7+
EssaVariable var, PointsToContext context, Object obj, ClassObject cls, @py_object origin
8+
) {
9+
exists(ObjectInternal value |
10+
PointsToInternal::variablePointsTo(var, context, value, origin) and
11+
cls = value.getClass().getSource()
12+
|
13+
obj = value.getSource()
14+
)
15+
}
16+
617
from EssaVariable v, EssaDefinition def, Object o, ClassObject cls
718
where
819
def = v.getDefinition() and
920
not v.getSourceVariable() instanceof SpecialSsaSourceVariable and
10-
PointsTo::ssa_variable_points_to(v, _, o, cls, _)
21+
ssa_variable_points_to(v, _, o, cls, _)
1122
select locate(def.getLocation(), "abcdegjqmns_"),
1223
v.getRepresentation() + " = " + def.getRepresentation(), repr(o), repr(cls)

python/ql/test/library-tests/taint/extensions/TestStep.expected

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
WARNING: Predicate getNode has been deprecated and may be removed in future (TestStep.ql:6,77-84)
2-
WARNING: Predicate getNode has been deprecated and may be removed in future (TestStep.ql:8,15-22)
31
| Taint simple.test | visitor.py:10 | arg | p2 = simple.test | --> | Taint simple.test | visitor.py:13 | arg | p2 = simple.test |
42
| Taint simple.test | visitor.py:18 | arg | | --> | Taint simple.test | visitor.py:19 | arg | |
53
| Taint simple.test | visitor.py:19 | arg | | --> | Taint simple.test | visitor.py:26 | Attribute() | |

python/ql/test/library-tests/taint/extensions/TestStep.ql

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ import ExtensionsLib
33

44
from TaintedNode n, TaintedNode s
55
where s = n.getASuccessor()
6-
select "Taint " + n.getTaintKind(), n.getLocation().toString(), n.getNode().getNode().toString(),
6+
select "Taint " + n.getTaintKind(), n.getLocation().toString(), n.getNode().asAstNode().toString(),
77
n.getContext(), " --> ", "Taint " + s.getTaintKind(), s.getLocation().toString(),
8-
s.getNode().getNode().toString(), s.getContext()
8+
s.getNode().asAstNode().toString(), s.getContext()

0 commit comments

Comments
 (0)