aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBond_009 <bond.009@outlook.com>2021-02-13 11:46:38 +0100
committerBond_009 <bond.009@outlook.com>2021-02-13 11:46:38 +0100
commitdc9e2ad1a4a21677cb22d3a2c76dee40859462bb (patch)
tree3f937e1d1afb7b60a0846be8eccc68d2ee9b48c4
parente1bc322b709756529759fbb74cb003e133f30ab6 (diff)
Add some more Crc32 tests
-rw-r--r--tests/Jellyfin.Common.Tests/Crc32Tests.cs10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/Jellyfin.Common.Tests/Crc32Tests.cs b/tests/Jellyfin.Common.Tests/Crc32Tests.cs
index d93fb839c..e95a2867f 100644
--- a/tests/Jellyfin.Common.Tests/Crc32Tests.cs
+++ b/tests/Jellyfin.Common.Tests/Crc32Tests.cs
@@ -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)));
+ }
}
}