Skip to content

Commit 83b3125

Browse files
committed
C#: Some test examples of collection like types that should be excluded.
1 parent 4f5c06f commit 83b3125

File tree

2 files changed

+47
-0
lines changed

2 files changed

+47
-0
lines changed

csharp/ql/test/utils/model-generator/NoSummaries.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using System;
2+
using System.Collections.Generic;
23

34
namespace NoSummaries;
45

@@ -110,4 +111,24 @@ public virtual string M1(string s)
110111

111112
// Negative summary.
112113
public abstract string M2(string s);
114+
}
115+
116+
// No methods in this class will have generated flow as
117+
// the simple types used in the collection are not bulk data types.
118+
public class CollectionFlow
119+
{
120+
public int[] ReturnSimpleTypeArray(int[] a)
121+
{
122+
return a;
123+
}
124+
125+
public List<int> ReturnSimpleTypeList(List<int> a)
126+
{
127+
return a;
128+
}
129+
130+
public Dictionary<int, int> ReturnSimpleTypeDictionary(Dictionary<int, int> a)
131+
{
132+
return a;
133+
}
113134
}

csharp/ql/test/utils/model-generator/Summaries.cs

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Linq;
3+
using System.Collections;
34
using System.Collections.Generic;
45

56
namespace Summaries;
@@ -85,6 +86,31 @@ public List<string> ReturnFieldInAList()
8586
{
8687
return new List<string> { tainted };
8788
}
89+
90+
public string[] ReturnComplexTypeArray(string[] a)
91+
{
92+
return a;
93+
}
94+
95+
public List<byte> ReturnBulkTypeList(List<byte> a)
96+
{
97+
return a;
98+
}
99+
100+
public Dictionary<int, string> ReturnComplexTypeDictionary(Dictionary<int, string> a)
101+
{
102+
return a;
103+
}
104+
105+
public Array ReturnUntypedArray(Array a)
106+
{
107+
return a;
108+
}
109+
110+
public IList ReturnUntypedList(IList a)
111+
{
112+
return a;
113+
}
88114
}
89115

90116
public class IEnumerableFlow

0 commit comments

Comments
 (0)