From: Haesu Gwon Date: Fri, 21 Aug 2020 07:50:06 +0000 (+0900) Subject: [MediaCodec][Non-ACR] Add negative TCs X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=6ef907dc61c4c2cabef066dccfa2fe1aa53645f0;p=test%2Ftct%2Fcsharp%2Fapi.git [MediaCodec][Non-ACR] Add negative TCs Change-Id: Ifbae4df3d0cbb915a5ee0fa7b651f84a4458484e --- diff --git a/tct-suite-vs/Tizen.MediaCodec.Tests/testcase/TSMediaCodec.cs b/tct-suite-vs/Tizen.MediaCodec.Tests/testcase/TSMediaCodec.cs index 23decf96e..96a1a4cfd 100644 --- a/tct-suite-vs/Tizen.MediaCodec.Tests/testcase/TSMediaCodec.cs +++ b/tct-suite-vs/Tizen.MediaCodec.Tests/testcase/TSMediaCodec.cs @@ -137,6 +137,22 @@ namespace Tizen.Multimedia.MediaCodec.Tests () => _codec.Configure(format, true, MediaCodecTypes.Software)); } + [Test] + [Category("P2")] + [Description("Throws if codec object is already disposed")] + [Property("SPEC", "Tizen.Multimedia.MediaCodec.MediaCodec.Configure M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void Configure_THROWS_IF_DISPOSED() + { + _codec.Dispose(); + + Assert.Throws(() => + _codec.Configure(VideoDecoderParser.Format, false, MediaCodecTypes.Software), + "Should throws proper exception"); + } + [Test] [Category("P2")] [Description("ProcessInput throws if the specified packet is null")] @@ -149,6 +165,26 @@ namespace Tizen.Multimedia.MediaCodec.Tests Assert.Throws(() => _codec.ProcessInput(null)); } + [Test] + [Category("P2")] + [Description("Throws if codec object is already disposed")] + [Property("SPEC", "Tizen.Multimedia.MediaCodec.MediaCodec.ProcessInput M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void ProcessInput_THROWS_IF_DISPOSED() + { + var mediaFormat = new VideoMediaFormat(MediaFormatVideoMimeType.H263, new Size(352, 288)); + + _codec.Configure(VideoDecoderParser.Format, false, MediaCodecTypes.Software); + _codec.Prepare(); + + _codec.Dispose(); + + Assert.Throws(() => _codec.ProcessInput(MediaPacket.Create(mediaFormat)), + "Should throws proper exception"); + } + [Test] [Category("P2")] [Description("Prepare throws if not configured")] @@ -161,6 +197,23 @@ namespace Tizen.Multimedia.MediaCodec.Tests Assert.Throws(() => _codec.Prepare()); } + [Test] + [Category("P2")] + [Description("Throws if codec object is already disposed")] + [Property("SPEC", "Tizen.Multimedia.MediaCodec.MediaCodec.Prepare M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void Prepare_THROWS_IF_DISPOSED() + { + _codec.Configure(VideoDecoderParser.Format, false, MediaCodecTypes.Software); + + _codec.Dispose(); + + Assert.Throws(() => _codec.Prepare(), + "Should throws proper exception"); + } + [Test] [Category("P1")] [Description("Unprepare throws if all resources are not unloaded")] @@ -173,6 +226,21 @@ namespace Tizen.Multimedia.MediaCodec.Tests Assert.DoesNotThrow(() => _codec.Unprepare()); } + [Test] + [Category("P2")] + [Description("Throws if codec object is already disposed")] + [Property("SPEC", "Tizen.Multimedia.MediaCodec.MediaCodec.Unprepare M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void Unprepare_THROWS_IF_DISPOSED() + { + _codec.Dispose(); + + Assert.Throws(() => _codec.Unprepare(), + "Should throws proper exception"); + } + [Test] [Category("P1")] [Description("GetCodecType returns zero if the specified type is not supported")] @@ -186,6 +254,22 @@ namespace Tizen.Multimedia.MediaCodec.Tests Assert.AreEqual(0, (int)_codec.GetCodecType(true, MediaFormatVideoMimeType.Argb)); } + [Test] + [Category("P2")] + [Description("Throws if codec object is already disposed")] + [Property("SPEC", "Tizen.Multimedia.MediaCodec.MediaCodec.GetCodecType M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("COVPARAM", "bool, MediaFormatVideoMimeType")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void GetCodecType_THROWS_IF_DISPOSED() + { + _codec.Dispose(); + + Assert.Throws(() => _codec.GetCodecType(true, MediaFormatVideoMimeType.Argb), + "Should throws proper exception"); + } + [Test] [Category("P1")] [Description("SupportedAudioCodecs has elements")] @@ -407,6 +491,21 @@ namespace Tizen.Multimedia.MediaCodec.Tests Assert.DoesNotThrow(() => _codec.FlushBuffers()); } + [Test] + [Category("P2")] + [Description("Throws if codec object is already disposed")] + [Property("SPEC", "Tizen.Multimedia.MediaCodec.MediaCodec.FlushBuffers M")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "MEX")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void FlushBuffers_THROWS_IF_DISPOSED() + { + _codec.Dispose(); + + Assert.Throws(() => _codec.FlushBuffers(), + "Should throws proper exception"); + } + [Test] [Category("P1")] [Description("Check if the codec is not supported in MediaCodec")]