Skip to content

Commit

Permalink
tests: hwmc-errors: Improve test description and syntaxes.
Browse files Browse the repository at this point in the history
Signed-off-by: Dmitry Perchanov <[email protected]>
  • Loading branch information
dmipx committed Apr 18, 2024
1 parent b5559e9 commit 6945777
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions unit-tests/live/debug_protocol/test-hwmc-errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,16 @@ def send_hardware_monitor_command(device, command):

#############################################################################################

test.start("WRONGCOMMAND")
test.start("WRONG COMMAND")
try:
hwmc_opcode_as_int = 0xee
hwmc_opcode_as_string = "ff ff ff ff" # little endian

raw_command = rs.debug_protocol(dev).build_command(hwmc_opcode_as_int)
status, new_scenario_result = send_hardware_monitor_command(dev, raw_command)
status, result = send_hardware_monitor_command(dev, raw_command)

# expected status in case of success of "send_hardware_monitor_command" is the same as opcode
# we expect erro code instead of opcode
# we expect error code instead of opcode
expected_status = convert_bytes_string_to_decimal_list(hwmc_opcode_as_string)
test.check_equal_lists(status, expected_status)

Expand All @@ -65,17 +65,17 @@ def send_hardware_monitor_command(device, command):

#############################################################################################

test.start("GETSUBPRESETID")
test.start("GETSUBPRESETID - No Data to Return")
try:
hwmc_opcode_as_int = 0x7d
# ERR_NoDataToReturn = -21 = 0xeb
hwmc_opcode_as_string = "eb ff ff ff" # little endian

raw_command = rs.debug_protocol(dev).build_command(hwmc_opcode_as_int)
status, new_scenario_result = send_hardware_monitor_command(dev, raw_command)
status, result = send_hardware_monitor_command(dev, raw_command)

# expected status in case of success of "send_hardware_monitor_command" is the same as opcode
# we expect erro code instead of opcode
# we expect error code instead of opcode
expected_status = convert_bytes_string_to_decimal_list(hwmc_opcode_as_string)
test.check_equal_lists(status, expected_status)

Expand All @@ -85,18 +85,18 @@ def send_hardware_monitor_command(device, command):

#############################################################################################

test.start("SPWM")
test.start("Set PWM - Wrong Parameter")
try:
hwmc_opcode_as_int = 0x1a
# ERR_WrongParameter = -6 = 0xfa
hwmc_opcode_as_string = "fa ff ff ff" # little endian

raw_command = rs.debug_protocol(dev).build_command(hwmc_opcode_as_int)
raw_command[9] = 2
status, new_scenario_result = send_hardware_monitor_command(dev, raw_command)
status, result = send_hardware_monitor_command(dev, raw_command)

# expected status in case of success of "send_hardware_monitor_command" is the same as opcode
# we expect erro code instead of opcode
# we expect error code instead of opcode
expected_status = convert_bytes_string_to_decimal_list(hwmc_opcode_as_string)
test.check_equal_lists(status, expected_status)

Expand Down

0 comments on commit 6945777

Please sign in to comment.