@@ -16,6 +16,107 @@ import (
1616 "github.com/stretchr/testify/require"
1717)
1818
19+ func TestFuzzerRepro_1761183632825411000 (t * testing.T ) {
20+ b , _ := base64 .StdEncoding .DecodeString ("OjAAAAIAAAAJAAAADwAAABgAAAAaAAAAVeD8/w==" )
21+ bm := NewBitmap ()
22+ bm .UnmarshalBinary (b )
23+ bm .Describe ()
24+ if err := bm .Validate (); err != nil {
25+ t .Errorf ("Initial Validate failed: %v" , err )
26+ }
27+ b2 , _ := base64 .StdEncoding .DecodeString ("OjAAAAEAAAAJAAAAEAAAAFXg" )
28+ bm2 := NewBitmap ()
29+ bm2 .UnmarshalBinary (b2 )
30+ bm2 .Describe ()
31+ bm .AndNot (bm2 )
32+ if err := bm .Validate (); err != nil {
33+ t .Errorf ("Validate failed: %v" , err )
34+ } else {
35+ t .Logf ("Validate succeeded" )
36+ }
37+ }
38+
39+ func TestFuzzerRepro_1761181918459062000 (t * testing.T ) {
40+ b , _ := base64 .StdEncoding .DecodeString ("OjAAAAIAAAAJAAAADwAAABgAAAAaAAAAVeD8/w==" )
41+ bm := NewBitmap ()
42+ bm .UnmarshalBinary (b )
43+ if err := bm .Validate (); err != nil {
44+ t .Errorf ("Initial Validate failed: %v" , err )
45+ }
46+ b2 , _ := base64 .StdEncoding .DecodeString ("OjAAAAEAAAAJAAAAEAAAAFXg" )
47+ bm2 := NewBitmap ()
48+ bm2 .UnmarshalBinary (b2 )
49+ bm .AndNot (bm2 )
50+ if err := bm .Validate (); err != nil {
51+ t .Errorf ("Validate failed: %v" , err )
52+ } else {
53+ t .Logf ("Validate succeeded" )
54+ }
55+ }
56+
57+ func TestFuzzerRepro_1761177588768443000 (t * testing.T ) {
58+ b , _ := base64 .StdEncoding .DecodeString ("OzAAAAEAAAMAAQADAAMA" )
59+ bm := NewBitmap ()
60+ bm .UnmarshalBinary (b )
61+ if err := bm .Validate (); err != nil {
62+ t .Errorf ("Initial Validate failed: %v" , err )
63+ }
64+ bm .Describe ()
65+ b2 , _ := base64 .StdEncoding .DecodeString ("OjAAAAEAAAAAAAAAEAAAAAEA" )
66+ bm2 := NewBitmap ()
67+ bm2 .UnmarshalBinary (b2 )
68+ bm2 .Describe ()
69+ bm .Or (bm2 )
70+ if err := bm .Validate (); err != nil {
71+ t .Errorf ("Validate failed: %v" , err )
72+ } else {
73+ t .Logf ("Validate succeeded" )
74+ }
75+ }
76+
77+ func TestFuzzerPanicRepro_1761177447422379000 (t * testing.T ) {
78+ b , _ := base64 .StdEncoding .DecodeString ("OjAAAAIAAAAJAAAADwAAABgAAAAaAAAAVeD8/w==" )
79+ bm := NewBitmap ()
80+ bm .UnmarshalBinary (b )
81+ b2 , _ := base64 .StdEncoding .DecodeString ("OjAAAAEAAAAJAAAAEAAAAFXg" )
82+ bm2 := NewBitmap ()
83+ bm2 .UnmarshalBinary (b2 )
84+ bm .AndNot (bm2 )
85+ }
86+
87+ func TestFuzzerPanicRepro_1761174531957958000 (t * testing.T ) {
88+ b , _ := base64 .StdEncoding .DecodeString ("OjAAAAIAAAAAAAAADwAAABgAAAAaAAAAAAD//w==" )
89+ bm := NewBitmap ()
90+ bm .UnmarshalBinary (b )
91+ b2 , _ := base64 .StdEncoding .DecodeString ("OjAAAAIAAAAAAAAADwAAABgAAAAaAAAAAAD//w==" )
92+ bm2 := NewBitmap ()
93+ bm2 .UnmarshalBinary (b2 )
94+ bm .Xor (bm2 )
95+ }
96+
97+ func TestFuzzerPanicRepro_1761174003952142000 (t * testing.T ) {
98+ b , _ := base64 .StdEncoding .DecodeString ("OjAAAAIAAAAAAAAADwAAABgAAAAaAAAAAAD//w==" )
99+ bm := NewBitmap ()
100+ bm .UnmarshalBinary (b )
101+ b2 , _ := base64 .StdEncoding .DecodeString ("OjAAAAIAAAAAAAAADwAAABgAAAAaAAAAAAD//w==" )
102+ bm2 := NewBitmap ()
103+ bm2 .UnmarshalBinary (b2 )
104+ bm .Xor (bm2 )
105+ }
106+
107+ func TestFuzzerPanicRepro_1761173763060614000 (t * testing.T ) {
108+ b , _ := base64 .StdEncoding .DecodeString ("OjAAAAIAAAAAAAAADwAAABgAAAAaAAAAAAD//w==" )
109+ bm := NewBitmap ()
110+ bm .UnmarshalBinary (b )
111+ bm .Describe ()
112+ b2 , _ := base64 .StdEncoding .DecodeString ("OjAAAAIAAAAAAAAADwAAABgAAAAaAAAAAAD//w==" )
113+ bm2 := NewBitmap ()
114+ bm2 .UnmarshalBinary (b2 )
115+ bm2 .Describe ()
116+ bm .Or (bm2 )
117+ bm .Describe ()
118+ }
119+
19120func TestFuzzerPanicRepro_1761171725501558000 (t * testing.T ) {
20121 b , _ := base64 .StdEncoding .DecodeString ("OzAAAAEPAAMAAQD1/wMA" )
21122 bm := NewBitmap ()
@@ -26,6 +127,7 @@ func TestFuzzerPanicRepro_1761171725501558000(t *testing.T) {
26127 bm2 .UnmarshalBinary (b2 )
27128 bm2 .Describe ()
28129 bm .AndNot (bm2 )
130+ bm .Describe ()
29131}
30132
31133func TestFuzzerRepro_1761171217612329001 (t * testing.T ) {
@@ -3021,7 +3123,13 @@ func TestBitMapValidationFromDeserialization(t *testing.T) {
30213123 tt .corruptor (serialized )
30223124 corruptedDeserializedBitMap := NewBitmap ()
30233125 corruptedDeserializedBitMap .ReadFrom (bytes .NewReader (serialized ))
3024- assert .ErrorIs (t , corruptedDeserializedBitMap .Validate (), tt .err )
3126+ // Check that Validate() returns nil if and only if tt.err is nil
3127+ validateErr := corruptedDeserializedBitMap .Validate ()
3128+ if tt .err == nil {
3129+ assert .NoError (t , validateErr , "expected validation to succeed when tt.err is nil" )
3130+ } else {
3131+ assert .Error (t , validateErr , "expected validation to fail when tt.err is not nil" )
3132+ }
30253133
30263134 corruptedDeserializedBitMap = NewBitmap ()
30273135 corruptedDeserializedBitMap .MustReadFrom (bytes .NewReader (serialized ))
0 commit comments