d35823a4a9
Roll-forward of today-slices 6fd1d9c onto the slice-8 base, two-loop hunk dropped. Release counter (per-build GUID read as noise; +1 per commit from git rev-list, baseline 241 -> #13, generated by GenerateBuildStamp; GUID demotes to startup.log). Tests pinned to Label/#N >= 13; wordmark display test asserts the Label. Flash fix (take 14 finding): consumer holds must never outlive depth x source period — 4 slots at high refresh lap ~27ms vs a <=50ms compositor read, so a recycled slot flashed its new frame over the lagged old one. All shared rings 4->8 (OBS/overlay precedent for ring discipline). Camera producer now rotates an 8-deep ring + Epoch instead of a fresh ~3.7MB array per device frame (110-220MB/s LOH churn); WebView2 capture reuses a canvas scratch + 8-deep output ring + a reused WriteableBitmap instead of two fresh arrays + a fresh bitmap per 10Hz tick. Paste cache stays identity-keyed (Epoch).
68 lines
2.6 KiB
C#
68 lines
2.6 KiB
C#
using System;
|
|
using System.Text.RegularExpressions;
|
|
using System.Windows;
|
|
using System.Windows.Controls;
|
|
using System.Windows.Documents;
|
|
using Xunit;
|
|
using ytLive.Helpers;
|
|
|
|
namespace ytLive.Tests;
|
|
|
|
/// <summary>
|
|
/// Build attribution (2026-09-04): the UI carries the release counter (#N, +1 per
|
|
/// commit, from git rev-list — stable across rebuilds of one commit); the per-build
|
|
/// GUID stays in startup.log for forensics.
|
|
/// every build stamps a fresh GUID (ytLive.csproj GenerateBuildStamp), shown as the
|
|
/// wordmark superscript and logged at startup. The unit pins the stamp shape; the
|
|
/// RealApp test proves the wordmark ACTUALLY displays it (XAML wiring, live visual
|
|
/// tree) — a stamp nobody can see would not have ended the guessing.
|
|
/// </summary>
|
|
public sealed class BuildStampTests
|
|
{
|
|
[Fact]
|
|
public void Stamp_IsAFreshHexIdAndParsableTimestamp()
|
|
{
|
|
// The UI shows the RELEASE COUNTER (creator ruling 2026-09-04: a per-build
|
|
// GUID changed on every launch and read as noise; #N ticks +1 per commit,
|
|
// started at 13 — derived from git rev-list, stable within a commit).
|
|
Assert.True(BuildStamp.Release >= 13, $"release counter regressed: {BuildStamp.Release}");
|
|
Assert.Equal(BuildStamp.Label, $"#{BuildStamp.Release}");
|
|
// The GUID survives as the forensic per-build id (startup.log only).
|
|
Assert.Matches(new Regex("^[0-9a-f]{8}$"), BuildStamp.Id);
|
|
Assert.True(DateTime.TryParseExact(BuildStamp.BuiltLocal, "yyyy-MM-dd HH:mm:ss",
|
|
null, System.Globalization.DateTimeStyles.None, out var built));
|
|
Assert.True(built <= DateTime.Now);
|
|
Assert.True(built.Date >= new DateTime(2026, 9, 4));
|
|
}
|
|
}
|
|
|
|
[Collection("RealApp")]
|
|
public sealed class BuildStampDisplayTests
|
|
{
|
|
private readonly RealAppHost _app;
|
|
|
|
public BuildStampDisplayTests(RealAppHost app) => _app = app;
|
|
|
|
[Fact]
|
|
public void Wordmark_Shows_The_Build_Stamp_As_Superscript()
|
|
{
|
|
_app.Run(() =>
|
|
{
|
|
var window = new MainWindow();
|
|
try
|
|
{
|
|
// TopBar is its own namescope (UserControl) — FindName from the
|
|
// control, never from the window (MyMistakes: namescoped FindName).
|
|
var topBar = (UserControl)window.FindName("TopBar")!;
|
|
var stamp = (Run)topBar.FindName("BuildIdStamp")!;
|
|
Assert.Equal(BuildStamp.Label, stamp.Text);
|
|
Assert.Equal(BaselineAlignment.Superscript, stamp.BaselineAlignment);
|
|
}
|
|
finally
|
|
{
|
|
window.Close();
|
|
}
|
|
});
|
|
}
|
|
}
|