@@ -1015,12 +1015,26 @@ mod cache_data_test{
1015
1015
println ! ( "the cache by domain for A type after the cleaning is : \n {:?}" , record_types_data_a. get_domain_names_data( ) ) ;
1016
1016
//FIXME: Does not delete the invadil rrstore, instead points to a empty array (same error as in cache by domain)
1017
1017
assert_eq ! ( record_types_data_a. get_domain_names_data( ) . len( ) , 1 ) ;
1018
+ //check if is the same resource record valid (which survives)
1019
+ if let Some ( rrstore_a_after_cleaning) = record_types_data_a. clone ( ) . get_from_host_data ( domain_name_1. clone ( ) ) {
1020
+ if let Some ( rrstore_data_valid) = rrstore_a_after_cleaning. get ( 0 ) {
1021
+ let resource_record_after_filter = rrstore_data_valid. get_resource_record ( ) ;
1022
+ assert_eq ! ( resource_record_after_filter, resource_record_valid_a) ;
1023
+ }
1024
+ }
1018
1025
}
1019
1026
//CacheByDomainName for NS type
1020
1027
if let Some ( record_types_data_ns) = record_types_data_after_cleaning. get ( & Rtype :: NS ) {
1021
1028
println ! ( "the cache by domain for NS type after the cleaning is : \n {:?}" , record_types_data_ns. get_domain_names_data( ) ) ;
1022
1029
//FIXME: Does not delete the invadil rrstore, instead points to a empty array (same error as in cache by domain)
1023
1030
assert_eq ! ( record_types_data_ns. get_domain_names_data( ) . len( ) , 1 ) ;
1031
+ //check if is the same resource record valid (which survives)
1032
+ if let Some ( rrstore_ns_after_cleaning) = record_types_data_ns. clone ( ) . get_from_host_data ( domain_name_2. clone ( ) ) {
1033
+ if let Some ( rrstore_data_valid) = rrstore_ns_after_cleaning. get ( 0 ) {
1034
+ let resource_record_after_filter = rrstore_data_valid. get_resource_record ( ) ;
1035
+ assert_eq ! ( resource_record_after_filter, resource_record_valid_a) ;
1036
+ }
1037
+ }
1024
1038
}
1025
1039
1026
1040
0 commit comments