diff options
author | jsing <> | 2022-01-06 14:31:03 +0000 |
---|---|---|
committer | jsing <> | 2022-01-06 14:31:03 +0000 |
commit | 39bcad2e07438c24cf5e10f2048fc12aca67f19a (patch) | |
tree | df42ad43c2196351ec1d4d009a5d2ad8a181cdc4 | |
parent | 274701b65cfcccb8efeaacf15d6bf5f78a0b3412 (diff) | |
download | openbsd-39bcad2e07438c24cf5e10f2048fc12aca67f19a.tar.gz openbsd-39bcad2e07438c24cf5e10f2048fc12aca67f19a.tar.bz2 openbsd-39bcad2e07438c24cf5e10f2048fc12aca67f19a.zip |
Test CBB_add_u64()
-rw-r--r-- | src/regress/lib/libssl/bytestring/bytestringtest.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/regress/lib/libssl/bytestring/bytestringtest.c b/src/regress/lib/libssl/bytestring/bytestringtest.c index a29dc982a8..a0fcde0baa 100644 --- a/src/regress/lib/libssl/bytestring/bytestringtest.c +++ b/src/regress/lib/libssl/bytestring/bytestringtest.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: bytestringtest.c,v 1.15 2021/12/15 17:37:42 jsing Exp $ */ | 1 | /* $OpenBSD: bytestringtest.c,v 1.16 2022/01/06 14:31:03 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2014, Google Inc. | 3 | * Copyright (c) 2014, Google Inc. |
4 | * | 4 | * |
@@ -315,7 +315,10 @@ test_get_optional_asn1_bool(void) | |||
315 | static int | 315 | static int |
316 | test_cbb_basic(void) | 316 | test_cbb_basic(void) |
317 | { | 317 | { |
318 | static const uint8_t kExpected[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12}; | 318 | static const uint8_t kExpected[] = { |
319 | 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, | ||
320 | 13, 14, 15, 16, 17, 18, 19, 20, | ||
321 | }; | ||
319 | uint8_t *buf = NULL; | 322 | uint8_t *buf = NULL; |
320 | size_t buf_len; | 323 | size_t buf_len; |
321 | int ret = 0; | 324 | int ret = 0; |
@@ -331,6 +334,7 @@ test_cbb_basic(void) | |||
331 | CHECK_GOTO(CBB_add_u24(&cbb, 0x40506)); | 334 | CHECK_GOTO(CBB_add_u24(&cbb, 0x40506)); |
332 | CHECK_GOTO(CBB_add_u32(&cbb, 0x708090a)); | 335 | CHECK_GOTO(CBB_add_u32(&cbb, 0x708090a)); |
333 | CHECK_GOTO(CBB_add_bytes(&cbb, (const uint8_t*) "\x0b\x0c", 2)); | 336 | CHECK_GOTO(CBB_add_bytes(&cbb, (const uint8_t*) "\x0b\x0c", 2)); |
337 | CHECK_GOTO(CBB_add_u64(&cbb, 0xd0e0f1011121314)); | ||
334 | CHECK_GOTO(CBB_finish(&cbb, &buf, &buf_len)); | 338 | CHECK_GOTO(CBB_finish(&cbb, &buf, &buf_len)); |
335 | 339 | ||
336 | ret = (buf_len == sizeof(kExpected) | 340 | ret = (buf_len == sizeof(kExpected) |