src/net/dns/record_rdata_unittest.cc
// Test that an empty address_set extension is correctly accepted.
Test that an empty address_set extension is correctly accepted.
Test that an empty address_set extension is correctly accepted .
TEST(RecordRdataTest, ParseEsniRecord_EmptyAddressSet) {
  char record[10000] = {};
  base::BigEndianWriter writer(record, sizeof(record));
  AppendWellFormedEsniKeys(&writer);
  writer.WriteU16(4);  
  writer.WriteU16(EsniRecordRdata::kAddressSetExtensionType);
  writer.WriteU16(0);  
  auto record_size = writer.ptr() - record;
  DnsRecordParser parser(record, record_size, 0 );
  std::unique_ptr<EsniRecordRdata> record_obj =
      EsniRecordRdata::Create(std::string(record, record_size), parser);
  ASSERT_THAT(record_obj, NotNull());
}
TEST ( RecordRdataTest , ParseEsniRecord_EmptyAddressSet ) { char record [ 10000 ] = { } ; base :: BigEndianWriter writer ( record , sizeof ( record ) ) ; AppendWellFormedEsniKeys ( & writer ) ; writer . WriteU16 ( 4 ) ; writer . WriteU16 ( EsniRecordRdata :: kAddressSetExtensionType ) ; writer . WriteU16 ( 0 ) ; auto record_size = writer . ptr ( ) - record ; DnsRecordParser parser ( record , record_size , 0 ) ; std :: unique_ptr < EsniRecordRdata > record_obj = EsniRecordRdata :: Create ( std :: string ( record , record_size ) , parser ) ; ASSERT_THAT ( record_obj , NotNull ( ) ) ; }
Test that an empty address_set extension is correctly accepted.
Test that an empty address_set extension is correctly accepted .
// length of the dns_extensions field // length of the (empty) address_set extension /* offset */