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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
module test_LibItsDenm_TypesAndValues /*language "TTCN-3:2009 Advanced Parameterization"*/ {
import from test_CommonCodec all;
import from DENM_PDU_Descriptions language "ASN.1:1997" all
with {
encode "LibItsDenm_asn1"
}
import from LibItsDenm_TestSystem all;
import from LibItsDenm_Templates all;
import from LibItsDenm_TypesAndValues all;
import from LibItsCommon_TypesAndValues all;
import from LibItsDenm_Functions all;
import from LibItsCommon_Functions all;
group testUtEvent {
testcase tc_UtDenmInitialize() runs on TCType system TCType {
test_PDU<UtInitialize>(m_denmInitialize, false);
}
testcase tc_eventSituation() runs on TCType system TCType {
test_PDU<UtEvent>(m_utEvent(m_situation(c_causeVehicleProblem, c_subCauseUnknown)), false);
}
testcase tc_eventCancellation() runs on TCType system TCType {
test_PDU<UtEvent>(m_utEventCancellation(m_situation(c_causeSlowVehicle, c_subCauseUnknown), { f_getTsStationId(), 170 }), false);
}
testcase tc_eventNegation() runs on TCType system TCType {
test_PDU<UtEvent>(m_utEventNegation(m_situation(c_causeWrongWayDriving, c_subCauseUnknown), { f_getTsStationId(), 170 }), false);
}
testcase tc_eventTrafficFlowEffect() runs on TCType system TCType {
test_PDU<UtEvent>(m_utEventTrafficFlowEffect(m_situation(c_causeExtremWeatherCondition, c_subCauseUnknown), c_tfeFreeTrafficFlow), false);
}
testcase tc_eventLinkedCause() runs on TCType system TCType {
test_PDU<UtEvent>(m_utEventLinkedCause(m_situation(c_causeAccident, c_subCauseUnknown), m_situation(c_causeExtremWeatherCondition, c_subCauseUnknown)), false);
}
testcase tc_eventExpirationTime() runs on TCType system TCType {
test_PDU<UtEvent>(m_utEventExpirationTime(m_situation(c_causeVehicleProblem, c_subCauseUnknown), 281474976710655), false);
}
testcase tc_eventExpirationTimeFrequency() runs on TCType system TCType {
test_PDU<UtEvent>(m_utEventExpirationTimeFrequency(m_situation(c_causeVehicleProblem, c_subCauseUnknown), 281474976710655, 255), false);
}
testcase tc_eventCharact() runs on TCType system TCType {
test_PDU<UtEvent>(m_utEventCharact(m_situation(c_causeVehicleProblem, c_subCauseUnknown), m_eventCharact), false);
}
testcase tc_checkDenmEvent() runs on TCType system TCType {
var template (value) UtCheck v_utMsg := { m_utEvent(m_situation(c_causeVehicleProblem, c_subCauseUnknown)) };
test_PDU<UtCheck>(v_utMsg, false);
}
testcase tc_checkDenmEventNegation() runs on TCType system TCType {
var template (value) UtCheck v_utMsg := { m_utEventNegation(m_situation(c_causeWrongWayDriving, c_subCauseUnknown), { f_getTsStationId(), 170 }) };
test_PDU<UtCheck>(v_utMsg, false);
}
testcase tc_checkDenmEventCancellation() runs on TCType system TCType {
var template (value) UtCheck v_utMsg := { m_utEventCancellation(m_situation(c_causeVehicleProblem, c_subCauseBrakeDownVehicle), { f_getTsStationId(), 170 }) };
test_PDU<UtCheck>(v_utMsg, false);
}
} // End of group testUtEvent
group testDenmPrimitiveMessages {
template (value) DenmInd m_denmInd(template (value) DenmPdu p_denMsg) := {
msgIn := p_denMsg,
receptionTime := 1234587
}
testcase tc_DenmReq() runs on TCType system TCType {
test_PDU<DenmReq>(
m_denmReq(
m_denmPdu(
f_getCurrentTime(),
m_denmWithCause(
0,
m_situation(c_causeVehicleProblem, c_subCauseUnknown),
m_eventPosition(m_tsPosition),
f_getTsStationId()))),
false);
}
testcase tc_DenmReqOutdated() runs on TCType system TCType {
test_PDU<DenmReq>(
m_denmReq(
m_denmPdu(
f_getCurrentTime(),
m_denmWithCause(
0,
m_situation(c_causeSlowVehicle, c_subCauseUnknown),
m_eventPosition(m_tsPosition),
f_getTsStationId()))),
false);
}
testcase tc_DenmInd() runs on TCType system TCType {
test_PDU<DenmInd>(
m_denmInd(
m_denmPdu(
f_getCurrentTime(),
m_denmWithCause(
0,
m_situation(c_causeSlowVehicle, c_subCauseUnknown),
m_eventPosition(m_tsPosition),
f_getTsStationId()))),
false);
}
testcase tc_test() runs on TCType system TCType {
var DenmPdu v_decMsg;
var integer v_res := 0;
v_res := decvalue(oct2bit('00010133a6bf49d07302172f800000002674d823d200391f20000000001ff01000400010802317d1109404000884400400000000000004000000007ffd7fe0000001f81abe34a1eade9e30026e100008ebbb265cda7765c8000000002008c00046bc387a'O), v_decMsg);
select (v_res) {
case (0) {
log(v_decMsg);
setverdict(pass);
}
case (1) {
setverdict(fail, "Decoding failed.");
}
case (2) {
setverdict(fail, "Not enough bits.");
}
}
// var DenmPdu bla := { header := { protocolVersion := 0, messageID := 1, generationTime := 1321352514000 }, denm := { management := { actionID := { stationID := 2551232892, sequenceNo := 0 }, dataVersion := 0, expiryTime := 1321352634000, frequency := 1, reliability := 100, isNegation := false }, situation := { trafficFlowEffect := 1, situation := { cause := 0, subCause := 0 }, linkedCause := { cause := 0, subCause := 0 }, severity := informative, eventCharact := { eventmobility := false, causeType := itsStation, relevance := physicallyRelevant, timeCriticality := false }, vehicleCommonParameters := { vehicleType := 1, stationLength := 1, stationLengthConfidence := 0, stationWidth := 1, stationWidthConfidence := 0, vehicleSpeed := 38, vehicleSpeedConfidence := 1, longAcceleration := 1, longAccelerationConfidence := 1, accelerationControl := '010000000'B, yawRate := { yawDirection := right, yawRateValue := 1 }, yawRateConfidence := 1, exteriorLights := '10000000'B, turnAdvice := { direction := '00000000'B, distance := 0 }, distanceToStopLine := 0, occupancy := 0, doorOpen := '00000000'B, posConfidenceEllipse := { semiMajorConfidence := 0, semiMinorConfidence := 0, semiMajorOrientation := 0 }, curvature := 0, curvatureChange := 0, curvatureConfidence := 0, crashStatus := false, headingConfidence := 0, dangerousGoods := 0 }, profile := {basicVehicle := { }} }, location := { eventPosition := {eventPositionCurrentDefinition := { refPosition := { longitude := { hemisphere := east, degree := 56084116 }, latitude := { hemisphere := north, degree := 514714083 }, elevation := -47, heading := 0, streetName := "undefined", positionConfidence := 0, elevationConfidence := 0, roadSegmentID := 0 }, eventSpeed := 38 }}, locationRef := {trace := { traceID := 0, waypoints := {} }}, relevanceArea := omit } } };
}
} // End of group testDenmPrimitiveMessages
}