private ulong _maxBpsDefault = ulong.MaxValue;
[Test]
+ [Category("P1")]
+ [Description("Test Create whether throws exception or not.")]
+ [Property("SPEC", "Tizen.Multimedia.MediaPacket.Create M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "MediaFormat")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void Create_CHECK_CREATE_WITH_MEDIAFORMAT()
+ {
+ try
+ {
+ MediaPacket packet = MediaPacket.Create(SimpleFormat);
+ packet.Dispose();
+ }
+ catch
+ {
+ Assert.Fail("Should not throw exception");
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Create whether throws exception or not.")]
+ [Property("SPEC", "Tizen.Multimedia.MediaPacket.Create M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "MediaPacket")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void Create_CHECK_CREATE_WITH_MEDIAPACKET()
+ {
+ MediaPacket packet1 = MediaPacket.Create(SimpleFormat);
+
+ try
+ {
+ MediaPacket packet2 = MediaPacket.Create(packet1);
+ packet2.Dispose();
+ }
+ catch
+ {
+ Assert.Fail("Should not throw exception");
+ }
+ finally
+ {
+ packet1.Dispose();
+ }
+ }
+
+ [Test]
+ [Category("P1")]
+ [Description("Test Create whether packets are disposed independently.")]
+ [Property("SPEC", "Tizen.Multimedia.MediaPacket.Create M")]
+ [Property("SPEC_URL", "-")]
+ [Property("CRITERIA", "MR")]
+ [Property("COVPARAM", "MediaPacket")]
+ [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")]
+ public void Create_CHECK_INDEPENDENT_DISPOSE()
+ {
+ MediaPacket packet1 = MediaPacket.Create(SimpleFormat);
+ MediaPacket packet2 = MediaPacket.Create(packet1);
+
+ packet1.Dispose();
+
+ try
+ {
+ Assert.Throws<ObjectDisposedException>(() => { var v = packet1.Format; });
+
+ Assert.That(() => packet2.Format.Type == MediaFormatType.Audio,
+ "Should not throw exception even if packet1 is already disposed");
+ }
+ finally
+ {
+ packet2.Dispose();
+ }
+ }
+
+ [Test]
[Category("P2")]
[Description("Throw a parameter is null when creating MediaPacket")]
[Property("SPEC", "Tizen.Multimedia.MediaPacket.Create M")]
public void Create_NULL_MEDIA_FORMAT()
{
Assert.Throws<ArgumentNullException>(
- () => MediaPacket.Create(null));
+ () => MediaPacket.Create((MediaFormat)null));
}
[Test]