Skip to content

Commit a8556f4

Browse files
committed
C#: Make sure that test output prints whether the summary is generated or not.
1 parent e416a06 commit a8556f4

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

csharp/ql/lib/semmle/code/csharp/dataflow/internal/FlowSummaryImpl.qll

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1059,9 +1059,15 @@ module Private {
10591059
preservesValue = false and result = "taint"
10601060
}
10611061

1062+
private string renderGenerated(boolean generated) {
1063+
generated = true and result = "generated:"
1064+
or
1065+
generated = false and result = ""
1066+
}
1067+
10621068
/**
10631069
* A query predicate for outputting flow summaries in semi-colon separated format in QL tests.
1064-
* The syntax is: "namespace;type;overrides;name;signature;ext;inputspec;outputspec;kind",
1070+
* The syntax is: "namespace;type;overrides;name;signature;ext;inputspec;outputspec;(generated:)?kind",
10651071
* ext is hardcoded to empty.
10661072
*/
10671073
query predicate summary(string csv) {
@@ -1072,7 +1078,7 @@ module Private {
10721078
c.relevantSummary(input, output, preservesValue) and
10731079
csv =
10741080
c.getCallableCsv() + getComponentStackCsv(input) + ";" + getComponentStackCsv(output) +
1075-
";" + renderKind(preservesValue)
1081+
";" + renderGenerated(c.isAutoGenerated()) + renderKind(preservesValue)
10761082
)
10771083
}
10781084
}

0 commit comments

Comments
 (0)