Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*****************************************************************
** @author STF 487
** @version 0.0.1
** @purpose 1:6.2.10, Ensure that extending a component with several other component works properly
** @verdict pass accept, ttcn3verdict:pass
*****************************************************************/
/* The following requirements are tested:
* When defining component types by extending more than one parent type,
* there shall be no name clash between the definitions of the different parent types,
* i.e. there shall not be a port, variable, constant or timer identifier that is declared
* in any two of the parent types (directly or by means of extension).
*/
module Sem_060210_ReuseofComponentTypes_002 {
//MyCompA has a port pt_myPortA
type component MyCompA {
port loopbackPort pt_myPortA;
}
//MyComp has a port pt_myPortB
type component MyCompB {
port loopbackPort pt_myPortB;
}
//Component GeneralComp has a timer and inherit two ports from MyCompA and MyCompB
type component GeneralComp extends MyCompA, MyCompB {
timer t;
}
type port loopbackPort message {
inout integer;
inout float;
}
testcase TC_Sem_060210_ReuseofComponentTypes_002() runs on GeneralComp {
//Send an integer from pt_myPortA:
pt_myPortA.send(2);
alt {
[] pt_myPortA.receive(2) {
setverdict(pass);
}
[] pt_myPortA.receive {
setverdict(fail);
}
}
//Send an integer from pt_myPortB:
pt_myPortB.send(1.0);
alt {
[] pt_myPortB.receive(1.0) {
setverdict(pass);
}
[] pt_myPortB.receive {
setverdict(fail);
}
}
}
control{
execute(TC_Sem_060210_ReuseofComponentTypes_002());
}
}