Skip to content

Commit c7045fb

Browse files
committed
C#: Add some test cases for excluding methods for model generation.
1 parent 8702293 commit c7045fb

File tree

3 files changed

+37
-0
lines changed

3 files changed

+37
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
extensions:
2+
- addsTo:
3+
pack: codeql/csharp-all
4+
extensible: neutralModel
5+
data:
6+
- [ "NoSummaries", "ManuallyModelled", "HasNeutralSummaryNoFlow", "(System.Object)", "summary", "manual"]
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
extensions:
2+
- addsTo:
3+
pack: codeql/csharp-all
4+
extensible: summaryModel
5+
data:
6+
- [ "NoSummaries", "ManuallyModelled", False, "HasSummary", "(System.Object)", "", "Argument[0]", "ReturnValue", "value", "manual"]
7+
8+
- addsTo:
9+
pack: codeql/csharp-all
10+
extensible: neutralModel
11+
data:
12+
- [ "NoSummaries", "ManuallyModelled", "HasNeutralSummary", "(System.Object)", "summary", "manual"]

csharp/ql/test/utils/modelgenerator/dataflow/NoSummaries.cs

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,3 +143,22 @@ public ParameterlessConstructor()
143143
IsInitialized = true;
144144
}
145145
}
146+
147+
// No models should be created, if there exist either a manual summary or neutral summary.
148+
public class ManuallyModelled
149+
{
150+
public object HasSummary(object o)
151+
{
152+
return o;
153+
}
154+
155+
public object HasNeutralSummary(object o)
156+
{
157+
return o;
158+
}
159+
160+
public object HasNeutralSummaryNoFlow(object o)
161+
{
162+
return null;
163+
}
164+
}

0 commit comments

Comments
 (0)