Skip to content

Commit

Permalink
CR updates
Browse files Browse the repository at this point in the history
  • Loading branch information
Nir-Az committed Feb 8, 2024
1 parent 4c0f331 commit b80034c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
13 changes: 7 additions & 6 deletions unit-tests/live/metadata/test-alive.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,11 @@ def append_testing_profiles(dev) -> None:
testing_profiles[p] = s


def is_metadata_values_different(metadata_type_1, metadata_type_2, number_frames_to_test=50) -> bool:
def are_metadata_values_different(metadata_type_1, metadata_type_2, number_frames_to_test=50) -> bool:
"""
Check that the given 2 metadata types value is different, it is handy when we expect different timetags / counters and such
:param metadata_type_1: first valuse that we need to check
:param metadata_type_2: second valuse that we need to check
Check that the given 2 metadata types values are different, it is handy when we expect different timetags / counters and such
:param metadata_type_1: first values that we need to check
:param metadata_type_2: second values that we need to check
:param number_frames_to_test: amount frames that we want to test
:return: true if values are always different
"""
Expand Down Expand Up @@ -97,6 +97,7 @@ def is_value_keep_increasing(metadata_value, number_frames_to_test=50) -> bool:
if prev_metadata_value >= current_value:
return False

prev_metadata_value = current_value
number_frames_to_test -= 1

return True
Expand Down Expand Up @@ -129,7 +130,7 @@ def is_value_keep_increasing(metadata_value, number_frames_to_test=50) -> bool:
test.check(is_value_keep_increasing(rs.frame_metadata_value.frame_timestamp))
test.finish()

# Test #3 Increasing frame timestamp
# Test #3 Increasing sensor timestamp
if is_frame_support_metadata(frame_queue.wait_for_frame(), rs.frame_metadata_value.sensor_timestamp):
test.start('Verifying increasing sensor timestamp for profile ', profile)
test.check(is_value_keep_increasing(rs.frame_metadata_value.sensor_timestamp))
Expand All @@ -139,7 +140,7 @@ def is_value_keep_increasing(metadata_value, number_frames_to_test=50) -> bool:
camera_name = device.get_info(rs.camera_info.name)
if 'D457' not in camera_name:
test.start('Verifying sensor timestamp is different than frame timestamp for profile ', profile)
test.check(is_metadata_values_different(rs.frame_metadata_value.frame_timestamp, rs.frame_metadata_value.sensor_timestamp))
test.check(are_metadata_values_different(rs.frame_metadata_value.frame_timestamp, rs.frame_metadata_value.sensor_timestamp))
test.finish()

close_resources(sensor)
Expand Down
2 changes: 1 addition & 1 deletion unit-tests/live/metadata/test-depth-unit.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#############################################################################################
# get metadata depth units value and make sure it's non zero and equal to the depth sensor matching option value
test.start("checking sensor timestanp on metadata")
test.start("checking depth units on metadata")

dev = test.find_first_device_or_exit()
depth_sensor = dev.first_depth_sensor()
Expand Down

0 comments on commit b80034c

Please sign in to comment.