Skip to content

Commit

Permalink
halcmd: fix "tune" command locking.
Browse files Browse the repository at this point in the history
Added a unit test to test the various lock commands produce the expected output.
  • Loading branch information
ChrisNisbet01 committed Oct 29, 2020
1 parent 06c333a commit a5103f6
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/halrun-lock/README
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Tests that the various lock commands result in the expected locking status.
28 changes: 28 additions & 0 deletions tests/halrun-lock/expected
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
HAL locking status:
current lock value 0 (00)
HAL_LOCK_NONE - nothing is locked
HAL locking status:
current lock value 255 (ff)
HAL_LOCK_LOAD - loading of new components is locked
HAL_LOCK_CONFIG - link and addf is locked
HAL_LOCK_PARAMS - setting params is locked
HAL_LOCK_RUN - running/stopping HAL is locked
HAL locking status:
current lock value 0 (00)
HAL_LOCK_NONE - nothing is locked
HAL locking status:
current lock value 3 (03)
HAL_LOCK_LOAD - loading of new components is locked
HAL_LOCK_CONFIG - link and addf is locked
HAL locking status:
current lock value 0 (00)
HAL_LOCK_NONE - nothing is locked
HAL locking status:
current lock value 255 (ff)
HAL_LOCK_LOAD - loading of new components is locked
HAL_LOCK_CONFIG - link and addf is locked
HAL_LOCK_PARAMS - setting params is locked
HAL_LOCK_RUN - running/stopping HAL is locked
HAL locking status:
current lock value 0 (00)
HAL_LOCK_NONE - nothing is locked
14 changes: 14 additions & 0 deletions tests/halrun-lock/halrun.hal
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
status
lock
status
unlock
status
lock tune
status
unlock tune
status
lock all
status
unlock all
status

4 changes: 4 additions & 0 deletions tests/halrun-lock/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

halrun -f halrun.hal | grep -i lock

0 comments on commit a5103f6

Please sign in to comment.