Skip to content

Commit

Permalink
fix test rr_from_master_file in cname rdata
Browse files Browse the repository at this point in the history
  • Loading branch information
Litr0 committed Oct 31, 2023
1 parent 3686ceb commit 045365a
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/message/rdata/cname_rdata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ impl CnameRdata {
#[cfg(test)]
mod cname_rdata_test {
use crate::domain_name::DomainName;
use crate::message::rdata::Rdata;
use crate::message::rdata::cname_rdata::CnameRdata;
use crate::message::Rtype;
use crate::message::Rclass;
Expand Down Expand Up @@ -179,7 +180,7 @@ mod cname_rdata_test {
#[test]
fn rr_from_master_file_test() {
let cname_rr = CnameRdata::rr_from_master_file(
"test.googleplex.edu".split_whitespace(),
"test.googleplex.edu.".split_whitespace(),
0,
"IN",
"admin1.googleplex.edu".to_string(),
Expand All @@ -193,15 +194,15 @@ mod cname_rdata_test {
);
assert_eq!(cname_rr.get_rtype(), Rtype::CNAME);
assert_eq!(cname_rr.get_ttl(), 0);
assert_eq!(cname_rr.get_rdlength(), 21);
assert_eq!(cname_rr.get_rdlength(), 22);

// TODO: Implement getters for complete coverage
/*
let mut a_rdata = cname_rr.get_rdata();
let expected_cname = DomainName::new_from_string(String::from("test.googleplex.edu."));

let a_rdata = cname_rr.get_rdata();
match a_rdata {
Rdata::SomeCnameRdata(val) => assert_eq!(val.get_address(), [204, 13, 100, 3]),
Rdata::SomeCnameRdata(val) => assert_eq!(val.get_cname(), expected_cname),
_ => {}
}
*/

}
}

0 comments on commit 045365a

Please sign in to comment.