Skip to content

Commit 47adf29

Browse files
committed
tests: fix unit and module tests broken by OMNeT++ 6.4 method call logging
OMNeT++ 6.4 unconditionally prints "Method call" lines to the simulation output whenever a direct method call crosses module boundaries. These lines are now interleaved with the regular log output, causing %contains and %contains-regex checks in several tests to fail. Fix the affected tests by adding a %subst directive that strips these lines before the output is matched against the expected patterns: %subst: /^Method call [^\n]*\n//m For tests that use a custom cmdenv-log-prefix ("At %ts %N: "), the method call lines carry that prefix, so a different pattern is used: %subst: /^At \S+ \S+: Method call [^\n]*\n//m Fixed unit tests (3): Clock_OscillatorCompensation_4, _5, _6 Fixed module tests (13): pingapp_lifecycle_1..8, EtherHost_lifecycle, IPv4_ICMPerror_NoProtocol, ExternalProcess_3, PacketGate_1, PriorityScheduler_1
1 parent 719d5e6 commit 47adf29

16 files changed

Lines changed: 35 additions & 0 deletions

tests/module/EtherHost_lifecycle.test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,8 @@ network Test
8787

8888
%#--------------------------------------------------------------------------------------------------------------
8989
%subst: /DEBUG: //
90+
%# remove method call lines added in OMNeT++ 6.4
91+
%subst: /^Method call [^\n]*\n//m
9092
%#--------------------------------------------------------------------------------------------------------------
9193

9294
%#--------------------------------------------------------------------------------------------------------------

tests/module/ExternalProcess_3.test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ scheduler-class = "inet::RealTimeScheduler"
2929
*.externalProcess[1].command = "killall ping"
3030
*.externalProcess[1].startTime = 1s
3131

32+
%# remove method call lines added in OMNeT++ 6.4
33+
%subst: /^Method call [^\n]*\n//m
3234
%#--------------------------------------------------------------------------------------------------------------
3335
%contains-regex: stdout
3436
\*\* Event #1 t=0 on startTimer \(omnetpp::cMessage\) in TestNetwork.externalProcess\[0\] \(ExternalProcess, id=2\)

tests/module/IPv4_ICMPerror_NoProtocol.test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ snapshot-file = "${resultdir}/${configname}-${runnumber}.sna"
4949
%#--------------------------------------------------------------------------------------------------------------
5050
%subst: /DETAIL: //
5151
%subst: /ERROR: //
52+
%# remove method call lines added in OMNeT++ 6.4
53+
%subst: /^Method call [^\n]*\n//m
5254
%#--------------------------------------------------------------------------------------------------------------
5355
%contains: stdout
5456
Transport protocol 'udp' not connected, discarding packet

tests/module/PacketGate_1.test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,8 @@ cmdenv-log-prefix = "At %ts %N: "
140140
*.gate.openTime = 1s
141141
*.gate.closeTime = 3s
142142

143+
%# remove method call lines added in OMNeT++ 6.4
144+
%subst: /^At \S+ \S+: Method call [^\n]*\n//m
143145
%contains-regex: stdout
144146
At 1s gate: Opening gate.
145147
At 2s source: Starting packet streaming, [^\n]*?

tests/module/PriorityScheduler_1.test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,8 @@ cmdenv-log-prefix = "At %ts %N: "
153153
*.gate.openTime = 1s
154154
*.gate.closeTime = 3s
155155

156+
%# remove method call lines added in OMNeT++ 6.4
157+
%subst: /^At \S+ \S+: Method call [^\n]*\n//m
156158
%contains-regex: stdout
157159
At 0s source: Starting packet streaming, [^\n]*?
158160
At 0s scheduler: Starting packet streaming, [^\n]*?

tests/module/pingapp_lifecycle_1.test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@ network Test
4848
</at>
4949
</scenario>
5050

51+
%# remove method call lines added in OMNeT++ 6.4
52+
%subst: /^Method call [^\n]*\n//m
5153
%#--------------------------------------------------------------------------------------------------------------
5254
%contains-regex: stdout
5355
.*

tests/module/pingapp_lifecycle_2.test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ network Test
4949

5050
%#--------------------------------------------------------------------------------------------------------------
5151
%subst: /DEBUG: //
52+
%# remove method call lines added in OMNeT++ 6.4
53+
%subst: /^Method call [^\n]*\n//m
5254
%contains-regex: stdout
5355
.*
5456
\*\* Event #\d+ t=3 on sendPing \(omnetpp::cMessage\) in Test\.host\.app\[0\] \(PingApp, id=\d+\)

tests/module/pingapp_lifecycle_3.test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ network Test
4949
<startup module="host"/>
5050
</at>
5151
</scenario>
52+
%# remove method call lines added in OMNeT++ 6.4
53+
%subst: /^Method call [^\n]*\n//m
5254
%#--------------------------------------------------------------------------------------------------------------
5355
%contains-regex: stdout
5456

tests/module/pingapp_lifecycle_4.test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ network Test
5050

5151
%#--------------------------------------------------------------------------------------------------------------
5252
%subst: /DEBUG: //
53+
%# remove method call lines added in OMNeT++ 6.4
54+
%subst: /^Method call [^\n]*\n//m
5355
%contains-regex: stdout
5456
\*\* Event #\d+ t=0 on sendPing \(omnetpp::cMessage\) in Test\.host\.app\[0\] \(PingApp, id=\d+\)
5557
Starting up: dest=192\.168\.0\.42 src=<none>seqNo=0

tests/module/pingapp_lifecycle_5.test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,8 @@ network Test
4949
</at>
5050
</scenario>
5151

52+
%# remove method call lines added in OMNeT++ 6.4
53+
%subst: /^Method call [^\n]*\n//m
5254
%#--------------------------------------------------------------------------------------------------------------
5355
%contains-regex: stdout
5456
\*\* Event #\d+ t=3 on scenario-event \(inet::ScenarioTimer\) in Test\.scenarioManager \(ScenarioManager, id=\d+\)

0 commit comments

Comments
 (0)