summaryrefslogtreecommitdiffstats
path: root/tests/bits/bitrev_test.ok
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2016-06-17 17:58:52 +0200
committerMax <msuraev@sysmocom.de>2016-06-20 19:02:56 +0200
commite0a7d9e2c220e5544ee8982c78851ff40ac425bc (patch)
tree5b3c65a05ef3ab52f4808dae5f3632f8fdebe960 /tests/bits/bitrev_test.ok
parent136e73764e7f58e52ffb13d01304fef30eb7d291 (diff)
Add octet-aligned/unaligned shift functions
The actual code is from OsmoBTS' tch.c by Harald Welte. Add unit tests, doxygen annotation and extra memory safety check. Those functions are used in several BTS implementations but seems generic enough to be generally useful. Change-Id: I2b1901c4161e8035f059585901dca593b661556d
Diffstat (limited to 'tests/bits/bitrev_test.ok')
-rw-r--r--tests/bits/bitrev_test.ok105
1 files changed, 105 insertions, 0 deletions
diff --git a/tests/bits/bitrev_test.ok b/tests/bits/bitrev_test.ok
index 90cb295f..9fbb4d9c 100644
--- a/tests/bits/bitrev_test.ok
+++ b/tests/bits/bitrev_test.ok
@@ -53,3 +53,108 @@ running random tests...
24 LE OK
16 BE OK, storage OK
16 LE OK
+running nibble tests...
+[8] R IN: f00dcafedeadbeef, nibble 0:
+ OUT:
+[8] L IN: f00dcafedeadbeef, nibble 0:
+ OUT:
+[6] R IN: b00bbabeface, nibble 0:
+ OUT:
+[6] L IN: b00bbabeface, nibble 0:
+ OUT:
+[8] R IN: f00dcafedeadbeef, nibble 1:
+ OUT:
+[8] L IN: f00dcafedeadbeef, nibble 1:
+ OUT:
+[6] R IN: b00bbabeface, nibble 1:
+ OUT:
+[6] L IN: b00bbabeface, nibble 1:
+ OUT:
+[8] R IN: f00dcafedeadbeef, nibble 2:
+ OUT: 0f
+[8] L IN: f00dcafedeadbeef, nibble 2:
+ OUT: 00
+[6] R IN: b00bbabeface, nibble 2:
+ OUT: 0b
+[6] L IN: b00bbabeface, nibble 2:
+ OUT: 00
+[8] R IN: f00dcafedeadbeef, nibble 3:
+ OUT: 0f
+[8] L IN: f00dcafedeadbeef, nibble 3:
+ OUT: 00
+[6] R IN: b00bbabeface, nibble 3:
+ OUT: 0b
+[6] L IN: b00bbabeface, nibble 3:
+ OUT: 00
+[8] R IN: f00dcafedeadbeef, nibble 4:
+ OUT: 0f00
+[8] L IN: f00dcafedeadbeef, nibble 4:
+ OUT: 00dc
+[6] R IN: b00bbabeface, nibble 4:
+ OUT: 0b00
+[6] L IN: b00bbabeface, nibble 4:
+ OUT: 00bb
+[8] R IN: f00dcafedeadbeef, nibble 5:
+ OUT: 0f00
+[8] L IN: f00dcafedeadbeef, nibble 5:
+ OUT: 00dc
+[6] R IN: b00bbabeface, nibble 5:
+ OUT: 0b00
+[6] L IN: b00bbabeface, nibble 5:
+ OUT: 00bb
+[8] R IN: f00dcafedeadbeef, nibble 6:
+ OUT: 0f00dc
+[8] L IN: f00dcafedeadbeef, nibble 6:
+ OUT: 00dcaf
+[6] R IN: b00bbabeface, nibble 6:
+ OUT: 0b00bb
+[6] L IN: b00bbabeface, nibble 6:
+ OUT: 00bbab
+[8] R IN: f00dcafedeadbeef, nibble 7:
+ OUT: 0f00dc
+[8] L IN: f00dcafedeadbeef, nibble 7:
+ OUT: 00dcaf
+[6] R IN: b00bbabeface, nibble 7:
+ OUT: 0b00bb
+[6] L IN: b00bbabeface, nibble 7:
+ OUT: 00bbab
+[8] R IN: f00dcafedeadbeef, nibble 8:
+ OUT: 0f00dcaf
+[8] L IN: f00dcafedeadbeef, nibble 8:
+ OUT: 00dcafed
+[6] R IN: b00bbabeface, nibble 8:
+ OUT: 0b00bbab
+[6] L IN: b00bbabeface, nibble 8:
+ OUT: 00bbabef
+[8] R IN: f00dcafedeadbeef, nibble 9:
+ OUT: 0f00dcaf
+[8] L IN: f00dcafedeadbeef, nibble 9:
+ OUT: 00dcafed
+[6] R IN: b00bbabeface, nibble 9:
+ OUT: 0b00bbab
+[6] L IN: b00bbabeface, nibble 9:
+ OUT: 00bbabef
+[8] R IN: f00dcafedeadbeef, nibble 10:
+ OUT: 0f00dcafed
+[8] L IN: f00dcafedeadbeef, nibble 10:
+ OUT: 00dcafedea
+[6] R IN: b00bbabeface, nibble 10:
+ OUT: 0b00bbabef
+[6] L IN: b00bbabeface, nibble 10:
+ OUT: 00bbabefac
+[8] R IN: f00dcafedeadbeef, nibble 11:
+ OUT: 0f00dcafed
+[8] L IN: f00dcafedeadbeef, nibble 11:
+ OUT: 00dcafedea
+[6] R IN: b00bbabeface, nibble 11:
+ OUT: 0b00bbabef
+[6] L IN: b00bbabeface, nibble 11:
+ OUT: 00bbabefac
+[8] R IN: f00dcafedeadbeef, nibble 12:
+ OUT: 0f00dcafedea
+[8] L IN: f00dcafedeadbeef, nibble 12:
+ OUT: 00dcafedeadb
+[6] R IN: b00bbabeface, nibble 12:
+ OUT: 0b00bbabefac
+[6] L IN: b00bbabeface, nibble 12:
+ OUT: 00bbabeface0