@@ -542,7 +542,7 @@ mod host_data_test{
542542 resource_record_valid. set_ttl ( 1000 ) ;
543543 let rrstore_data_valid = RRStoredData :: new ( resource_record_valid. clone ( ) ) ;
544544
545- let mut resource_record_invalid = ResourceRecord :: new ( a_rdata) ;
545+ let mut resource_record_invalid = ResourceRecord :: new ( a_rdata. clone ( ) ) ;
546546 resource_record_invalid. set_ttl ( 4 ) ;
547547 let rrstore_data_invalid = RRStoredData :: new ( resource_record_invalid) ;
548548
@@ -552,8 +552,8 @@ mod host_data_test{
552552 let mut domain_name_2 = DomainName :: new ( ) ;
553553 domain_name_2. set_name ( String :: from ( "example.com" ) ) ;
554554
555- cache_by_domain_name. add_to_host_data ( domain_name_1. clone ( ) , rrstore_data_valid) ;
556- cache_by_domain_name. add_to_host_data ( domain_name_2. clone ( ) , rrstore_data_invalid) ;
555+ cache_by_domain_name. add_to_host_data ( domain_name_1. clone ( ) , rrstore_data_valid. clone ( ) ) ;
556+ cache_by_domain_name. add_to_host_data ( domain_name_2. clone ( ) , rrstore_data_invalid. clone ( ) ) ;
557557
558558 assert_eq ! ( cache_by_domain_name. get_domain_names_data( ) . len( ) , 2 ) ;
559559 if let Some ( rr_cache_vec) = cache_by_domain_name. get_domain_names_data ( ) . get ( & domain_name_1) {
@@ -569,13 +569,13 @@ mod host_data_test{
569569 //clean the data with expired ttl
570570 cache_by_domain_name. filter_timeout_host_data ( ) ;
571571
572- println ! ( "The new cache is {:?} " , cache_by_domain_name. get_domain_names_data( ) ) ;
572+ // println!("The new cache is {:?} ", cache_by_domain_name.get_domain_names_data());
573573
574574 //check if the value who survives is the same
575- if let Some ( rr_cache_vec) = cache_by_domain_name. get_domain_names_data ( ) . get ( & domain_name_2 ) {
575+ if let Some ( rr_cache_vec) = cache_by_domain_name. get_domain_names_data ( ) . get ( & domain_name_1 ) {
576576 if let Some ( rrstore_data) = rr_cache_vec. get ( 0 ) {
577- let resocurce_record_after_clean = rrstore_data . get_resource_record ( ) ;
578- assert_eq ! ( resocurce_record_after_clean , resource_record_valid ) ;
577+ println ! ( "the rrstore for domain {:?} afther de timeout is {:?} " , domain_name_1 . get_name ( ) , rrstore_data ) ;
578+ assert_eq ! ( rrstore_data_valid , rrstore_data . clone ( ) ) ;
579579 }
580580 }
581581 //after the filter shoud be just one data in the cache (example.com shoud have been eliminated)
0 commit comments