@@ -5,12 +5,10 @@ module AstTest {
5
5
private import semmle.code.cpp.dataflow.DataFlow:: DataFlow
6
6
private import semmle.code.cpp.dataflow.internal.DataFlowPrivate
7
7
8
- class AstParameterDefTest extends InlineExpectationsTest {
9
- AstParameterDefTest ( ) { this = "AstParameterDefTest " }
8
+ module AstParameterDefTest implements TestSig {
9
+ string getARelevantTag ( ) { result = "ast-def " }
10
10
11
- override string getARelevantTag ( ) { result = "ast-def" }
12
-
13
- override predicate hasActualResult ( Location location , string element , string tag , string value ) {
11
+ predicate hasActualResult ( Location location , string element , string tag , string value ) {
14
12
exists ( Function f , Parameter p , RefParameterFinalValueNode n |
15
13
p .isNamed ( ) and
16
14
n .getParameter ( ) = p and
@@ -21,6 +19,10 @@ module AstTest {
21
19
value = p .getName ( )
22
20
)
23
21
}
22
+
23
+ predicate hasOptionalResult ( Location location , string element , string tag , string value ) {
24
+ none ( )
25
+ }
24
26
}
25
27
}
26
28
@@ -33,12 +35,10 @@ module IRTest {
33
35
( if k = 0 then result = "" else result = "*" + stars ( k - 1 ) )
34
36
}
35
37
36
- class IRParameterDefTest extends InlineExpectationsTest {
37
- IRParameterDefTest ( ) { this = "IRParameterDefTest" }
38
-
39
- override string getARelevantTag ( ) { result = "ir-def" }
38
+ module IRParameterDefTest implements TestSig {
39
+ string getARelevantTag ( ) { result = "ir-def" }
40
40
41
- override predicate hasActualResult ( Location location , string element , string tag , string value ) {
41
+ predicate hasActualResult ( Location location , string element , string tag , string value ) {
42
42
exists ( Function f , Parameter p , FinalParameterNode n |
43
43
p .isNamed ( ) and
44
44
n .getParameter ( ) = p and
@@ -49,5 +49,11 @@ module IRTest {
49
49
value = stars ( n .getIndirectionIndex ( ) ) + p .getName ( )
50
50
)
51
51
}
52
+
53
+ predicate hasOptionalResult ( Location location , string element , string tag , string value ) {
54
+ none ( )
55
+ }
52
56
}
53
57
}
58
+
59
+ import MakeTest< MergeTests< AstTest:: AstParameterDefTest , IRTest:: IRParameterDefTest > >
0 commit comments