Assert.Throws<ObjectDisposedException>(() => { var v = packet.BufferWrittenLength; });
Assert.Throws<ObjectDisposedException>(() => { var v = packet.VideoPlanes; });
Assert.Throws<ObjectDisposedException>(() => { var v = packet.BufferFlags; });
+ Assert.Throws<ObjectDisposedException>(() => { var v = packet.Rotation; });
+ Assert.Throws<ObjectDisposedException>(() => { var v = packet.Flip; });
#endregion
#region Write operations
Assert.Throws<ObjectDisposedException>(() => { packet.Pts = 1; });
Assert.Throws<ObjectDisposedException>(() => { packet.Dts = 1; });
Assert.Throws<ObjectDisposedException>(() => { packet.BufferFlags = MediaPacketBufferFlags.CodecConfig; });
+ Assert.Throws<ObjectDisposedException>(() => { packet.Rotation = Rotation.Rotate90; });
+ Assert.Throws<ObjectDisposedException>(() => { packet.Flip = Flips.Horizontal; });
#endregion
}
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<ArgumentException>(() => packet.Rotation = (Rotation)(-1));
+
+ Assert.Throws<ArgumentException>(() => 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<ArgumentException>(() => packet.Flip = (Flips)(-1));
+
+ Assert.Throws<ArgumentException>(() => packet.Flip = (Flips)3);
+ }
+ }
}
}