Lines Matching refs:contents
121 CBS data, contents; in TEST() local
129 ASSERT_TRUE(CBS_get_asn1(&data, &contents, CBS_ASN1_SEQUENCE)); in TEST()
130 EXPECT_EQ(Bytes("\x01\x02"), Bytes(CBS_data(&contents), CBS_len(&contents))); in TEST()
134 EXPECT_FALSE(CBS_get_asn1(&data, &contents, CBS_ASN1_SEQUENCE)); in TEST()
138 EXPECT_FALSE(CBS_get_asn1(&data, &contents, CBS_ASN1_SEQUENCE)); in TEST()
142 EXPECT_FALSE(CBS_get_asn1(&data, &contents, CBS_ASN1_SEQUENCE)); in TEST()
146 EXPECT_FALSE(CBS_get_asn1(&data, &contents, CBS_ASN1_SEQUENCE)); in TEST()
150 EXPECT_FALSE(CBS_get_asn1(&data, &contents, 0x31)); in TEST()
159 &data, &contents, &present, in TEST()
163 &data, &contents, &present, in TEST()
166 EXPECT_EQ(0u, CBS_len(&contents)); in TEST()
168 &data, &contents, NULL, in TEST()
170 EXPECT_EQ(0u, CBS_len(&contents)); in TEST()
178 &data, &contents, &present, in TEST()
182 &data, &contents, &present, in TEST()
186 Bytes(CBS_data(&contents), CBS_len(&contents))); in TEST()
191 &data, &contents, &present, in TEST()
194 EXPECT_EQ(0u, CBS_len(&contents)); in TEST()
196 &data, &contents, &present, in TEST()
199 EXPECT_EQ(Bytes("\x01"), Bytes(CBS_data(&contents), CBS_len(&contents))); in TEST()
204 &data, &contents, &present, in TEST()
223 ASSERT_TRUE(CBS_get_any_asn1(&data, &contents, &tag)); in TEST()
225 EXPECT_EQ(Bytes("\x01\x02"), Bytes(CBS_data(&contents), CBS_len(&contents))); in TEST()
229 ASSERT_TRUE(CBS_get_any_asn1_element(&data, &contents, &tag, &header_len)); in TEST()
233 Bytes(CBS_data(&contents), CBS_len(&contents))); in TEST()
386 CBB contents, inner_contents, inner_inner_contents; in TEST() local
389 ASSERT_TRUE(CBB_add_u8_length_prefixed(cbb.get(), &contents)); in TEST()
390 ASSERT_TRUE(CBB_add_u8_length_prefixed(cbb.get(), &contents)); in TEST()
391 ASSERT_TRUE(CBB_add_u8(&contents, 1)); in TEST()
392 EXPECT_EQ(1u, CBB_len(&contents)); in TEST()
395 ASSERT_TRUE(CBB_add_u16_length_prefixed(cbb.get(), &contents)); in TEST()
396 ASSERT_TRUE(CBB_add_u16(&contents, 0x203)); in TEST()
397 ASSERT_TRUE(CBB_add_u24_length_prefixed(cbb.get(), &contents)); in TEST()
398 ASSERT_TRUE(CBB_add_u24(&contents, 0x40506)); in TEST()
399 ASSERT_TRUE(CBB_add_u8_length_prefixed(cbb.get(), &contents)); in TEST()
400 ASSERT_TRUE(CBB_add_u8_length_prefixed(&contents, &inner_contents)); in TEST()
413 CBB contents, inner_contents, inner_inner_contents; in TEST() local
421 ASSERT_TRUE(CBB_add_u8_length_prefixed(cbb.get(), &contents)); in TEST()
422 ASSERT_TRUE(CBB_add_u8_length_prefixed(cbb.get(), &contents)); in TEST()
423 ASSERT_TRUE(CBB_add_u8(&contents, 0xbb)); in TEST()
424 ASSERT_TRUE(CBB_add_u16_length_prefixed(cbb.get(), &contents)); in TEST()
425 ASSERT_TRUE(CBB_add_u16(&contents, 0xcccc)); in TEST()
426 ASSERT_TRUE(CBB_add_u24_length_prefixed(cbb.get(), &contents)); in TEST()
427 ASSERT_TRUE(CBB_add_u24(&contents, 0xdddddd)); in TEST()
428 ASSERT_TRUE(CBB_add_u8_length_prefixed(cbb.get(), &contents)); in TEST()
429 ASSERT_TRUE(CBB_add_u8(&contents, 0xff)); in TEST()
430 ASSERT_TRUE(CBB_add_u8_length_prefixed(&contents, &inner_contents)); in TEST()
437 CBB_discard_child(&contents); in TEST()
457 CBB child, contents; in TEST() local
471 EXPECT_FALSE(CBB_add_u8_length_prefixed(&child, &contents)); in TEST()
472 EXPECT_FALSE(CBB_add_u16_length_prefixed(&child, &contents)); in TEST()
473 EXPECT_FALSE(CBB_add_asn1(&child, &contents, 1)); in TEST()
498 CBB contents, inner_contents; in TEST() local
501 ASSERT_TRUE(CBB_add_asn1(cbb.get(), &contents, CBS_ASN1_SEQUENCE)); in TEST()
502 ASSERT_TRUE(CBB_add_bytes(&contents, (const uint8_t *)"\x01\x02\x03", 3)); in TEST()
504 CBB_add_asn1(cbb.get(), &contents, in TEST()
506 ASSERT_TRUE(CBB_add_bytes(&contents, (const uint8_t *)"\x04\x05\x06", 3)); in TEST()
508 CBB_add_asn1(cbb.get(), &contents, in TEST()
510 ASSERT_TRUE(CBB_add_bytes(&contents, (const uint8_t *)"\x07\x08\x09", 3)); in TEST()
512 CBB_add_asn1(cbb.get(), &contents, in TEST()
514 ASSERT_TRUE(CBB_add_bytes(&contents, (const uint8_t *)"\x0a\x0b\x0c", 3)); in TEST()
516 CBB_add_asn1(cbb.get(), &contents, in TEST()
518 ASSERT_TRUE(CBB_add_bytes(&contents, (const uint8_t *)"\x0d\x0e\x0f", 3)); in TEST()
526 ASSERT_TRUE(CBB_add_asn1(cbb.get(), &contents, CBS_ASN1_SEQUENCE)); in TEST()
527 ASSERT_TRUE(CBB_add_bytes(&contents, test_data.data(), 130)); in TEST()
536 ASSERT_TRUE(CBB_add_asn1(cbb.get(), &contents, CBS_ASN1_SEQUENCE)); in TEST()
537 ASSERT_TRUE(CBB_add_bytes(&contents, test_data.data(), 1000)); in TEST()
546 ASSERT_TRUE(CBB_add_asn1(cbb.get(), &contents, CBS_ASN1_SEQUENCE)); in TEST()
547 ASSERT_TRUE(CBB_add_asn1(&contents, &inner_contents, CBS_ASN1_SEQUENCE)); in TEST()