Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reassign structlit test todos, add tests #258

Merged
merged 1 commit into from
Jan 13, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,36 +29,68 @@ type PointerHolder struct {
i *core.Innocuous
}

type InterfaceHolder struct {
i interface{}
}

type DoubleInterfaceHolder struct {
i interface{}
j interface{}
}

func TestStructLiteralContainingTaintedInterfaceIsTainted(s core.Source) {
ih := InterfaceHolder{
s,
}
core.Sink(ih) // TODO(#212) want "a source has reached a sink"
}

func TestStructLiteralContainingTaintedAndNonTaintedInterfaceValuesIsTainted(s core.Source, i core.Innocuous) {
dih := DoubleInterfaceHolder{
s,
i,
}
core.Sink(dih) // TODO(#212) want "a source has reached a sink"
}

func TestStructLiteralContainingTaintedAndNonTaintedInterfaceValuesIsTaintedFlipped(s core.Source, i core.Innocuous) {
dih := DoubleInterfaceHolder{
i,
s,
}
core.Sink(dih) // TODO(#212) want "a source has reached a sink"
}

func TestStructHoldingSourceAndInnocIsTainted(s core.Source, i core.Innocuous) {
h := Holder{
s,
i,
}
core.Sink(h) // TODO(#97) want "a source has reached a sink"
core.Sink(h) // TODO(#212) want "a source has reached a sink"
}

func TestStructHoldingSourceAndInnocIsTaintedReverseFieldOrder(s core.Source, i core.Innocuous) {
h := Holder{
i: i,
s: s,
}
core.Sink(h) // TODO(#97) want "a source has reached a sink"
core.Sink(h) // TODO(#212) want "a source has reached a sink"
}

func TestStructHoldingSourceAndInnocPointersIsTainted(s *core.Source, i *core.Innocuous) {
h := PointerHolder{
s,
i,
}
core.Sink(h) // TODO(#97) want "a source has reached a sink"
core.Sink(h) // TODO(#212) want "a source has reached a sink"
}

func TestStructHoldingSourceAndInnocPointersIsTaintedReverseFieldOrder(s *core.Source, i *core.Innocuous) {
h := PointerHolder{
i: i,
s: s,
}
core.Sink(h) // TODO(#97) want "a source has reached a sink"
core.Sink(h) // TODO(#212) want "a source has reached a sink"
}

func TestAnonymousStructHoldingSourceAndInnocIsTainted(s core.Source, i core.Innocuous) {
Expand All @@ -69,7 +101,7 @@ func TestAnonymousStructHoldingSourceAndInnocIsTainted(s core.Source, i core.Inn
i: i,
s: s,
}
core.Sink(h) // TODO(#97) want "a source has reached a sink"
core.Sink(h) // TODO(#212) want "a source has reached a sink"
}

func TestAnonymousStructHoldingSourceAndInnocPointersIsTainted(s *core.Source, i *core.Innocuous) {
Expand All @@ -80,5 +112,5 @@ func TestAnonymousStructHoldingSourceAndInnocPointersIsTainted(s *core.Source, i
i: i,
s: s,
}
core.Sink(h) // TODO(#97) want "a source has reached a sink"
core.Sink(h) // TODO(#212) want "a source has reached a sink"
}