Skip to content

Commit 814947b

Browse files
committed
C#: Add some test cases for methods that are not properly exposed and will this not get their summary captured.
1 parent a555e04 commit 814947b

File tree

2 files changed

+46
-0
lines changed

2 files changed

+46
-0
lines changed

csharp/ql/test/utils/model-generator/CaptureSummaryModels.expected

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
| NoSummaries;PublicClassFlow;false;PublicReturn;(System.Int32);Argument[0];ReturnValue;taint |
12
| Summaries;BasicFlow;false;ReturnField;();Argument[Qualifier];ReturnValue;taint |
23
| Summaries;BasicFlow;false;ReturnParam0;(System.String,System.Object);Argument[0];ReturnValue;taint |
34
| Summaries;BasicFlow;false;ReturnParam1;(System.String,System.Object);Argument[1];ReturnValue;taint |
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
using System;
2+
3+
namespace NoSummaries;
4+
5+
// Single class with a method that produces a flow summary.
6+
// Just to prove that, if a method like this is correctly exposed, a flow summary will be captured.
7+
public class PublicClassFlow
8+
{
9+
public int PublicReturn(int input)
10+
{
11+
return input;
12+
}
13+
}
14+
15+
public sealed class PublicClassNoFlow
16+
{
17+
private int PrivateReturn(int input)
18+
{
19+
return input;
20+
}
21+
22+
internal int InternalReturn(int input)
23+
{
24+
return input;
25+
}
26+
27+
private class PrivateClassNoFlow
28+
{
29+
public int ReturnParam(int input)
30+
{
31+
return input;
32+
}
33+
}
34+
35+
private class PrivateClassNestedPublicClassNoFlow
36+
{
37+
public class NestedPublicClassFlow
38+
{
39+
public int ReturnParam(int input)
40+
{
41+
return input;
42+
}
43+
}
44+
}
45+
}

0 commit comments

Comments
 (0)