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()
389 CBB contents, inner_contents, inner_inner_contents; in TEST() local
392 ASSERT_TRUE(CBB_add_u8_length_prefixed(cbb.get(), &contents)); in TEST()
393 ASSERT_TRUE(CBB_add_u8_length_prefixed(cbb.get(), &contents)); in TEST()
394 ASSERT_TRUE(CBB_add_u8(&contents, 1)); in TEST()
395 EXPECT_EQ(1u, CBB_len(&contents)); in TEST()
398 ASSERT_TRUE(CBB_add_u16_length_prefixed(cbb.get(), &contents)); in TEST()
399 ASSERT_TRUE(CBB_add_u16(&contents, 0x203)); in TEST()
400 ASSERT_TRUE(CBB_add_u24_length_prefixed(cbb.get(), &contents)); in TEST()
401 ASSERT_TRUE(CBB_add_u24(&contents, 0x40506)); in TEST()
402 ASSERT_TRUE(CBB_add_u8_length_prefixed(cbb.get(), &contents)); in TEST()
403 ASSERT_TRUE(CBB_add_u8_length_prefixed(&contents, &inner_contents)); in TEST()
416 CBB contents, inner_contents, inner_inner_contents; in TEST() local
424 ASSERT_TRUE(CBB_add_u8_length_prefixed(cbb.get(), &contents)); in TEST()
425 ASSERT_TRUE(CBB_add_u8_length_prefixed(cbb.get(), &contents)); in TEST()
426 ASSERT_TRUE(CBB_add_u8(&contents, 0xbb)); in TEST()
427 ASSERT_TRUE(CBB_add_u16_length_prefixed(cbb.get(), &contents)); in TEST()
428 ASSERT_TRUE(CBB_add_u16(&contents, 0xcccc)); in TEST()
429 ASSERT_TRUE(CBB_add_u24_length_prefixed(cbb.get(), &contents)); in TEST()
430 ASSERT_TRUE(CBB_add_u24(&contents, 0xdddddd)); in TEST()
431 ASSERT_TRUE(CBB_add_u8_length_prefixed(cbb.get(), &contents)); in TEST()
432 ASSERT_TRUE(CBB_add_u8(&contents, 0xff)); in TEST()
433 ASSERT_TRUE(CBB_add_u8_length_prefixed(&contents, &inner_contents)); in TEST()
440 CBB_discard_child(&contents); in TEST()
460 CBB child, contents; in TEST() local
474 EXPECT_FALSE(CBB_add_u8_length_prefixed(&child, &contents)); in TEST()
475 EXPECT_FALSE(CBB_add_u16_length_prefixed(&child, &contents)); in TEST()
476 EXPECT_FALSE(CBB_add_asn1(&child, &contents, 1)); in TEST()
501 CBB contents, inner_contents; in TEST() local
504 ASSERT_TRUE(CBB_add_asn1(cbb.get(), &contents, CBS_ASN1_SEQUENCE)); in TEST()
505 ASSERT_TRUE(CBB_add_bytes(&contents, (const uint8_t *)"\x01\x02\x03", 3)); in TEST()
507 CBB_add_asn1(cbb.get(), &contents, in TEST()
509 ASSERT_TRUE(CBB_add_bytes(&contents, (const uint8_t *)"\x04\x05\x06", 3)); in TEST()
511 CBB_add_asn1(cbb.get(), &contents, in TEST()
513 ASSERT_TRUE(CBB_add_bytes(&contents, (const uint8_t *)"\x07\x08\x09", 3)); in TEST()
515 CBB_add_asn1(cbb.get(), &contents, in TEST()
517 ASSERT_TRUE(CBB_add_bytes(&contents, (const uint8_t *)"\x0a\x0b\x0c", 3)); in TEST()
519 CBB_add_asn1(cbb.get(), &contents, in TEST()
521 ASSERT_TRUE(CBB_add_bytes(&contents, (const uint8_t *)"\x0d\x0e\x0f", 3)); in TEST()
529 ASSERT_TRUE(CBB_add_asn1(cbb.get(), &contents, CBS_ASN1_SEQUENCE)); in TEST()
530 ASSERT_TRUE(CBB_add_bytes(&contents, test_data.data(), 130)); in TEST()
539 ASSERT_TRUE(CBB_add_asn1(cbb.get(), &contents, CBS_ASN1_SEQUENCE)); in TEST()
540 ASSERT_TRUE(CBB_add_bytes(&contents, test_data.data(), 1000)); in TEST()
549 ASSERT_TRUE(CBB_add_asn1(cbb.get(), &contents, CBS_ASN1_SEQUENCE)); in TEST()
550 ASSERT_TRUE(CBB_add_asn1(&contents, &inner_contents, CBS_ASN1_SEQUENCE)); in TEST()