Python: Taint tests, report error location first

To better match the standard output from inline expectation tests
This commit is contained in:
Rasmus Wriedt Larsen
2021-04-19 14:59:47 +02:00
parent b2cb284ff2
commit 9585390941
2 changed files with 5 additions and 5 deletions

View File

@@ -66,7 +66,7 @@ class InlineTaintTest extends InlineExpectationsTest {
}
query predicate argumentToEnsureNotTaintedNotMarkedAsSpurious(
string error, Location location, string element
Location location, string error, string element
) {
error = "ERROR, you should add `SPURIOUS:` to this annotation" and
location = shouldNotBeTainted().getLocation() and
@@ -78,7 +78,7 @@ query predicate argumentToEnsureNotTaintedNotMarkedAsSpurious(
)
}
query predicate untaintedArgumentToEnsureTaintedNotMarkedAsMissing(string error, Location location) {
query predicate untaintedArgumentToEnsureTaintedNotMarkedAsMissing(Location location, string error) {
error = "ERROR, you should add `# $ MISSING: tainted` annotation" and
exists(DataFlow::Node sink |
sink = shouldBeTainted() and

View File

@@ -1,7 +1,7 @@
argumentToEnsureNotTaintedNotMarkedAsSpurious
| ERROR, you should add `SPURIOUS:` to this annotation | taint_test.py:48:9:48:29 | taint_test.py:48 | should_not_be_tainted |
| taint_test.py:48:9:48:29 | taint_test.py:48 | ERROR, you should add `SPURIOUS:` to this annotation | should_not_be_tainted |
untaintedArgumentToEnsureTaintedNotMarkedAsMissing
| ERROR, you should add `# $ MISSING: tainted` annotation | taint_test.py:32:9:32:25 | taint_test.py:32 |
| ERROR, you should add `# $ MISSING: tainted` annotation | taint_test.py:37:24:37:40 | taint_test.py:37 |
| taint_test.py:32:9:32:25 | taint_test.py:32 | ERROR, you should add `# $ MISSING: tainted` annotation |
| taint_test.py:37:24:37:40 | taint_test.py:37 | ERROR, you should add `# $ MISSING: tainted` annotation |
failures
| taint_test.py:41:20:41:21 | ts | Fixed missing result:tainted= |