Add some more Crc32 tests

pull/5220/head
Bond_009 4 years ago
parent e1bc322b70
commit dc9e2ad1a4

@ -19,5 +19,15 @@ namespace Jellyfin.Common.Tests
{
Assert.Equal(expected, Crc32.Compute(Encoding.UTF8.GetBytes(data)));
}
[Theory]
[InlineData(0x414fa339, "54686520717569636B2062726F776E20666F78206A756D7073206F76657220746865206C617A7920646F67")]
[InlineData(0x190a55ad, "0000000000000000000000000000000000000000000000000000000000000000")]
[InlineData(0xff6cab0b, "FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF")]
[InlineData(0x91267e8a, "000102030405060708090A0B0C0D0E0F101112131415161718191A1B1C1D1E1F")]
public static void Compute_ValidHex_Success(uint expected, string data)
{
Assert.Equal(expected, Crc32.Compute(Convert.FromHexString(data)));
}
}
}

Loading…
Cancel
Save