From: Haesu Gwon Date: Wed, 5 Sep 2018 11:12:49 +0000 (+0900) Subject: [MediaTool][TCSACR-174][Add rotate and flip method for MediaTool] X-Git-Tag: tct5.0_m2~75^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ca2ae60849c25dc21f96f28a1b89ffda8b1bdb03;p=test%2Ftct%2Fcsharp%2Fapi.git [MediaTool][TCSACR-174][Add rotate and flip method for MediaTool] Change-Id: I8656064c0ea791a4b68234213c25a18bba54230b --- diff --git a/tct-suite-vs/Tizen.Multimedia.Tests/testcase/MediaTool/TSMediaPacket.cs b/tct-suite-vs/Tizen.Multimedia.Tests/testcase/MediaTool/TSMediaPacket.cs old mode 100755 new mode 100644 index f0b1421..8755f18 --- a/tct-suite-vs/Tizen.Multimedia.Tests/testcase/MediaTool/TSMediaPacket.cs +++ b/tct-suite-vs/Tizen.Multimedia.Tests/testcase/MediaTool/TSMediaPacket.cs @@ -87,12 +87,16 @@ namespace Tizen.Multimedia.Tests Assert.Throws(() => { var v = packet.BufferWrittenLength; }); Assert.Throws(() => { var v = packet.VideoPlanes; }); Assert.Throws(() => { var v = packet.BufferFlags; }); + Assert.Throws(() => { var v = packet.Rotation; }); + Assert.Throws(() => { var v = packet.Flip; }); #endregion #region Write operations Assert.Throws(() => { packet.Pts = 1; }); Assert.Throws(() => { packet.Dts = 1; }); Assert.Throws(() => { packet.BufferFlags = MediaPacketBufferFlags.CodecConfig; }); + Assert.Throws(() => { packet.Rotation = Rotation.Rotate90; }); + Assert.Throws(() => { packet.Flip = Flips.Horizontal; }); #endregion } @@ -345,5 +349,77 @@ namespace Tizen.Multimedia.Tests Assert.AreEqual(flags, packet.BufferFlags); } } + + [Test] + [Category("P1")] + [Description("Test all available rotation enums.")] + [Property("SPEC", "Tizen.Multimedia.MediaPacket.Rotation A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRE")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public static void Rotation_VALUE() + { + using (MediaPacket packet = MediaPacket.Create(SimpleFormat)) + { + foreach (Rotation rotation in Enum.GetValues(typeof(Rotation))) + { + packet.Rotation = rotation; + Assert.AreEqual(rotation, packet.Rotation); + } + } + } + + [Test] + [Category("P2")] + [Description("Test whether Argument exception is thrown when invalid argument is set.")] + [Property("SPEC", "Tizen.Multimedia.MediaPacket.Rotation A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public static void Rotation_CHECK_EXCEPTION() + { + using (MediaPacket packet = MediaPacket.Create(SimpleFormat)) + { + Assert.Throws(() => packet.Rotation = (Rotation)(-1)); + + Assert.Throws(() => packet.Rotation = (Rotation)4); + } + } + + [Test] + [Category("P1")] + [Description("Test all available flip enums.")] + [Property("SPEC", "Tizen.Multimedia.MediaPacket.Flip A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRE")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public static void Flip_VALUE() + { + using (MediaPacket packet = MediaPacket.Create(SimpleFormat)) + { + foreach (Flips flip in Enum.GetValues(typeof(Flips))) + { + packet.Flip = flip; + Assert.AreEqual(flip, packet.Flip); + } + } + } + + [Test] + [Category("P2")] + [Description("Test whether Argument exception is thrown when invalid argument is set.")] + [Property("SPEC", "Tizen.Multimedia.MediaPacket.Flip A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public static void Flip_CHECK_EXCEPTION() + { + using (MediaPacket packet = MediaPacket.Create(SimpleFormat)) + { + Assert.Throws(() => packet.Flip = (Flips)(-1)); + + Assert.Throws(() => packet.Flip = (Flips)3); + } + } } }