diff options
| author | Egor Tensin <egor@tensin.name> | 2026-06-15 15:35:37 +0200 |
|---|---|---|
| committer | Egor Tensin <egor@tensin.name> | 2026-06-15 15:48:43 +0200 |
| commit | d5a08bf9743a88528869c463a8edc178b59b05cd (patch) | |
| tree | dfd144a7e8f183a05e5ec1b58272a8b6b59539a3 /scripts/test.ps1 | |
| parent | add dependabot.yml (diff) | |
| download | windows7-drivers-d5a08bf9743a88528869c463a8edc178b59b05cd.tar.gz windows7-drivers-d5a08bf9743a88528869c463a8edc178b59b05cd.zip | |
test.ps1: add a test for nt_namespace
Diffstat (limited to 'scripts/test.ps1')
| -rw-r--r-- | scripts/test.ps1 | 34 |
1 files changed, 30 insertions, 4 deletions
diff --git a/scripts/test.ps1 b/scripts/test.ps1 index fc97e29..e933c06 100644 --- a/scripts/test.ps1 +++ b/scripts/test.ps1 @@ -71,14 +71,39 @@ function Verify-ExchangeInts { [int] $OldInt ) - $old_int = Invoke-Exe { exchange_ints.exe $NewInt } - if ($old_int -ne $OldInt) { - throw "Expected $OldInt, got: $old_int" + $actual = Exchange-Ints $NewInt + if ($actual -ne $OldInt) { + throw "Expected $OldInt, got: $actual" } else { - Write-Host "Previous integer: $old_int, new integer: $NewInt" + Write-Host "Previous integer: $actual, new integer: $NewInt" } } +function Convert-NTPath { + param( + [Parameter(Mandatory=$true)] + [string] $NTPath + ) + + return Invoke-Exe { convert_nt_path.exe $NTPath } +} + +function Verify-ConvertNTPath { + param( + [Parameter(Mandatory=$true)] + [string] $NTPath, + [Parameter(Mandatory=$true)] + [string] $Expected + ) + + $actual = Convert-NTPath $NTPath + if ($actual -ne $expected) { + throw "Expected $expected, got: $actual" + } + Write-Host "NT path: $NTPath" + Write-Host "DOS path: $actual" +} + function Run-ProjectTests { param( [Parameter(Mandatory=$true)] @@ -97,6 +122,7 @@ function Run-ProjectTests { Verify-ExchangeInts -NewInt 69 -OldInt 42 Verify-ExchangeInts -NewInt 100500 -OldInt 69 + Verify-ConvertNTPath \DosDevices\C:\Windows C:\Windows foreach ($driver in $drivers) { Stop-Driver -DriverName $driver |
