diff --git a/python/ql/test/library-tests/PointsTo/general/GlobalPointsTo.expected b/python/ql/test/library-tests/PointsTo/general/GlobalPointsTo.expected index f4a26e6919b..627c29be92b 100644 --- a/python/ql/test/library-tests/PointsTo/general/GlobalPointsTo.expected +++ b/python/ql/test/library-tests/PointsTo/general/GlobalPointsTo.expected @@ -6,6 +6,10 @@ | Class Base2 | 178 | ControlFlowNode for x | int 1 | | Class Derived4 | 182 | ControlFlowNode for FunctionExpr | Function __init__ | | Class Derived4 | 182 | ControlFlowNode for __init__ | Function __init__ | +| Class DiGraph | 272 | ControlFlowNode for FunctionExpr | Function __init__ | +| Class DiGraph | 272 | ControlFlowNode for __init__ | Function __init__ | +| Class DiGraph | 275 | ControlFlowNode for FunctionExpr | Function add_node | +| Class DiGraph | 275 | ControlFlowNode for add_node | Function add_node | | Class E | 195 | ControlFlowNode for FunctionExpr | Function _internal | | Class E | 195 | ControlFlowNode for _internal | Function _internal | | Class E | 201 | ControlFlowNode for _internal | Function _internal | @@ -176,3 +180,6 @@ | Module pointsto_test | 254 | ControlFlowNode for object | builtin-class object | | Module pointsto_test | 267 | ControlFlowNode for Derived4 | class Derived4 | | Module pointsto_test | 267 | ControlFlowNode for Derived4() | Derived4() | +| Module pointsto_test | 270 | ControlFlowNode for ClassExpr | class DiGraph | +| Module pointsto_test | 270 | ControlFlowNode for DiGraph | class DiGraph | +| Module pointsto_test | 270 | ControlFlowNode for object | builtin-class object | diff --git a/python/ql/test/library-tests/PointsTo/general/LocalPointsTo.expected b/python/ql/test/library-tests/PointsTo/general/LocalPointsTo.expected index 7f132556180..f051a10e4a7 100644 --- a/python/ql/test/library-tests/PointsTo/general/LocalPointsTo.expected +++ b/python/ql/test/library-tests/PointsTo/general/LocalPointsTo.expected @@ -339,3 +339,17 @@ | 264 | ControlFlowNode for self | self | | 267 | ControlFlowNode for Derived4 | class Derived4 | | 267 | ControlFlowNode for Derived4() | Derived4() | +| 270 | ControlFlowNode for ClassExpr | class DiGraph | +| 270 | ControlFlowNode for DiGraph | class DiGraph | +| 270 | ControlFlowNode for object | builtin-class object | +| 272 | ControlFlowNode for FunctionExpr | Function __init__ | +| 272 | ControlFlowNode for __init__ | Function __init__ | +| 273 | ControlFlowNode for Attribute | Dict | +| 273 | ControlFlowNode for Dict | Dict | +| 273 | ControlFlowNode for self | self | +| 275 | ControlFlowNode for FunctionExpr | Function add_node | +| 275 | ControlFlowNode for add_node | Function add_node | +| 276 | ControlFlowNode for Attribute | Dict | +| 276 | ControlFlowNode for IntegerLiteral | int 0 | +| 276 | ControlFlowNode for Subscript | int 0 | +| 276 | ControlFlowNode for self | self | diff --git a/python/ql/test/library-tests/PointsTo/general/LocalPointsToType.expected b/python/ql/test/library-tests/PointsTo/general/LocalPointsToType.expected index 2f1d347892d..cdecda74f38 100644 --- a/python/ql/test/library-tests/PointsTo/general/LocalPointsToType.expected +++ b/python/ql/test/library-tests/PointsTo/general/LocalPointsToType.expected @@ -342,3 +342,17 @@ | 264 | ControlFlowNode for self | self | class G | | 267 | ControlFlowNode for Derived4 | class Derived4 | builtin-class type | | 267 | ControlFlowNode for Derived4() | Derived4() | class Derived4 | +| 270 | ControlFlowNode for ClassExpr | class DiGraph | builtin-class type | +| 270 | ControlFlowNode for DiGraph | class DiGraph | builtin-class type | +| 270 | ControlFlowNode for object | builtin-class object | builtin-class type | +| 272 | ControlFlowNode for FunctionExpr | Function __init__ | builtin-class function | +| 272 | ControlFlowNode for __init__ | Function __init__ | builtin-class function | +| 273 | ControlFlowNode for Attribute | Dict | builtin-class dict | +| 273 | ControlFlowNode for Dict | Dict | builtin-class dict | +| 273 | ControlFlowNode for self | self | class DiGraph | +| 275 | ControlFlowNode for FunctionExpr | Function add_node | builtin-class function | +| 275 | ControlFlowNode for add_node | Function add_node | builtin-class function | +| 276 | ControlFlowNode for Attribute | Dict | builtin-class dict | +| 276 | ControlFlowNode for IntegerLiteral | int 0 | builtin-class int | +| 276 | ControlFlowNode for Subscript | int 0 | builtin-class int | +| 276 | ControlFlowNode for self | self | class DiGraph | diff --git a/python/ql/test/library-tests/PointsTo/general/pointsto_test.py b/python/ql/test/library-tests/PointsTo/general/pointsto_test.py index 26fcce71ef9..1d722e97361 100644 --- a/python/ql/test/library-tests/PointsTo/general/pointsto_test.py +++ b/python/ql/test/library-tests/PointsTo/general/pointsto_test.py @@ -265,3 +265,13 @@ class G(object): # Self can only be of a class that is instantiated. Derived4() + + +class DiGraph(object): + + def __init__(self): + self.pred = {} + + def add_node(self, n): + self.pred[n] = 0 +