C#: Address review comments

This commit is contained in:
Tom Hvitved
2018-10-25 14:15:09 +02:00
parent a683990bfd
commit a3d74b00e0
3 changed files with 10 additions and 10 deletions

View File

@@ -9,7 +9,7 @@ abstract class AssertMethod extends Method {
abstract int getAssertionIndex();
/** Gets the parameter being asserted. */
final Parameter getAssertionParameter() {
final Parameter getAssertedParameter() {
result = this.getParameter(this.getAssertionIndex())
}
@@ -44,7 +44,7 @@ class Assertion extends MethodCall {
/** Gets the expression that this assertion pertains to. */
Expr getExpr() {
result = this.getArgumentForParameter(target.getAssertionParameter())
result = this.getArgumentForParameter(target.getAssertedParameter())
}
}
@@ -55,10 +55,10 @@ class FailingAssertion extends Assertion {
am = this.getAssertMethod() and
e = this.getExpr() |
am instanceof AssertTrueMethod and
e.(BoolLiteral).getBoolValue() = false
e.getValue() = "false"
or
am instanceof AssertFalseMethod and
e.(BoolLiteral).getBoolValue() = true
e.getValue() = "true"
)
}
}

View File

@@ -1,25 +1,25 @@
import csharp
class Stub extends File {
Stub() {
class StubFile extends File {
StubFile() {
this.getAbsolutePath().matches("%resources/stubs/%")
}
}
class SourceControlFlowElement extends ControlFlowElement {
SourceControlFlowElement() {
not this.getLocation().getFile() instanceof Stub
not this.getLocation().getFile() instanceof StubFile
}
}
class SourceControlFlowNode extends ControlFlow::Node {
SourceControlFlowNode() {
not this.getLocation().getFile() instanceof Stub
not this.getLocation().getFile() instanceof StubFile
}
}
class SourceBasicBlock extends ControlFlow::BasicBlock {
SourceBasicBlock() {
not this.getLocation().getFile() instanceof Stub
not this.getLocation().getFile() instanceof StubFile
}
}