aboutsummaryrefslogtreecommitdiffstats
path: root/tests/bitcomp
AgeCommit message (Collapse)AuthorFilesLines
2017-10-29tests: Don't use private version of log_info but global gprs_log_infoHarald Welte1-27/+2
There's no need for each test case to carry their own log_info and filter function. They can simply use the global gprs_log_info and configure the stderr log verbosity according to their needs. Change-Id: I8706a624e5d06e062d1198711aa197fbd0860769
2017-03-27bitcomp test: use expected rc instead of 'verify' flagNeels Hofmeyr2-41/+51
The 'verify' flag is useless, we always want to verify everything. Replace 'verify' with 'expect_rc', expecting a specific decoding result per test set. When an error code was returned, cut short the loop and skip printing expected vs. decoded bits. This uncovers the fact that the first test marked as "invalid inputs" does not seem to be invalid after all, or at least does not produce an error to be returned. For now, only uncover this fact, the fix shall be submitted later. Change-Id: Icf815a8f1acb0e275463408450171df046879847
2017-03-27bitcomp test: fix: also verify bits after decoded dataNeels Hofmeyr2-16/+5
Before this, the expected data had seemingly random bits set after the end of the expected decoding result. Make the test expect these extra bits as zero, matching with the buffer initialization to zero. In result_matches(), compare the full length of bytes instead of masking the bits after the end of the decoded data (which caused us to not catch the wrong expectation until now). This fixes the underlying issues found in http://lists.osmocom.org/pipermail/osmocom-net-gprs/2017-March/000876.html [osmo-pcu 0.2.896-0a8f] testsuite: 4 failed from: Arnaud ZANETTI on: Fri Mar 24 09:53:53 UTC 2017 Change-Id: I2501208e2f8b4f709efbcadbd1057c086472c9e6
2017-03-27bitcomp test: fix: only one hexdump per log; use printfNeels Hofmeyr2-19/+17
The test wants to write multiline results, so it should use printf instead of the logging system. Split logs to only one hexdump per printf(). One cannot use osmo_hexdump twice in one printf(); before this, one of the two hexdumps won, both dumps would show as the same. Very bad for a regression test! This uncovers a discrepancy between expected and produced results, proving that the expected stderr output was not capable of uncovering test failures. The test's check_result() function *has* always verified the decoded data, but only up to the last decoded bit. Our expected data contains seemingly random bits after the end of the decoded bits, but check_result() never compares those, hence we don't catch that error. The extra bits should definitely be zero, because the destination buffer is pre-initialized to zero -- fixed in a subsequent patch. This should cosmetically fix the build failure found in: http://lists.osmocom.org/pipermail/osmocom-net-gprs/2017-March/000876.html [osmo-pcu 0.2.896-0a8f] testsuite: 4 failed from: Arnaud ZANETTI on: Fri Mar 24 09:53:53 UTC 2017 The real fix will follow. Change-Id: I24fc32eb55baaf22f9c6fdda917bfb8395d02b1c
2017-03-27cosmetic: BitcompTest: make readableNeels Hofmeyr1-37/+45
In order to understand what the bitcomp test is logging, cosmetically rearrange the code: - memset bits_data before assigning to destination bitvec. - use macro CEIL_DIV_8 to clarify what (x+7)/8 does. - rename check_result() to result_matches() and return a bool, also constify result_matches() args and pass a bitvec reference instead of copying the bitvec struct. - rearrange logging lines to make readable what is going on there. - drop unused 'init_flag' There are obviously errors like double hexdumps per log line, multiple newlines in a LOGP statement and so forth: these shall be fixed by subsequent patches. Change-Id: Id0da9d9b67f4713d3a67e3532ed44b8cb1bd1d08
2017-02-08Fix dozens of compiler warnings across the boardNeels Hofmeyr1-2/+2
Change-Id: I166109dc05d3323b92cd2a42f0c7e6009950e15d
2016-10-17EGPRS: Add EPDAN CRBB Tree based decodingPravin Kumarvel3-0/+370
Implemented tree based algorithm to decode compressed bitmap in EPDAN as described in section 9.1.10 of 3GPP 44.060. This algorithm intends to improve the performance over existing method. New Regression test is added under bitcomp directory. Test case is added to validate decompressed result of the bitmap Present in EPDAN. Test is done for multiple bitmaps of varying length. Invalid inputs are also part of the test vector. Change-Id: Ieae1992ed4b02bb1e09eec2d3de1a030eabd16ce