reset, save

- removed 'lock' test, corrected README example
- can now test 'save', 'reset', 'load'

prelim test for potato passes
This commit is contained in:
pblivingston
2025-12-03 15:07:25 -05:00
parent b5546aa56c
commit cfa7de9b11
4 changed files with 55 additions and 8 deletions

View File

@@ -184,12 +184,6 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' {
}
}
Context 'Command' {
It 'Should set command.lock' {
$vmr.command.lock = $value
}
}
Context 'Fx' -Skip:$ifNotPotato {
Context 'Delay' {
It 'Should set and get Fx.delay.on' {
@@ -948,6 +942,51 @@ Describe -Tag 'higher', -TestName 'All Higher Tests' {
}
}
}
Context 'Command' {
It 'Should save, reset, then load config' -ForEach @(
@{ Gain = -27.1; Mode = 'composite'; Bit = 24; Port = 1044 }
) {
$tmp = [System.IO.Path]::Combine([System.IO.Path]::GetTempPath(), "vmrconfig-$(New-Guid).xml")
try {
# set some values
$vmr.strip[$virt_in].gain = $gain
$vmr.bus[$phys_out].mode.set($mode)
$vmr.vban.outstream[$vban_outA].bit = $bit
$vmr.vban.port = $port
# save config
$vmr.command.save($tmp)
Start-Sleep -Milliseconds 100
Test-Path $tmp | Should -BeTrue
# reset config
$vmr.command.reset()
Start-Sleep -Milliseconds 500
# verify default values
$vmr.strip[$virt_in].gain | Should -Be 0.0
$vmr.bus[$phys_out].mode.get() | Should -Be 'normal'
$vmr.vban.outstream[$vban_outA].bit | Should -Be 16
$vmr.vban.port | Should -Be 6980
# load config
$vmr.command.load($tmp)
Start-Sleep -Milliseconds 500
# verify values
$vmr.strip[$virt_in].gain | Should -Be $gain
$vmr.bus[$phys_out].mode.get() | Should -Be $mode
$vmr.vban.outstream[$vban_outA].bit | Should -Be $bit
$vmr.vban.port | Should -Be $port
}
finally {
if (Test-Path $tmp) {
Remove-Item $tmp -Force
}
}
}
}
}
Describe 'Action Tests' -Tag 'action' {