Skip to content

Commit eace7a4

Browse files
committed
C#: Add tests for supported framework methods
1 parent 14a2b7f commit eace7a4

File tree

3 files changed

+48
-0
lines changed

3 files changed

+48
-0
lines changed

csharp/ql/test/utils/modeleditor/FetchFrameworkModeMethods.expected

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
| PublicClass.cs:17:20:17:33 | protectedStuff | GitHub.CodeQL.PublicClass#protectedStuff(System.String) | false | supported | PublicClass.cs | library | | type | unknown | classification |
44
| PublicClass.cs:33:45:33:47 | get_PublicProperty | GitHub.CodeQL.PublicClass#get_PublicProperty() | false | supported | PublicClass.cs | library | | type | unknown | classification |
55
| PublicClass.cs:33:50:33:52 | set_PublicProperty | GitHub.CodeQL.PublicClass#set_PublicProperty(System.String) | false | supported | PublicClass.cs | library | | type | unknown | classification |
6+
| PublicClass.cs:35:19:35:30 | summaryStuff | GitHub.CodeQL.PublicClass#summaryStuff(System.String) | true | supported | PublicClass.cs | library | summary | type | unknown | classification |
7+
| PublicClass.cs:40:19:40:29 | sourceStuff | GitHub.CodeQL.PublicClass#sourceStuff() | true | supported | PublicClass.cs | library | source | type | unknown | classification |
8+
| PublicClass.cs:45:17:45:25 | sinkStuff | GitHub.CodeQL.PublicClass#sinkStuff(System.String) | true | supported | PublicClass.cs | library | sink | type | unknown | classification |
9+
| PublicClass.cs:50:17:50:28 | neutralStuff | GitHub.CodeQL.PublicClass#neutralStuff(System.String) | true | supported | PublicClass.cs | library | neutral | type | unknown | classification |
610
| PublicGenericClass.cs:7:17:7:21 | stuff | GitHub.CodeQL.PublicGenericClass<,>#stuff(T) | false | supported | PublicGenericClass.cs | library | | type | unknown | classification |
711
| PublicGenericClass.cs:12:17:12:26 | stuff2<> | GitHub.CodeQL.PublicGenericClass<,>#stuff2<>(T2) | false | supported | PublicGenericClass.cs | library | | type | unknown | classification |
812
| PublicGenericInterface.cs:7:10:7:14 | stuff | GitHub.CodeQL.PublicGenericInterface<>#stuff(T) | false | supported | PublicGenericInterface.cs | library | | type | unknown | classification |
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
extensions:
2+
- addsTo:
3+
pack: codeql/csharp-all
4+
extensible: sourceModel
5+
data:
6+
- ["GitHub.CodeQL","PublicClass",true,"sourceStuff","()","","ReturnValue","remote","manual"]
7+
8+
- addsTo:
9+
pack: codeql/csharp-all
10+
extensible: sinkModel
11+
data:
12+
- ["GitHub.CodeQL","PublicClass",true,"sinkStuff","(System.String)","","Argument[0]","sql-injection","manual"]
13+
14+
- addsTo:
15+
pack: codeql/csharp-all
16+
extensible: summaryModel
17+
data:
18+
- ["GitHub.CodeQL","PublicClass",true,"summaryStuff","(System.String)","","Argument[0]","ReturnValue","taint","manual"]
19+
20+
- addsTo:
21+
pack: codeql/csharp-all
22+
extensible: neutralModel
23+
data:
24+
- ["GitHub.CodeQL","PublicClass","neutralStuff","(System.String)","summary","manual"]

csharp/ql/test/utils/modeleditor/PublicClass.cs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,24 @@ internal void internalStuff(String arg)
3131
}
3232

3333
string PublicInterface.PublicProperty { get; set; }
34+
35+
public string summaryStuff(String arg)
36+
{
37+
return arg;
38+
}
39+
40+
public string sourceStuff()
41+
{
42+
return "stuff";
43+
}
44+
45+
public void sinkStuff(String arg)
46+
{
47+
// do nothing
48+
}
49+
50+
public void neutralStuff(String arg)
51+
{
52+
// do nothing
53+
}
3454
}

0 commit comments

Comments
 (0)