Files
osmo-mgw/openbsc/tests/mgcp/mgcp_test.ok
Jacob Erlbeck 2bee7f96ff mgcp: Add new for_each_line macro that also returns empty lines
This patch add the for_each_line macro based on a strline_r()
function (similar to strtok_r()), that is also part of this patch.
This strline_r() function is tolerant with respect to line endings,
it supports CR-only, CRLF, and LF-only and any combinations thereof
(note that a CRLF is always detected as a single line break).

Similar to for_each_non_empty_line (the former for_each_line) where
the 'save' pointer needed to be initialised by a call to strtok_r(),
the new for_each_line macro expects, that the 'save' pointer has been
initialised by a call to strline_r(). Also note, that
for_each_line/strline_r and for_each_non_empty_line/strtok_r may use
the 'save' pointer differently, so calls to them can not be mixed.

Sponsored-by: On-Waves ehf
2013-12-05 10:27:32 +01:00

61 lines
1.3 KiB
Plaintext

line: 'one CR'
line: 'two CR'
line: ''
line: 'one CRLF'
line: 'two CRLF'
line: ''
line: 'one LF'
line: 'two LF'
line: ''
line: 'mixed (4 lines)'
line: ''
line: ''
line: ''
Testing AUEP1
Testing AUEP2
Testing MDCX1
Testing MDCX2
Testing CRCX
Testing MDCX3
Testing DLCX
Testing CRCX_ZYN
Testing EMPTY
Testing SHORT1
Testing SHORT2
Testing SHORT3
Testing SHORT4
Testing RQNT1
Testing RQNT2
Testing DLCX
Testing CRCX
Re-transmitting CRCX
Testing RQNT1
Re-transmitting RQNT1
Testing RQNT2
Re-transmitting RQNT2
Testing MDCX3
Re-transmitting MDCX3
Testing DLCX
Re-transmitting DLCX
Testing packet loss calculation.
Testing stat parsing
Parsing result: 0
Parsing result: 0
Testing packet error detection.
TS: 0, dTS: 0, TS Errs: in 0, out 0
TS: 160, dTS: 160, TS Errs: in 0, out 0
TS: 320, dTS: 160, TS Errs: in 0, out 0
TS: 320, dTS: 160, TS Errs: in 1, out 1
TS: 480, dTS: 160, TS Errs: in 1, out 1
TS: 640, dTS: 160, TS Errs: in 1, out 1
TS: 960, dTS: 320, TS Errs: in 2, out 2
TS: 1120, dTS: 160, TS Errs: in 3, out 3
TS: 1280, dTS: 160, TS Errs: in 3, out 3
TS: 1400, dTS: 120, TS Errs: in 4, out 4
TS: 1560, dTS: 160, TS Errs: in 5, out 5
TS: 1720, dTS: 160, TS Errs: in 5, out 5
TS: 1880, dTS: 160, TS Errs: in 5, out 5
TS: 2040, dTS: 160, TS Errs: in 5, out 5
TS: 2200, dTS: 160, TS Errs: in 5, out 5
Done