diff options
Diffstat (limited to 'tests/bitvec')
-rw-r--r-- | tests/bitvec/bitvec_test.c | 8 | ||||
-rw-r--r-- | tests/bitvec/bitvec_test.ok | 20 |
2 files changed, 16 insertions, 12 deletions
diff --git a/tests/bitvec/bitvec_test.c b/tests/bitvec/bitvec_test.c index 789df75a..7d131e03 100644 --- a/tests/bitvec/bitvec_test.c +++ b/tests/bitvec/bitvec_test.c @@ -57,13 +57,17 @@ static void test_byte_ops() static void test_unhex(const char *hex) { + int rc; struct bitvec b; uint8_t d[64] = {0}; b.data = d; b.data_len = sizeof(d); b.cur_bit = 0; - printf("%d -=>\n", bitvec_unhex(&b, hex)); - printf("%s\n%s\n", osmo_hexdump_nospc(d, 64), osmo_hexdump_nospc((const unsigned char *)hex, 23)); + + rc = bitvec_unhex(&b, hex); + printf("%d -=> cur_bit=%u\n", rc, b.cur_bit); + printf("%s\n", osmo_hexdump_nospc(d, 64)); + printf("%s\n", hex); } int main(int argc, char **argv) diff --git a/tests/bitvec/bitvec_test.ok b/tests/bitvec/bitvec_test.ok index 8d944bc4..83328b26 100644 --- a/tests/bitvec/bitvec_test.ok +++ b/tests/bitvec/bitvec_test.ok @@ -1,17 +1,17 @@ === start test_byte_ops === === end test_byte_ops === -1 -=> +1 -=> cur_bit=184 48282407a6a074227201000b2b2b2b2b2b2b2b2b2b2b2b0000000000000000000000000000000000000000000000000000000000000000000000000000000000 -48282407a6a074227201000b2b2b2b2b2b2b2b2b2b2b2b0000000000000000000000000000000000000000000000000000000000000000000000000000000000 -1 -=> -47240c00400000000000000079eb2ac9402b2b2b2b2b2b0000000000000000000000000000000000000000000000000000000000000000000000000000000000 +48282407a6a074227201000b2b2b2b2b2b2b2b2b2b2b2b +1 -=> cur_bit=184 47240c00400000000000000079eb2ac9402b2b2b2b2b2b0000000000000000000000000000000000000000000000000000000000000000000000000000000000 -1 -=> -47283c367513ba333004242b2b2b2b2b2b2b2b2b2b2b2b0000000000000000000000000000000000000000000000000000000000000000000000000000000000 +47240c00400000000000000079eb2ac9402b2b2b2b2b2b +1 -=> cur_bit=184 47283c367513ba333004242b2b2b2b2b2b2b2b2b2b2b2b0000000000000000000000000000000000000000000000000000000000000000000000000000000000 -1 -=> +47283c367513ba333004242b2b2b2b2b2b2b2b2b2b2b2b +1 -=> cur_bit=184 deadface000000000000000000000000000000beeffeed0000000000000000000000000000000000000000000000000000000000000000000000000000000000 -deadface000000000000000000000000000000beeffeed0000000000000000000000000000000000000000000000000000000000000000000000000000000000 -0 -=> -fffffaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +DEADFACE000000000000000000000000000000BEEFFEED +0 -=> cur_bit=512 fffffaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa +FFFFFAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABBBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB |