Make Gitea core validation source-only

This commit is contained in:
gamer147
2026-08-03 13:28:59 -04:00
parent 4db2f416cf
commit 71ec6e55ed
38 changed files with 154 additions and 40 deletions

View File

@@ -156,6 +156,7 @@ public class AdvTextHistoryTests
}
[Fact]
[Trait("Category", "Workspace")]
public void RealSc0000FirstPagePopulatesTheRetainedBacklogBeforeItsWait()
{
var scripts = Sys4ScriptProvider.Load(Table);

View File

@@ -259,6 +259,7 @@ public class AdvTextOpsTests
}
[Fact]
[Trait("Category", "Workspace")]
public void RealMamesResearchDescriptionUsesImmediateRetainedTextPath()
{
var table = OpcodeTableJson.Load(Paths.OpcodesJson);
@@ -310,6 +311,7 @@ public class AdvTextOpsTests
}
[Fact]
[Trait("Category", "Workspace")]
public void System4BootstrapReplaysAllResetCursorAndBoundsConfigurations()
{
var table = OpcodeTableJson.Load(Paths.OpcodesJson);

View File

@@ -71,6 +71,7 @@ public class AgfDecoderTests
}
[Fact]
[Trait("Category", "Workspace")]
public void InstalledSo001HasExpectedAlphaBearingDimensions()
{
var catalog = Sys4AssetCatalog.Load(Paths.Sys4Ini);
@@ -87,6 +88,7 @@ public class AgfDecoderTests
[InlineData(0x32db, "SO007.AGF")]
[InlineData(0x32dc, "SO008A.AGF")]
[InlineData(0x32dd, "SO007A.AGF")]
[Trait("Category", "Workspace")]
public void InstalledFieldMapSheetsResolveAndDecodeByRawCatalogIndex(int rawId, string name)
{
var resources = ResourceMap.Load();

View File

@@ -160,6 +160,7 @@ public class AudioMixerOpcodeTests
}
[Fact]
[Trait("Category", "Workspace")]
public void NativePersistencePathsComeFromIndependentSys4IniProfileValues()
{
Sys4AssetCatalog catalog = Sys4AssetCatalog.Load(Paths.Sys4Ini);
@@ -177,6 +178,7 @@ public class AudioMixerOpcodeTests
}
[Fact]
[Trait("Category", "Workspace")]
public void ProfileOverrideRedirectsSaveAndSettingsAsOneNativeLayout()
{
Sys4AssetCatalog catalog = Sys4AssetCatalog.Load(Paths.Sys4Ini);

View File

@@ -3,6 +3,7 @@ using Age.Engine.Sys4;
using Age.Engine.Vm;
using Xunit;
[Trait("Category", "Workspace")]
public class CallScriptIntegrationTests
{
private sealed class NullHost : IHost

View File

@@ -97,6 +97,7 @@ public class CoroutineHostModelTests
}
[Fact]
[Trait("Category", "Workspace")]
public void Sc0000EntryRunsSetupAndFillsDistinctTextureSlots()
{
var script = Sys4Loader.Load(Paths.Scripts()["SC0000.BIN"], Table);

View File

@@ -6,6 +6,7 @@ using Xunit;
public class CurDecoderTests
{
[Fact]
[Trait("Category", "Workspace")]
public void HimegariCursor_DecodesPixelsAndHotspot()
{
var resources = ResourceMap.Load();
@@ -24,6 +25,7 @@ public class CurDecoderTests
}
[Fact]
[Trait("Category", "Workspace")]
public void HimegariPanCursor_DecodesFourBitPixelsAndHotspot()
{
var resources = ResourceMap.Load();

View File

@@ -22,6 +22,7 @@ public class FrameYieldTests
}
[Fact]
[Trait("Category", "Workspace")]
public void FrameYield_CalledOncePerStep()
{
var table = OpcodeTableJson.Load(Paths.OpcodesJson);

View File

@@ -61,6 +61,7 @@ public class GameSessionTests
}
[Fact]
[Trait("Category", "Workspace")]
public void SC0000ViaSessionMatchesSingleRun()
{
var script = Sys4Loader.Load(Paths.Scripts()["SC0000.BIN"], Table);
@@ -77,6 +78,7 @@ public class GameSessionTests
}
[Fact]
[Trait("Category", "Workspace")]
public void BootingSkinitPopulatesDataTableGlobals()
{
// Running the SKINIT data script through the session populates the real skill table into the
@@ -103,6 +105,7 @@ public class GameSessionTests
}
[Fact]
[Trait("Category", "Workspace")]
public void BootedStateSurvivesSnapshot()
{
var s = new GameSession();
@@ -115,6 +118,7 @@ public class GameSessionTests
}
[Fact]
[Trait("Category", "Workspace")]
public void SeedingFormFlagChangesBehavior()
{
// Lily's lines are gated on form flags G[0xa57/8/9]; unseeded => all skipped (0 voices on her lines).

View File

@@ -62,6 +62,7 @@ public class HistoryDataOpsTests
}
[Fact]
[Trait("Category", "Workspace")]
public void LoaderRetainsRealHistoryFooterArraysForRuntimeCopy()
{
var history = Sys4Loader.Load(Paths.Scripts()["HISTORY.BIN"], Table);

View File

@@ -179,6 +179,7 @@ public class HistoryInteractionOpsTests
}
[Fact]
[Trait("Category", "Workspace")]
public void RealHistoryWheelUpNavigatesToOlderRetainedRows()
{
var scripts = Sys4ScriptProvider.Load(Table);
@@ -196,6 +197,7 @@ public class HistoryInteractionOpsTests
}
[Fact]
[Trait("Category", "Workspace")]
public void RealHistoryRendersMultipleRowsAfterSeveralSc0000Messages()
{
var scripts = Sys4ScriptProvider.Load(Table);
@@ -282,6 +284,7 @@ public class HistoryInteractionOpsTests
}
[Fact]
[Trait("Category", "Workspace")]
public void RealSc0000HistoryButtonRendersAndClosesWithoutAdvancingThePageWait()
{
var scripts = Sys4ScriptProvider.Load(Table);
@@ -323,6 +326,7 @@ public class HistoryInteractionOpsTests
}
[Fact]
[Trait("Category", "Workspace")]
public void RealHistoryVoicedRowDispatchesItsRetainedVoicePair()
{
var scripts = Sys4ScriptProvider.Load(Table);

View File

@@ -109,6 +109,7 @@ public class HistoryPresentationOpsTests
}
[Fact]
[Trait("Category", "Workspace")]
public void RealHistoryScriptBuildsVisibleRowsFromARealSc0000Page()
{
var scripts = Sys4ScriptProvider.Load(Table);

View File

@@ -255,6 +255,7 @@ public class HotspotInputTests
}
[Fact]
[Trait("Category", "Workspace")]
public void Sc0000AdvChromeBootstrap_VisitsAllFiveVisibleButtonRegistrations()
{
var table = OpcodeTableJson.Load(Paths.OpcodesJson);
@@ -274,6 +275,7 @@ public class HotspotInputTests
}
[Fact]
[Trait("Category", "Workspace")]
public void Sc0000FirstWait_DispatchesRealHistoryHoverCallback()
{
var table = OpcodeTableJson.Load(Paths.OpcodesJson);
@@ -436,6 +438,7 @@ public class HotspotInputTests
}
[Fact]
[Trait("Category", "Workspace")]
public void Sc0000MessageSkipButton_EnablesPersistentServiceState()
{
var table = OpcodeTableJson.Load(Paths.OpcodesJson);
@@ -471,6 +474,7 @@ public class HotspotInputTests
}
[Fact]
[Trait("Category", "Workspace")]
public void Sc0000HideWindowButton_RunsRealHidewinAndReturnsToAdvWait()
{
var table = OpcodeTableJson.Load(Paths.OpcodesJson);
@@ -497,6 +501,7 @@ public class HotspotInputTests
}
[Fact]
[Trait("Category", "Workspace")]
public void Sc0000ActionSeven_EntersRealMenuAndRestoresParentAdvHotspots()
{
var table = OpcodeTableJson.Load(Paths.OpcodesJson);

View File

@@ -48,6 +48,7 @@ public class InputBindingTests
}
[Fact]
[Trait("Category", "Workspace")]
public void System4BootstrapReplaysAllSixteenInputConfigurationCalls()
{
var scripts = Sys4ScriptProvider.Load(Table);
@@ -72,6 +73,7 @@ public class InputBindingTests
[InlineData(0x08)] // retained native Backspace default
[InlineData(0x11)] // SYSTEM4 LeftCtrl binding
[InlineData(0x43)] // SYSTEM4 C binding
[Trait("Category", "Workspace")]
public void LogicalActionSixDrivesHeldAdvFastForward(int virtualKey)
{
var script = ScriptAssembler.Assemble(Table, "ADV_FAST_FORWARD", new List<(int, Operand[])>
@@ -99,6 +101,7 @@ public class InputBindingTests
}
[Fact]
[Trait("Category", "Workspace")]
public void HeldLogicalActionSixSurvivesPersistentSkipLifecycleSuspension()
{
var script = ScriptAssembler.Assemble(Table, "HELD_SKIP_LIFECYCLE", new List<(int, Operand[])>
@@ -122,6 +125,7 @@ public class InputBindingTests
}
[Fact]
[Trait("Category", "Workspace")]
public void ReleasingPhysicalFastForwardDoesNotClearPersistentSkip()
{
var script = ScriptAssembler.Assemble(Table, "ADV_PERSISTENT_AND_HELD_SKIP", new List<(int, Operand[])>

View File

@@ -87,6 +87,7 @@ public class IntegerQueueOpsTests
}
[Fact]
[Trait("Category", "Workspace")]
public void RegisteredRealMvseek_ExpandsMovementCostsThroughTheSystem4ServiceAbi()
{
var table = OpcodeTableJson.Load(Paths.OpcodesJson);
@@ -111,6 +112,7 @@ public class IntegerQueueOpsTests
}
[Fact]
[Trait("Category", "Workspace")]
public void RealMvseek_ExpandsMovementCostsBeyondTheOrigin()
{
var vm = RealSearchVm("MVSEEK.BIN");
@@ -126,6 +128,7 @@ public class IntegerQueueOpsTests
}
[Fact]
[Trait("Category", "Workspace")]
public void RealAtseek_ExpandsAttackDistancesBeyondTheOrigin()
{
var vm = RealSearchVm("ATSEEK.BIN");

View File

@@ -554,6 +554,7 @@ public class MovieOpcodeTests
}
[Fact]
[Trait("Category", "Workspace")]
public void Sc0000ResumesImmediatelyAfterMovieOpcodeAtBytecodeOffset13d1()
{
var table = OpcodeTableJson.Load(Paths.OpcodesJson);
@@ -756,6 +757,7 @@ public class MovieOpcodeTests
}
[Fact]
[Trait("Category", "Workspace")]
public void Sc0000MoviePayloadReadsFromArchiveVfsAndIsMpegProgramStream()
{
var catalog = Sys4AssetCatalog.Load(Paths.Sys4Ini);
@@ -771,6 +773,7 @@ public class MovieOpcodeTests
[Theory]
[InlineData(0x335f, "LOGO.AGF")]
[InlineData(0x3364, "OP.AGF")]
[Trait("Category", "Workspace")]
public void ModalMoviePayloadResolvesFromUniversalPackedCatalog(int resourceId, string expectedName)
{
var catalog = Sys4AssetCatalog.Load(Paths.Sys4Ini);
@@ -783,6 +786,7 @@ public class MovieOpcodeTests
}
[Fact]
[Trait("Category", "Workspace")]
public void DebugTestMovieDecodesToExactGreenMaskDimensions()
{
if (!OperatingSystem.IsWindows()) return;
@@ -807,6 +811,7 @@ public class MovieOpcodeTests
[Theory]
[InlineData(0x335f, "LOGO.AGF")]
[InlineData(0x3364, "OP.AGF")]
[Trait("Category", "Workspace")]
public void ModalMovieOpeningFramesAreOpaqueAndHaveContinuousCadence(
int resourceId, string expectedName)
{
@@ -841,6 +846,7 @@ public class MovieOpcodeTests
[InlineData(0x2b94, "MVB238.AGF", 280, 352, 866)]
[InlineData(0x2bc2, "MVB908.AGF", 400, 400, 333)]
[InlineData(0x33, "CHAPTER.AGF", 800, 600, 12016)]
[Trait("Category", "Workspace")]
public void FfmpegShimDecodesRepresentativeVfsMovie(int resourceId, string expectedName,
int expectedWidth, int expectedHeight,
long expectedStopTimeMs)
@@ -879,6 +885,7 @@ public class MovieOpcodeTests
[InlineData(0x33, "CHAPTER.AGF")]
[InlineData(0x2bf1, "MVS001.AGF")]
[InlineData(0x335f, "LOGO.AGF")]
[Trait("Category", "Workspace")]
public void FfmpegShimDecodesRepresentativeMpegAudio(int resourceId, string expectedName)
{
if (!OperatingSystem.IsWindows()) return;
@@ -912,6 +919,7 @@ public class MovieOpcodeTests
}
[Fact]
[Trait("Category", "Workspace")]
public void FfmpegShimSeeksBothVideoAndAudioNearRequestedPosition()
{
if (!OperatingSystem.IsWindows()) return;
@@ -943,6 +951,7 @@ public class MovieOpcodeTests
}
[Fact]
[Trait("Category", "Workspace")]
public void FfmpegShimRejectsTruncatedMovieWithBoundedDiagnostic()
{
if (!OperatingSystem.IsWindows()) return;
@@ -956,6 +965,7 @@ public class MovieOpcodeTests
}
[Fact]
[Trait("Category", "Workspace")]
public void FfmpegShimSupportsRepeatedOpenAndClose()
{
if (!OperatingSystem.IsWindows()) return;
@@ -974,6 +984,7 @@ public class MovieOpcodeTests
[Theory]
[InlineData(0x2be3, 280, 500, 450)]
[InlineData(0x2bc2, 400, 333, 300)]
[Trait("Category", "Workspace")]
public void FfmpegPacedDecoderKeepsRealMovieAliveThroughItsStopTime(
int resourceId, int expectedWidth, long expectedStopTimeMs, long minimumElapsedMs)
{

View File

@@ -4,6 +4,7 @@ using Age.Engine.Sys4;
using Age.Engine.Vm;
using Xunit;
[Trait("Category", "Workspace")]
public class NaturalBootIntegrationTests
{
private sealed class ReachedSc0000Exception : Exception { }

View File

@@ -64,6 +64,7 @@ public class ReadTextDatabaseTests
}
[Fact]
[Trait("Category", "Workspace")]
public void InstalledNativeRtDatRoundTripsItsLogicalRecordsWhenPresent()
{
string path = Path.Combine(

View File

@@ -9,6 +9,7 @@ public class RecoverTests
private static long G(VirtualMachine vm, int k) => vm.Globals.TryGetValue(k, out var v) ? v : 0;
[Fact]
[Trait("Category", "Workspace")]
public void RecoverUnitTestPasses()
{
var table = OpcodeTableJson.Load(Paths.OpcodesJson);

View File

@@ -48,6 +48,7 @@ public class RiffWaveSanitizerTests
}
[Fact]
[Trait("Category", "Workspace")]
public void InstalledSc0000GlowSoundDropsCp932InfoBlockWithoutChangingPcmData()
{
var resources = ResourceMap.Load();
@@ -63,6 +64,7 @@ public class RiffWaveSanitizerTests
}
[Fact]
[Trait("Category", "Workspace")]
public void InstalledFirstBossSoundStopsAtFirstDeclaredRiff()
{
var resources = ResourceMap.Load();

View File

@@ -85,6 +85,7 @@ public class RootReloadTests
}
[Fact]
[Trait("Category", "Workspace")]
public void HimegariRawScriptZeroIsSystem4()
{
var table = OpcodeTableJson.Load(Paths.OpcodesJson);

View File

@@ -5,6 +5,7 @@ using Age.Engine.Persistence;
using Age.Engine.Sys4;
using Age.Engine.Vm;
[Trait("Category", "Workspace")]
public class SaveUiIntegrationTests
{
private sealed class MenuReadyException : Exception;

View File

@@ -265,6 +265,7 @@ public class SharedProfileTests
}
[Fact]
[Trait("Category", "Workspace")]
public void InstalledSharedProfileUnlocksKnownCgAndHSceneResourcesWhenPresent()
{
string root = Path.Combine(

View File

@@ -8,6 +8,7 @@ using Xunit;
public class Sys4AssetStoreTests
{
[Fact]
[Trait("Category", "Workspace")]
public void InstalledAppendCatalogHasNativePackSelectionAndStableDirectory()
{
var catalog = Sys4AssetCatalog.Load(Paths.Sys4Ini);
@@ -40,6 +41,7 @@ public class Sys4AssetStoreTests
}
[Fact]
[Trait("Category", "Workspace")]
public void CompletePackedAssetEnumerationPreservesBaseThenAppendOrder()
{
var catalog = Sys4AssetCatalog.Load(Paths.Sys4Ini);
@@ -57,6 +59,7 @@ public class Sys4AssetStoreTests
}
[Fact]
[Trait("Category", "Workspace")]
public void CompleteAppendDirectoryAndPayloadsMatchBinExtractAlf()
{
string temp = Path.Combine(Path.GetTempPath(), "age-vfsb-oracle-" + Guid.NewGuid().ToString("N"));
@@ -105,6 +108,7 @@ public class Sys4AssetStoreTests
}
[Fact]
[Trait("Category", "Workspace")]
public void RuntimeCatalogMatchesDiagnosticCatalogAndSceneViews()
{
var catalog = Sys4AssetCatalog.Load(Paths.Sys4Ini);
@@ -154,6 +158,7 @@ public class Sys4AssetStoreTests
}
[Fact]
[Trait("Category", "Workspace")]
public void EveryCatalogRangeFitsAndRepresentativePayloadsMatchExtractedData()
{
var catalog = Sys4AssetCatalog.Load(Paths.Sys4Ini);
@@ -186,6 +191,7 @@ public class Sys4AssetStoreTests
}
[Fact]
[Trait("Category", "Workspace")]
public void Sc0000RoomAndTitleAudioPayloadsReadDirectlyFromTheirNativeAddressSpaces()
{
var catalog = Sys4AssetCatalog.Load(Paths.Sys4Ini);
@@ -222,6 +228,7 @@ public class Sys4AssetStoreTests
}
[Fact]
[Trait("Category", "Workspace")]
public void Sc0010LowOperandsAreAlreadyUniversalPackedIds()
{
var resources = ResourceMap.Load();
@@ -236,6 +243,7 @@ public class Sys4AssetStoreTests
}
[Fact]
[Trait("Category", "Workspace")]
public void TypedResourceResolutionPreservesAppendPackSelector()
{
var catalog = Sys4AssetCatalog.Load(Paths.Sys4Ini);
@@ -249,6 +257,7 @@ public class Sys4AssetStoreTests
}
[Fact]
[Trait("Category", "Workspace")]
public void AllInstalledLooseScriptOverridesShadowArchiveCopies()
{
var catalog = Sys4AssetCatalog.Load(Paths.Sys4Ini);
@@ -281,7 +290,7 @@ public class Sys4AssetStoreTests
try
{
File.WriteAllBytes(Path.Combine(archives, "DATA1.ALF"), new byte[] { 9, 8, 1, 2, 3, 7 });
var catalog = Sys4AssetCatalog.Load(Paths.Sys4Ini);
var catalog = Sys4AssetCatalog.Parse(Sys4StartupSettingsTests.BuildCatalog(includeTrailer: true));
var entry = new AssetEntry("TEST.BIN", "DATA1.ALF", 2, 3);
var store = new Sys4AssetStore(catalog, archives, loose);

View File

@@ -4,6 +4,7 @@ using Xunit;
public class Sys4LoaderTests
{
[Fact]
[Trait("Category", "Workspace")]
public void ParsesMenuBinLikeSys4load()
{
var table = OpcodeTableJson.Load(Paths.OpcodesJson);

View File

@@ -2,6 +2,7 @@ using Age.Engine.Sys4;
using Age.Engine.Diagnostics;
using Xunit;
[Trait("Category", "Workspace")]
public class Sys4ScriptProviderTests
{
[Fact]

View File

@@ -5,6 +5,7 @@ using Age.Engine.Sys4;
public class Sys4StartupSettingsTests
{
[Fact]
[Trait("Category", "Workspace")]
public void InstalledCatalogExposesOrderedStartupSettingsAndLogicalCanvas()
{
var catalog = Sys4AssetCatalog.Load(Paths.Sys4Ini);
@@ -100,7 +101,7 @@ public class Sys4StartupSettingsTests
params (string Key, string Value)[] pairs)
=> WrapCatalog(BuildExpanded(pairs));
private static byte[] BuildCatalog(bool includeTrailer)
internal static byte[] BuildCatalog(bool includeTrailer)
=> WrapCatalog(BuildExpanded(Array.Empty<(string, string)>(), includeTrailer));
private static byte[] BuildExpanded(

View File

@@ -24,6 +24,7 @@ public class TextureOpsTests
}
[Fact]
[Trait("Category", "Workspace")]
public void SC0000FiresTextureOpsWithAssignedFullScreenSlot()
{
var table = OpcodeTableJson.Load(Paths.OpcodesJson);

View File

@@ -19,10 +19,16 @@ public static class Paths
private static string FindRepo()
{
var d = new DirectoryInfo(AppContext.BaseDirectory);
while (d != null && d.Name != "age-reimpl") d = d.Parent;
if (d == null) throw new DirectoryNotFoundException(
"age-reimpl root not found above " + AppContext.BaseDirectory);
return d.FullName;
while (d != null)
{
if (File.Exists(Path.Combine(d.FullName, "global.json"))
&& File.Exists(Path.Combine(d.FullName, "engine", "AgeEngine.sln"))
&& File.Exists(Path.Combine(d.FullName, "vm-map", "opcodes.toml")))
return d.FullName;
d = d.Parent;
}
throw new DirectoryNotFoundException(
"repository root not found above " + AppContext.BaseDirectory);
}
/// name(UPPER).BIN -> path; game-dir loose overrides shadow extracted/DATA1 (mirrors paths.scripts()).