X-Git-Url: https://git.ozlabs.org/?a=blobdiff_plain;f=ccan%2Fbytestring%2Ftest%2Frun.c;h=2d86926d06301b2c5ed8dd9d5242cd31aa3bb2b2;hb=c06054cd124670216d147c2e0660aab3c3fa683c;hp=9423b9a0bd72b094a570f34751de660027fda488;hpb=40b45c4cfbf110a8e790366302ff43fa94dc8daa;p=ccan diff --git a/ccan/bytestring/test/run.c b/ccan/bytestring/test/run.c index 9423b9a0..2d86926d 100644 --- a/ccan/bytestring/test/run.c +++ b/ccan/bytestring/test/run.c @@ -12,7 +12,7 @@ int main(void) struct bytestring bs, bs1, bs2, bs3, bs4, bs5; /* This is how many tests you plan to run */ - plan_tests(9); + plan_tests(16); bs = bytestring(str1, sizeof(str1) - 1); ok1(bs.ptr == str1); @@ -35,6 +35,14 @@ int main(void) ok1(bs5.ptr == NULL); ok1(bytestring_eq(bs5, bytestring_NULL)); + ok1(bytestring_byte(bs2, 0) == 'a'); + ok1(bytestring_byte(bs2, 1) == 'b'); + ok1(bytestring_byte(bs2, 2) == 'c'); + ok1(bytestring_byte(bs2, 3) == '\0'); + ok1(bytestring_byte(bs2, 4) == 'd'); + ok1(bytestring_byte(bs2, 5) == 'e'); + ok1(bytestring_byte(bs2, 6) == 'f'); + /* This exits depending on whether all tests passed */ return exit_status(); }