@@ -237,6 +237,14 @@ public void testBitFieldEncoding() {
237237 assertFalse (vendorConsent .isVendorAllowed (3 ));
238238 assertFalse (vendorConsent .isVendorAllowed (31 ));
239239 assertFalse (vendorConsent .isVendorAllowed (32 ));
240+
241+ // Vendors outside range [1, MaxVendorId] are not allowed
242+ assertFalse (vendorConsent .isVendorAllowed (-99 ));
243+ assertFalse (vendorConsent .isVendorAllowed (-1 ));
244+ assertFalse (vendorConsent .isVendorAllowed (0 ));
245+ assertFalse (vendorConsent .isVendorAllowed (33 ));
246+ assertFalse (vendorConsent .isVendorAllowed (34 ));
247+ assertFalse (vendorConsent .isVendorAllowed (99 ));
240248 }
241249
242250 @ Test
@@ -275,6 +283,14 @@ public void testRangeEncodingDefaultFalse() {
275283 assertFalse (vendorConsent .isVendorAllowed (28 ));
276284 assertFalse (vendorConsent .isVendorAllowed (31 ));
277285 assertFalse (vendorConsent .isVendorAllowed (32 ));
286+
287+ // Vendors outside range [1, MaxVendorId] are not allowed
288+ assertFalse (vendorConsent .isVendorAllowed (-99 ));
289+ assertFalse (vendorConsent .isVendorAllowed (-1 ));
290+ assertFalse (vendorConsent .isVendorAllowed (0 ));
291+ assertFalse (vendorConsent .isVendorAllowed (33 ));
292+ assertFalse (vendorConsent .isVendorAllowed (34 ));
293+ assertFalse (vendorConsent .isVendorAllowed (99 ));
278294 }
279295
280296 @ Test
@@ -313,6 +329,14 @@ public void testRangeEncodingDefaultTrue() {
313329 assertTrue (vendorConsent .isVendorAllowed (15 ));
314330 assertTrue (vendorConsent .isVendorAllowed (31 ));
315331 assertTrue (vendorConsent .isVendorAllowed (32 ));
332+
333+ // Vendors outside range [1, MaxVendorId] are not allowed
334+ assertFalse (vendorConsent .isVendorAllowed (-99 ));
335+ assertFalse (vendorConsent .isVendorAllowed (-1 ));
336+ assertFalse (vendorConsent .isVendorAllowed (0 ));
337+ assertFalse (vendorConsent .isVendorAllowed (33 ));
338+ assertFalse (vendorConsent .isVendorAllowed (34 ));
339+ assertFalse (vendorConsent .isVendorAllowed (99 ));
316340 }
317341
318342 @ Test (expected = VendorConsentParseException .class )
@@ -548,4 +572,4 @@ public void testRealString6() {
548572 assertTrue (vendorConsent .isVendorAllowed (1000 ));
549573 }
550574
551- }
575+ }
0 commit comments