Skip to content

Commit

Permalink
TC-IDM-10.4: Catch feature mask errors and log (project-chip#32419) (p…
Browse files Browse the repository at this point in the history
…roject-chip#32619)

* TC-IDM-10.4: Catch feature mask errors and log

* Add comment

Co-authored-by: C Freeman <[email protected]>
Co-authored-by: Andrei Litvin <[email protected]>
  • Loading branch information
3 people authored Apr 15, 2024
1 parent 6135dfb commit 86709e7
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/python_testing/TC_pics_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,19 @@ def test_TC_IDM_10_4(self):
# Codegen in python uses feature masks (0x01, 0x02, 0x04 etc.)
# PICS uses the mask bit number (1, 2, 3)
# Convert the mask to a bit number so we can check the PICS.
feature_bit = int(math.log2(feature_mask))
try:
feature_bit = int(math.log2(feature_mask))
except ValueError:
location = FeaturePathLocation(endpoint_id=self.endpoint_id,
cluster_id=cluster_id, feature_code=str(feature_mask))
# The feature_mask is from the code generated feature masks, not the features as listed on the
# device. If we get an error here, this is a problem with the codegen or spec, not with the device
# under test. We still want the problem recorded, but this does not indicate a problem on the DUT.
# There are two clusters with known bad features here - RvcRunMode and RvcCleanMode both have a
# feature mask of kNoFeatures and an empty "mask" of 0x0.
self.record_warning("PICS check", location=location,
problem=f"Unable to parse feature mask {feature_mask} from cluster {cluster}")
continue
pics = feature_pics(pics_base, feature_bit)
if feature_mask & feature_map:
required = True
Expand Down

0 comments on commit 86709e7

Please sign in to comment.