Skip to content

Commit

Permalink
C#: Adjust existing model generator tests and update expected output.
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelnebel committed Sep 9, 2024
1 parent fe206ff commit b7d00a4
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions csharp/ql/test/utils/modelgenerator/dataflow/Summaries.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,14 @@ public string ReturnField()

public class CollectionFlow
{
private string tainted;
private readonly string tainted;

// summary=Models;CollectionFlow;false;CollectionFlow;(System.String);;Argument[0];Argument[this];taint;df-generated
// contentbased-summary=Models;CollectionFlow;false;CollectionFlow;(System.String);;Argument[0];Argument[this].SyntheticField[Models.CollectionFlow.tainted];value;df-generated
public CollectionFlow(string s)
{
tainted = s;
}

// summary=Models;CollectionFlow;false;ReturnArrayElement;(System.Object[]);;Argument[0].Element;ReturnValue;taint;df-generated
// contentbased-summary=Models;CollectionFlow;false;ReturnArrayElement;(System.Object[]);;Argument[0].Element;ReturnValue;value;df-generated
Expand Down Expand Up @@ -177,7 +184,14 @@ public Dictionary<int, int> ReturnSimpleTypeDictionary(Dictionary<int, int> a)

public class IEnumerableFlow
{
private string tainted;
private readonly string tainted;

// summary=Models;IEnumerableFlow;false;IEnumerableFlow;(System.String);;Argument[0];Argument[this];taint;df-generated
// contentbased-summary=Models;IEnumerableFlow;false;IEnumerableFlow;(System.String);;Argument[0];Argument[this].SyntheticField[Models.IEnumerableFlow.tainted];value;df-generated
public IEnumerableFlow(string s)
{
tainted = s;
}

// SPURIOUS-summary=Models;IEnumerableFlow;false;ReturnIEnumerable;(System.Collections.Generic.IEnumerable<System.String>);;Argument[0].Element;ReturnValue;taint;df-generated
// contentbased-summary=Models;IEnumerableFlow;false;ReturnIEnumerable;(System.Collections.Generic.IEnumerable<System.String>);;Argument[0];ReturnValue;value;df-generated
Expand Down Expand Up @@ -611,10 +625,17 @@ public abstract class D : IPublic3

public class DImpl : D
{
private string tainted;
private readonly string tainted;

// summary=Models;Inheritance+DImpl;false;DImpl;(System.String);;Argument[0];Argument[this];taint;df-generated
// contentbased-summary=Models;Inheritance+DImpl;false;DImpl;(System.String);;Argument[0];Argument[this].SyntheticField[Models.Inheritance+DImpl.tainted];value;df-generated
public DImpl(string s)
{
tainted = s;
}

// summary=Models;Inheritance+IPublic3;true;get_Prop;();;Argument[this];ReturnValue;taint;df-generated
// contentbased-summary=Models;Inheritance+IPublic3;true;get_Prop;();;Argument[this].SyntheticField[Models.Inheritance+DImpl.tainted];ReturnValue;value;df-generated
// contentbased-summary=Models;Inheritance+DImpl;true;get_Prop;();;Argument[this].SyntheticField[Models.Inheritance+DImpl.tainted];ReturnValue;value;df-generated
public override string Prop { get { return tainted; } }
}
}
Expand Down

0 comments on commit b7d00a4

Please sign in to comment.