summaryrefslogtreecommitdiff
path: root/test_bits.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2012-04-19 18:54:16 -0400
committerEric S. Raymond <esr@thyrsus.com>2012-04-19 18:54:16 -0400
commitd3250c3e1e712e4894404f9d19da4d6519aa96a9 (patch)
treeb0d92d8dc523db7aeb4eb885ef0763611ae9c909 /test_bits.c
parent9e7289c268f7c4643225005cab27a6cd6bb83202 (diff)
downloadgpsd-d3250c3e1e712e4894404f9d19da4d6519aa96a9.tar.gz
First multibyte test of little-endian extraction succeeds.
Diffstat (limited to 'test_bits.c')
-rw-r--r--test_bits.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/test_bits.c b/test_bits.c
index d3fb94a0..4402ae00 100644
--- a/test_bits.c
+++ b/test_bits.c
@@ -127,6 +127,8 @@ int main(void)
{buf, 78, 4, 11, false, "2 bits crossing 8th to 9th byte (0xfefd)"},
{buf, 0, 1, 0, true, "first bit of first byte"},
{buf, 0, 8, 0x80, true, "first 8 bits"},
+ {buf, 32, 7, 0x20, true, "first seven bits of fifth byte (0x05)"},
+ {buf, 56, 12, 0xf10,true, "12 bits crossing 7th to 8th bytes (0x08ff)"},
/* sporadic tests based on found bugs */
{(unsigned char *)"\x19\x23\f6",
7, 2, 2, false, "2 bits crossing 1st to 2nd byte (0x1923)"},