Solution layout, build rules with zero-package guard, in-house test framework, localization runtime, brand mark rasteriser with ICO/PNG generation, Core contracts (imaging, video, domain model, TIFF reader), Titano.Tools (make-icon, i18n, xaml-lint, package-guard) and docs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012iLMBNwBE2GnphAsu4cjaC
26 lines
714 B
C#
26 lines
714 B
C#
using System.Text;
|
|
using Titano.Core.Hashing;
|
|
using Titano.Testing;
|
|
|
|
namespace Titano.Core.Tests.Foundation;
|
|
|
|
public sealed class Crc32Tests
|
|
{
|
|
[Test]
|
|
public void CheckValueMatchesStandard() => Assert.Equal(0xCBF43926u, Crc32.Compute("123456789"u8));
|
|
|
|
[Test]
|
|
public void IncrementalEqualsOneShot()
|
|
{
|
|
var data = Encoding.ASCII.GetBytes(new string('x', 1000) + "titano");
|
|
var crc = new Crc32();
|
|
crc.Append(data.AsSpan(0, 7));
|
|
crc.Append(data.AsSpan(7, 500));
|
|
crc.Append(data.AsSpan(507));
|
|
Assert.Equal(Crc32.Compute(data), crc.GetCurrentHashAsUInt32());
|
|
}
|
|
|
|
[Test]
|
|
public void EmptyInputIsZero() => Assert.Equal(0u, Crc32.Compute([]));
|
|
}
|