From 83b3125dea128cd77da41793bb8762ea4dd81fab Mon Sep 17 00:00:00 2001 From: Michael Nebel Date: Wed, 24 Aug 2022 15:05:15 +0200 Subject: [PATCH] C#: Some test examples of collection like types that should be excluded. --- .../test/utils/model-generator/NoSummaries.cs | 21 +++++++++++++++ .../test/utils/model-generator/Summaries.cs | 26 +++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/csharp/ql/test/utils/model-generator/NoSummaries.cs b/csharp/ql/test/utils/model-generator/NoSummaries.cs index 5d1f26574b0..112857f504e 100644 --- a/csharp/ql/test/utils/model-generator/NoSummaries.cs +++ b/csharp/ql/test/utils/model-generator/NoSummaries.cs @@ -1,4 +1,5 @@ using System; +using System.Collections.Generic; namespace NoSummaries; @@ -110,4 +111,24 @@ public abstract class BaseClass // Negative summary. public abstract string M2(string s); +} + +// No methods in this class will have generated flow as +// the simple types used in the collection are not bulk data types. +public class CollectionFlow +{ + public int[] ReturnSimpleTypeArray(int[] a) + { + return a; + } + + public List ReturnSimpleTypeList(List a) + { + return a; + } + + public Dictionary ReturnSimpleTypeDictionary(Dictionary a) + { + return a; + } } \ No newline at end of file diff --git a/csharp/ql/test/utils/model-generator/Summaries.cs b/csharp/ql/test/utils/model-generator/Summaries.cs index fe82980db9c..28e777700f2 100644 --- a/csharp/ql/test/utils/model-generator/Summaries.cs +++ b/csharp/ql/test/utils/model-generator/Summaries.cs @@ -1,5 +1,6 @@ using System; using System.Linq; +using System.Collections; using System.Collections.Generic; namespace Summaries; @@ -85,6 +86,31 @@ public class CollectionFlow { return new List { tainted }; } + + public string[] ReturnComplexTypeArray(string[] a) + { + return a; + } + + public List ReturnBulkTypeList(List a) + { + return a; + } + + public Dictionary ReturnComplexTypeDictionary(Dictionary a) + { + return a; + } + + public Array ReturnUntypedArray(Array a) + { + return a; + } + + public IList ReturnUntypedList(IList a) + { + return a; + } } public class IEnumerableFlow