Skip to content

Commit f23c58a

Browse files
committed
tests: fix protocol and queueing 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. Tests that use a custom cmdenv-log-prefix ("At %ts %N: ") have the method call lines prefixed accordingly, so a different pattern is used: %subst: /^At \S+ \S+: Method call [^\n]*\n//m Fixed protocol tests (6): Checksum_1, Checksum_2, Serialization_1, FragmentTagBasedFragmentation_1, FragmentNumberHeaderBasedFragmentation_1, FragmentTagAndFragmentNumberHeaderBasedFragmentation_1 Fixed queueing tests (49): all tests that check stdout output
1 parent 47adf29 commit f23c58a

55 files changed

Lines changed: 110 additions & 0 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

tests/protocol/Checksum_1.test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ cmdenv-event-banners = false
3939
*.source.packetLength = 100B
4040
*.source.productionInterval = 1s
4141

42+
%# remove method call lines added in OMNeT++ 6.4
43+
%subst: /^Method call [^\n]*\n//m
4244
%contains-regex: stdout
4345
Producing packet, .*?source-0.*?
4446
Passing through packet, .*?source-0.*?

tests/protocol/Checksum_2.test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ cmdenv-event-banners = false
3939
*.source.packetLength = 100B
4040
*.source.productionInterval = 1s
4141

42+
%# remove method call lines added in OMNeT++ 6.4
43+
%subst: /^Method call [^\n]*\n//m
4244
%contains-regex: stdout
4345
Producing packet, .*?source-0.*?
4446
Passing through packet, .*?source-0.*?

tests/protocol/FragmentNumberHeaderBasedFragmentation_1.test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ cmdenv-event-banners = false
4141
*.fragmenter.fragmenterPolicy.typename = "LengthBasedFragmenterPolicy"
4242
*.fragmenter.fragmenterPolicy.maxFragmentLength = 10B
4343

44+
%# remove method call lines added in OMNeT++ 6.4
45+
%subst: /^Method call [^\n]*\n//m
4446
%contains-regex: stdout
4547
Producing packet, .*?source-0.*?
4648
Fragmenting packet, .*?source-0.*?source-0-frag0.*?

tests/protocol/FragmentTagAndFragmentNumberHeaderBasedFragmentation_1.test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ cmdenv-event-banners = false
5151
*.fragmenter.fragmenterPolicy.typename = "LengthBasedFragmenterPolicy"
5252
*.fragmenter.fragmenterPolicy.maxFragmentLength = 10B
5353

54+
%# remove method call lines added in OMNeT++ 6.4
55+
%subst: /^Method call [^\n]*\n//m
5456
%contains-regex: stdout
5557
Producing packet, .*?source-0.*?
5658
Fragmenting packet, .*?source-0.*?source-0-frag0.*?

tests/protocol/FragmentTagBasedFragmentation_1.test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ cmdenv-event-banners = false
4141
*.fragmenter.fragmenterPolicy.typename = "LengthBasedFragmenterPolicy"
4242
*.fragmenter.fragmenterPolicy.maxFragmentLength = 10B
4343

44+
%# remove method call lines added in OMNeT++ 6.4
45+
%subst: /^Method call [^\n]*\n//m
4446
%contains-regex: stdout
4547
Producing packet, .*?source-0.*?
4648
Fragmenting packet, .*?source-0.*?source-0-frag0.*?

tests/protocol/Serialization_1.test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ cmdenv-event-banners = false
3939
*.source.packetLength = 100B
4040
*.source.productionInterval = 1s
4141

42+
%# remove method call lines added in OMNeT++ 6.4
43+
%subst: /^Method call [^\n]*\n//m
4244
%contains-regex: stdout
4345
Producing packet, .*?source-0.*?
4446
Consuming packet, .*?source-0.*?

tests/queueing/ActiveSourcePassiveSink_1.test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ cmdenv-log-prefix = "At %ts %N: "
3636
%subst: /\x1B\[[0-9;]*m//
3737

3838
%subst: /\nRunning simulation\.\.\.\n//
39+
%# remove method call lines added in OMNeT++ 6.4
40+
%subst: /^At \S+ \S+: Method call [^\n]*\n//m
3941

4042
%contains-regex: stdout
4143
At 0s producer: Producing packet, .*?producer-0.*?

tests/queueing/ActiveSourcePassiveSink_2.test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ cmdenv-log-prefix = "At %ts %N: "
3737
%subst: /\x1B\[[0-9;]*m//
3838

3939
%subst: /\nRunning simulation\.\.\.\n//
40+
%# remove method call lines added in OMNeT++ 6.4
41+
%subst: /^At \S+ \S+: Method call [^\n]*\n//m
4042

4143
%not-contains-regex: stdout
4244
Producing packet, .*?producer-0.*?

tests/queueing/ActiveSourcePassiveSink_3.test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ cmdenv-log-prefix = "At %ts %N: "
3737
%subst: /\x1B\[[0-9;]*m//
3838

3939
%subst: /\nRunning simulation\.\.\.\n//
40+
%# remove method call lines added in OMNeT++ 6.4
41+
%subst: /^At \S+ \S+: Method call [^\n]*\n//m
4042

4143
%not-contains-regex: stdout
4244
Producing packet, .*?producer-0.*?

tests/queueing/Buffer_1.test

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ cmdenv-log-prefix = "At %ts %N: "
6666
%subst: /\x1B\[[0-9;]*m//
6767

6868
%subst: /\nRunning simulation\.\.\.\n//
69+
%# remove method call lines added in OMNeT++ 6.4
70+
%subst: /^At \S+ \S+: Method call [^\n]*\n//m
6971

7072
%contains-regex: stdout
7173
At 0s producer1: Producing packet, .*?producer1-0.*?

0 commit comments

Comments
 (0)