Skip to content

Commit

Permalink
PR IntelRealSense#8475 from Matan: fixed ac-triggers test with specia…
Browse files Browse the repository at this point in the history
…l_frame repeats
  • Loading branch information
maloel authored Mar 2, 2021
2 parents 8f61423 + c1522ea commit 141ed25
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions unit-tests/algo/d2rgb/test-triggers.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,19 @@
rs.calibration_status.scene_invalid,
rs.calibration_status.bad_result]

def filter_special_frames( list ):
"""
Removes consecutive special frame statuses from the status list since we have a built-in
retry mechanism and more than one request can be made.
E.g., [triggered, special_frame, special_frame, started, successful]
"""
i = 1
while i < len(list):
if list[i - 1] == list[i] == rs.calibration_status.special_frame:
del list[i]
else:
i += 1

#############################################################################################
# Test #1
test.start("Depth sensor is off, should get an error")
Expand All @@ -77,6 +90,7 @@
d2r.trigger_device_calibration( rs.calibration_type.manual_depth_to_rgb )
ac.wait_for_calibration()
ac.trim_irrelevant_statuses(irrelevant_statuses)
filter_special_frames( ac.status_list )
test.check_equal_lists(ac.status_list, successful_calibration_status_list)
except Exception:
test.unexpected_exception()
Expand All @@ -103,6 +117,7 @@
d2r.trigger_device_calibration( rs.calibration_type.manual_depth_to_rgb )
ac.wait_for_calibration()
ac.trim_irrelevant_statuses(irrelevant_statuses)
filter_special_frames( ac.status_list )
test.check_equal_lists(ac.status_list, successful_calibration_status_list)
except:
test.unexpected_exception()
Expand Down Expand Up @@ -132,6 +147,7 @@
test.unexpected_exception()
ac.wait_for_calibration() # First trigger should continue and finish successfully
ac.trim_irrelevant_statuses(irrelevant_statuses)
filter_special_frames( ac.status_list )
test.check_equal_lists(ac.status_list, successful_calibration_status_list)
except:
test.unexpected_exception()
Expand Down

0 comments on commit 141ed25

Please sign in to comment.