do not print parsed_result in invalid test

This commit is contained in:
ddidderr 2022-05-08 16:47:30 +02:00
parent b998d47164
commit 951d0d7df8

View File

@ -125,7 +125,7 @@ impl From<bool> for DNSMessageType {
} }
} }
#[derive(Debug, Clone)] #[derive(Debug, Clone, PartialEq)]
pub struct DNSHeader { pub struct DNSHeader {
/// used by the requester to match up replies to outstanding queries /// used by the requester to match up replies to outstanding queries
pub id: u16, pub id: u16,
@ -317,15 +317,13 @@ mod tests {
dns_query[3] = (rcode as u8) << 0; dns_query[3] = (rcode as u8) << 0;
let parse_result = DNSHeader::from_udp_datagram(&dns_query); let parse_result = DNSHeader::from_udp_datagram(&dns_query);
let parse_result_clone = parse_result.clone();
assert_eq!( assert_eq!(
parse_result.err(), parse_result,
Some(DNSParseError::DNSRCodeInvalid), Err(DNSParseError::DNSRCodeInvalid),
"query: {:02x?}, rcode: {}, parsed_rcode: {:?}", "query: {:02x?}, rcode: {}",
dns_query, dns_query,
rcode, rcode,
parse_result_clone.map(|x| x.response_code).unwrap()
); );
} }
} }