旧存档的假卡补上风扇数、供电口破绽

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
ZHU MINCHAOandClaude Sonnet 5.5 committed 2026-11-04 22:24:19 +08:00
1 parent 39ab7822ba
commit c10cf1ea19
3 files changed
+36 -1

No files matched your search

@@ -468,6 +468,24 @@ internal static class Program
Check(new[] { CardLabels.RowCount, CardLabels.RowPin, CardLabels.RowPrint, CardLabels.RowSerial }.All(r => gs.Get(r) == gt.Get(r)), "真卡四项依据全部符合");
});
Test("旧存档兼容:6 位旧外观的假卡补上风扇数、供电口破绽,真卡和新格式不动", () =>
{
var old = CardLook.Decode("000000");
var fake = CardLook.Legacy("000000", old, "RTX90", "RTX60");
var u = new Unit { Model = "RTX90", FakeOf = "RTX60", Health = 80, Look = fake };
Check(fake.CountBad == 1 && fake.PinBad == 1 && u.ObservedCount == 1 && u.ObservedPin == 0, "旧版的低档冒充高档:风扇数和供电口都对不上");
var claim = new Claim { Model = "RTX90" };
Check(claim.Get(CardLabels.RowCount) != Claim.Truth(u).Get(CardLabels.RowCount) && claim.Get(CardLabels.RowPin) != Claim.Truth(u).Get(CardLabels.RowPin), "说成标称型号时两项依据都与实物不符");
var sameCount = CardLook.Legacy("000000", old, "RTX80", "RTX60");
Check(sameCount.CountBad == 1 && sameCount.PinBad == 1, "RTX 80 冒充:风扇数 3 对 1、供电口 8 针对 6 针都不同");
var same = CardLook.Legacy("000000", old, "RTX80", "RX800");
Check(same.CountBad == 0 && same.PinBad == 0, "档次相同(风扇数、供电口一样)的假卡补不出破绽,也不会误加");
Check(CardLook.Legacy("000000", old, "RTX90", null).CountBad == 0, "真卡不动");
var newer = new CardLook { CountBad = 0, PinBad = 1, Print = 2 };
Check(CardLook.Legacy(newer.Encode(), CardLook.Decode(newer.Encode()), "RTX90", "RTX60").CountBad == 0, "新格式(8 位)不再补");
Check(CardLook.Decode(newer.Encode()).PinBad == 1 && CardLook.Decode("012012").Fan == 0 && CardLook.Decode("01201").Sticker == 1 && CardLook.Decode("01201").Serial == 0, "新旧格式都能读");
});
Test("外观随损耗重算:越旧外观越差;种子固定;算力受风扇与金手指影响", () =>
{
var rng = new Rng(5);