aboutsummaryrefslogtreecommitdiffstats
path: root/tests/rlcmac/RLCMACTest.cpp
AgeCommit message (Collapse)AuthorFilesLines
2016-09-14Fix CSN1 decoding: CSN_LEFT_ALIGNED_VAR_BMP boundsNeels Hofmeyr1-6/+1
Fix attempted read past vector boundaries in case of a starting bit offset != 0, so that the last amount of bits read should be < 8. In the case of CSN_LEFT_ALIGNED_VAR_BMP, the mod-8 calculation was flawed, and in the final step, 8 bits were read instead of the remainder < 8. This lead to -EINVAL being returned by bitvec_get_bit_pos() and bogus resulting data. Instead, read 8 bits only as long as at least 8 bits remain, and read any remaining bits < 8 in a final step. Drop unneeded nB1 variable and an obvious comment. Adjust the unit test assertion in testCsnLeftAlignedVarBmpBounds() in RLCMACTest.cpp. Based on a fix by Aravind Sirsikar <Arvind.Sirsikar@radisys.com>, but implemented differently. Related: OS#1805 Change-Id: I490498c8da6b531f54acb673379379f7b10907c0
2016-09-14CSN1 decoding: add test to show bug in CSN_LEFT_ALIGNED_VAR_BMPAravind Sirsikar1-1/+22
CSN1 decoding currently contains an attempted read past vector boundaries in case of a starting bit offset != 0, so that the last amount of bits read should be < 8. In the case of CSN_LEFT_ALIGNED_VAR_BMP, the mod-8 calculation is flawed, and in what should be the final step of reading n < 8 bits, 8 bits are read instead of n (with an extraneous read of n bits following after that). This leads to -EINVAL being returned by bitvec_get_bit_pos() and bogus resulting data. Add testCsnLeftAlignedVarBmpBounds() in RLCMACTest.cpp to show and expect this bug. The test's expectation shall be corrected along with the bug fix in a subsequent commit. Related: OS#1805 Tweaked-by: Neels Hofmeyr <nhofmeyr@sysmocom.de> Change-Id: I4641f5d1d49f66cb1a5cd813befb3a2a266001b0
2016-03-16Fix issue in encoding CSN_RECURSIVE_ARRAYSaurabh Sharan1-0/+1
The remaining_bits_len is correctly decremented while encoding CSN_RECURSIVE_ARRAY for fixing the bug. Details of the bug is in https://projects.osmocom.org/issues/1641 During introduction of basic EGPRS feature new hex dump message PUASS, from a different working network log was used in Unit test. It exposed the issue of incorrect handling of recursive array encoding in osmo-pcu. Fixes: OS#1641
2016-03-15Add test vectors for EGPRS messagesSaurabh Sharan1-2/+5
This patch is the test suite modification for the fix encoding of padding bits. New test vectors have been added both in downlink and uplink.
2016-03-15Fix encoding of padding bits to start with 0 bitSaurabh Sharan1-3/+3
This patch is for fixing encoding of padding bits according to the 3gpp spec 44.060 section 11, wherein it shall always start with 0 bit followed with spare padding bits. During introduction of basic EGPRS feature new hex dump messages from a different working network log were used in Unit test. These exposed the issue of incorrect handling of padding bits encoding in osmo-pcu. Corrections in the existing test vector of rlcmac is also updated. In testsuite tbf appropriate corrections for the Tbftest.err is also done.
2013-08-02tests: Move the RLCMACTest into the test directory and setup autotestHolger Hans Peter Freyther1-0/+218