@@ -10,13 +10,17 @@ use std::path::Path;
1010use sqlite3mc_src_fuzz:: {
1111 run_shared_cache,
1212 seedgen:: { run_search, DivergencePolicy , Family , Rng } ,
13- SharedCacheCase ,
13+ SharedCacheCase , SiblingKey ,
1414} ;
1515
1616const fn has_content ( case : & SharedCacheCase ) -> bool {
1717 !case. main_ops . is_empty ( )
1818}
1919
20+ const fn shared ( key : & SiblingKey ) -> bool {
21+ matches ! ( key, SiblingKey :: Shared )
22+ }
23+
2024fn families ( ) -> & ' static [ Family < SharedCacheCase > ] {
2125 & [
2226 Family {
@@ -25,15 +29,11 @@ fn families() -> &'static [Family<SharedCacheCase>] {
2529 } ,
2630 Family {
2731 name : "one-sibling-correct-key" ,
28- matches : |c| {
29- c. siblings . len ( ) == 1 && c. siblings [ 0 ] . config == c. written && has_content ( c)
30- } ,
32+ matches : |c| c. siblings . len ( ) == 1 && shared ( & c. siblings [ 0 ] . key ) && has_content ( c) ,
3133 } ,
3234 Family {
3335 name : "one-sibling-wrong-key" ,
34- matches : |c| {
35- c. siblings . len ( ) == 1 && c. siblings [ 0 ] . config != c. written && has_content ( c)
36- } ,
36+ matches : |c| c. siblings . len ( ) == 1 && !shared ( & c. siblings [ 0 ] . key ) && has_content ( c) ,
3737 } ,
3838 Family {
3939 name : "many-siblings" ,
@@ -47,16 +47,16 @@ fn families() -> &'static [Family<SharedCacheCase>] {
4747 name : "all-siblings-correct-key" ,
4848 matches : |c| {
4949 !c. siblings . is_empty ( )
50- && c. siblings . iter ( ) . all ( |s| s . config == c . written )
50+ && c. siblings . iter ( ) . all ( |s| shared ( & s . key ) )
5151 && has_content ( c)
5252 } ,
5353 } ,
5454 Family {
5555 name : "mixed-correct-and-wrong" ,
5656 matches : |c| {
5757 c. siblings . len ( ) >= 2
58- && c. siblings . iter ( ) . any ( |s| s . config == c . written )
59- && c. siblings . iter ( ) . any ( |s| s . config != c . written )
58+ && c. siblings . iter ( ) . any ( |s| shared ( & s . key ) )
59+ && c. siblings . iter ( ) . any ( |s| ! shared ( & s . key ) )
6060 && has_content ( c)
6161 } ,
6262 } ,
0 commit comments