Skip to content

Commit 9585390

Browse files
committed
Python: Taint tests, report error location first
To better match the standard output from inline expectation tests
1 parent b2cb284 commit 9585390

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

python/ql/test/experimental/meta/InlineTaintTest.qll

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class InlineTaintTest extends InlineExpectationsTest {
6666
}
6767

6868
query predicate argumentToEnsureNotTaintedNotMarkedAsSpurious(
69-
string error, Location location, string element
69+
Location location, string error, string element
7070
) {
7171
error = "ERROR, you should add `SPURIOUS:` to this annotation" and
7272
location = shouldNotBeTainted().getLocation() and
@@ -78,7 +78,7 @@ query predicate argumentToEnsureNotTaintedNotMarkedAsSpurious(
7878
)
7979
}
8080

81-
query predicate untaintedArgumentToEnsureTaintedNotMarkedAsMissing(string error, Location location) {
81+
query predicate untaintedArgumentToEnsureTaintedNotMarkedAsMissing(Location location, string error) {
8282
error = "ERROR, you should add `# $ MISSING: tainted` annotation" and
8383
exists(DataFlow::Node sink |
8484
sink = shouldBeTainted() and
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
argumentToEnsureNotTaintedNotMarkedAsSpurious
2-
| ERROR, you should add `SPURIOUS:` to this annotation | taint_test.py:48:9:48:29 | taint_test.py:48 | should_not_be_tainted |
2+
| taint_test.py:48:9:48:29 | taint_test.py:48 | ERROR, you should add `SPURIOUS:` to this annotation | should_not_be_tainted |
33
untaintedArgumentToEnsureTaintedNotMarkedAsMissing
4-
| ERROR, you should add `# $ MISSING: tainted` annotation | taint_test.py:32:9:32:25 | taint_test.py:32 |
5-
| ERROR, you should add `# $ MISSING: tainted` annotation | taint_test.py:37:24:37:40 | taint_test.py:37 |
4+
| taint_test.py:32:9:32:25 | taint_test.py:32 | ERROR, you should add `# $ MISSING: tainted` annotation |
5+
| taint_test.py:37:24:37:40 | taint_test.py:37 | ERROR, you should add `# $ MISSING: tainted` annotation |
66
failures
77
| taint_test.py:41:20:41:21 | ts | Fixed missing result:tainted= |

0 commit comments

Comments
 (0)