From efd5a5a1d809a64344be8b91cea73733d48e609f Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Thu, 1 Dec 2016 22:06:42 +1100 Subject: [PATCH] Add correct tests --- tests/ImageSharp.Tests/Colors/PackedPixelTests.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/tests/ImageSharp.Tests/Colors/PackedPixelTests.cs b/tests/ImageSharp.Tests/Colors/PackedPixelTests.cs index c7d0e1c73..08786eddd 100644 --- a/tests/ImageSharp.Tests/Colors/PackedPixelTests.cs +++ b/tests/ImageSharp.Tests/Colors/PackedPixelTests.cs @@ -743,15 +743,21 @@ namespace ImageSharp.Tests.Colors byte[] bgra = new byte[4]; new Short2(x, y).ToBytes(rgb, 0, ComponentOrder.XYZ); + Assert.Equal(rgb, new byte[] { 128, 127, 0 }); new Short2(x, y).ToBytes(rgba, 0, ComponentOrder.XYZW); + Assert.Equal(rgba, new byte[] { 128, 127, 0, 255 }); new Short2(x, y).ToBytes(bgr, 0, ComponentOrder.ZYX); + Assert.Equal(bgr, new byte[] { 0, 127, 128 }); new Short2(x, y).ToBytes(bgra, 0, ComponentOrder.ZYXW); + Assert.Equal(bgra, new byte[] { 0, 127, 128, 255 }); Short2 r = new Short2(); + r.PackFromBytes(20, 38, 0, 255); r.ToBytes(rgba, 0, ComponentOrder.XYZW); + Assert.Equal(rgba, new byte[] { 20, 38, 0, 255 }); } // Comparison helpers with small tolerance to allow for floating point rounding during computations.