From 1296dfd5ee9cbc75d08c19bb95b589d7c0dce2c4 Mon Sep 17 00:00:00 2001 From: tschumann Date: Sat, 12 Apr 2025 17:50:28 +1000 Subject: [PATCH] Fixed Linux build not compiling. --- loader/test/determinebackends1.cpp | 2 +- loader/test/main.cpp | 7 +++---- loader/test/test_determinebackends1.ps1 | 13 +++++++------ 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/loader/test/determinebackends1.cpp b/loader/test/determinebackends1.cpp index 3089b71..75adbb8 100644 --- a/loader/test/determinebackends1.cpp +++ b/loader/test/determinebackends1.cpp @@ -11,7 +11,7 @@ #define ENGINE_LIB_NAME "engine" LIB_SUFFIX #endif -bool DetermineBackendS1(char *gameDir, int expectedBackend) +bool DetermineBackendS1(const char *gameDir, int expectedBackend) { char errorBuffer[128]; void *serverLib = nullptr; diff --git a/loader/test/main.cpp b/loader/test/main.cpp index a38f25c..3adb6d2 100644 --- a/loader/test/main.cpp +++ b/loader/test/main.cpp @@ -20,13 +20,13 @@ } \ -bool DetermineBackendS1(char *gameDir, int expectedBackend); +bool DetermineBackendS1(const char *gameDir, int expectedBackend); DECL_TEST(TrimComments); int main(int argc, char *argv[]) { bool testDetermineBackendS1 = false; - char *gameDirectory = ""; + char *gameDirectory = NULL; int expectedMetamodBackend = -1; for (int i = 0; i < argc; i++) @@ -47,8 +47,7 @@ int main(int argc, char *argv[]) if (testDetermineBackendS1) { - bool success = DetermineBackendS1(gameDirectory, expectedMetamodBackend); - + bool success = DetermineBackendS1(gameDirectory ? gameDirectory : "", expectedMetamodBackend); // invert it because return code from main has 0 as success return success != true; } diff --git a/loader/test/test_determinebackends1.ps1 b/loader/test/test_determinebackends1.ps1 index 85dcf1d..39aa099 100644 --- a/loader/test/test_determinebackends1.ps1 +++ b/loader/test/test_determinebackends1.ps1 @@ -20,10 +20,10 @@ class SteamGame { [int]$ExpectedBackend [bool]$Skip - SteamGame([string]$name, [string]$enginePath, [string]$gamePath, [string]$gameDir, [string]$architecture, [bool]$isDedicatedServer, [int]$expectedBackend, [bool]$skip) { + SteamGame([string]$name, [string]$enginePath, [string]$gamePath, [string]$gameDir, [string]$architecture, [bool]$isDedicatedServer, [int]$expectedBackend, [bool]$skip) { $this.Name = $name - $this.EnginePath = $enginePath - $this.GamePath = $gamePath + $this.EnginePath = $enginePath + $this.GamePath = $gamePath $this.GameDir = $gameDir $this.Architecture = $architecture $this.IsDedicatedServer = $isDedicatedServer @@ -40,7 +40,7 @@ if ($args.Count -ge 1) $global:failureCount = 0 $gamesToTest = @{ - alienswarm = [SteamGame]::new("Alien Swarm", "common\Alien Swarm\bin", "common\Alien Swarm\swarm\bin", "swarm", "x86", $false, 9, $true) + alienswarm = [SteamGame]::new("Alien Swarm", "common\Alien Swarm\bin", "common\Alien Swarm\swarm\bin", "swarm", "x86", $false, 9, $true) blackmesa = [SteamGame]::new("Black Mesa", "common\Black Mesa\bin", "common\Black Mesa\bms\bin", "bms", "x86", $false, 21, $false) bladesymphony_32 = [SteamGame]::new("Blade Symphony (x86)", "common\Blade Symphony\bin\win32", "", "berimbau", "x86", $false, 18, $false) bladesymphony_64 = [SteamGame]::new("Blade Symphony (x64)", "common\Blade Symphony\bin\win64", "", "berimbau", "x64", $false, 18, $false) @@ -75,7 +75,7 @@ $gamesToTest = @{ function testGame([SteamGame]$game) { - Write-Host @("Testing", $game.Name) -ForegroundColor yellow + Write-Host @("Testing", $game.Name) -ForegroundColor yellow $steamappsPath = "${steamPath}\steamapps" $enginePath = "${steamappsPath}\" + $game.EnginePath @@ -95,6 +95,7 @@ function testGame([SteamGame]$game) Return } + # make gamedir the last parameter as something weird is going on where if it's "" then PowerShell is collapsing it and the next argument gets passed as gamedir if ($game.Architecture -eq "x86") { $env:Path=$enginePath + ";" + $gamePath + ";" + $env:Path; ..\..\build\loader\test\test_loader\windows-x86\test_loader.exe -testdbs1 -expectedbackend $game.ExpectedBackend -gamedir $game.GameDir @@ -125,7 +126,7 @@ function testGame([SteamGame]$game) foreach ($game in $gamesToTest.Keys | Sort-Object) { - testGame $gamesToTest[$game] + testGame $gamesToTest[$game] } Write-Host "There were ${global:failureCount} failures"