diff options
Diffstat (limited to 'gcc/testsuite/libgdiagnostics.dg/test-warning-with-path-c.py')
-rw-r--r-- | gcc/testsuite/libgdiagnostics.dg/test-warning-with-path-c.py | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/gcc/testsuite/libgdiagnostics.dg/test-warning-with-path-c.py b/gcc/testsuite/libgdiagnostics.dg/test-warning-with-path-c.py index 5d3bbc4..61ccb93 100644 --- a/gcc/testsuite/libgdiagnostics.dg/test-warning-with-path-c.py +++ b/gcc/testsuite/libgdiagnostics.dg/test-warning-with-path-c.py @@ -51,10 +51,8 @@ def test_sarif_output_for_warning_with_path(sarif): assert len(location['logicalLocations']) == 1 logical_loc = location['logicalLocations'][0] - assert logical_loc['name'] == 'make_a_list_of_random_ints_badly' + assert logical_loc['index'] == 0 assert logical_loc['fullyQualifiedName'] == 'make_a_list_of_random_ints_badly' - assert logical_loc['decoratedName'] == 'make_a_list_of_random_ints_badly' - assert logical_loc['kind'] == 'function' assert len(result['codeFlows']) == 1 assert len(result['codeFlows'][0]['threadFlows']) == 1 @@ -103,6 +101,16 @@ def test_sarif_output_for_warning_with_path(sarif): == ' PyList_Append(list, item);\n' assert tfl_2_loc['logicalLocations'] == location['logicalLocations'] assert tfl_2_loc['message']['text'] \ - == "when calling 'PyList_Append', passing NULL from (1) as argument 1" + == "when calling 'PyList_Append', passing NULL from [(1)](sarif:/runs/0/results/0/codeFlows/0/threadFlows/0/locations/0) as argument 1" assert tfl_2['nestingLevel'] == 0 assert tfl_2['executionOrder'] == 3 + + # Check theRun.logicalLocations + assert 'logicalLocations' in run + assert len(run['logicalLocations']) == 1 + logical_loc = run['logicalLocations'][0] + assert logical_loc['name'] == 'make_a_list_of_random_ints_badly' + assert logical_loc['fullyQualifiedName'] == 'make_a_list_of_random_ints_badly' + assert logical_loc['decoratedName'] == 'make_a_list_of_random_ints_badly' + assert logical_loc['kind'] == 'function' + assert logical_loc['index'] == 0 |