From: Haesu Gwon Date: Tue, 27 Nov 2018 06:17:34 +0000 (+0900) Subject: [MediaTool][TCSACR-191][Add new APIs for the duration and max bps] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f327e707414415f70c008f7d6dd2ed8f961c576c;p=test%2Ftct%2Fcsharp%2Fapi.git [MediaTool][TCSACR-191][Add new APIs for the duration and max bps] Change-Id: Id1faeb57c53d38dba6c535a4af66a189b6976fca --- diff --git a/tct-suite-vs/Tizen.Multimedia.Tests/testcase/MediaTool/TSAudioMediaFormat.cs b/tct-suite-vs/Tizen.Multimedia.Tests/testcase/MediaTool/TSAudioMediaFormat.cs old mode 100755 new mode 100644 index 73b7b53..a655277 --- a/tct-suite-vs/Tizen.Multimedia.Tests/testcase/MediaTool/TSAudioMediaFormat.cs +++ b/tct-suite-vs/Tizen.Multimedia.Tests/testcase/MediaTool/TSAudioMediaFormat.cs @@ -5,7 +5,7 @@ namespace Tizen.Multimedia.Tests { [TestFixture] [Description("Testing Tizen.Multimedia.AudioMediaFormat class")] - public static class AudioMediaFormatTests + public class AudioMediaFormatTests { private const int VALID_AUDIO_CHANNEL = 11; private const int VALID_AUDIO_SAMPLE_RATE = 21; @@ -25,7 +25,7 @@ namespace Tizen.Multimedia.Tests [Property("CRITERIA", "PDV")] [Property("COVPARAM", "MediaFormatAudioMimeType, int, int, int, int")] [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public static void AudioMediaFormat_PROPERTIES_ARE_SET_BY_CONSTRUCTOR() + public void AudioMediaFormat_PROPERTIES_ARE_SET_BY_CONSTRUCTOR() { const MediaFormatAudioMimeType mimeType = MediaFormatAudioMimeType.Aac; @@ -47,7 +47,7 @@ namespace Tizen.Multimedia.Tests [Property("CRITERIA", "CONSTR")] [Property("COVPARAM", "MediaFormatAudioMimeType, int, int, int, int")] [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public static void AudioMediaFormat_CONSTRUCTION_INVALID_MIME_TYPE() + public void AudioMediaFormat_CONSTRUCTION_INVALID_MIME_TYPE() { MediaFormatAudioMimeType mimeType = 0; while (Enum.IsDefined(typeof(MediaFormatAudioMimeType), mimeType)) @@ -68,7 +68,7 @@ namespace Tizen.Multimedia.Tests [Property("CRITERIA", "CONSTR")] [Property("COVPARAM", "MediaFormatAudioMimeType, int, int, int, int")] [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public static void AudioMediaFormat_CONSTRUCTION_INVALID_VALUE() + public void AudioMediaFormat_CONSTRUCTION_INVALID_VALUE() { const MediaFormatAudioMimeType mimeType = MediaFormatAudioMimeType.Aac; @@ -113,7 +113,7 @@ namespace Tizen.Multimedia.Tests [Property("CRITERIA", "CONSTR")] [Property("COVPARAM", "MediaFormatAudioMimeType, int, int, int, int, MediaFormatAacType")] [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public static void AudioMediaFormat_CONSTRUCTION_THROW_IF_AAC_SPECIFIED_WITH_NOT_AAC_MIME_TYPE() + public void AudioMediaFormat_CONSTRUCTION_THROW_IF_AAC_SPECIFIED_WITH_NOT_AAC_MIME_TYPE() { Assert.Throws( () => new AudioMediaFormat(MediaFormatAudioMimeType.Flac, VALID_AUDIO_CHANNEL, @@ -127,7 +127,7 @@ namespace Tizen.Multimedia.Tests [Property("SPEC", "Tizen.Multimedia.AudioMediaFormat.AacType A")] [Property("SPEC_URL", "-")] [Property("CRITERIA", "PRO")] - public static void AacType_READONLY() + public void AacType_READONLY() { AssertHelper.PropertyReadOnly(nameof(AudioMediaFormat.AacType)); } @@ -138,7 +138,7 @@ namespace Tizen.Multimedia.Tests [Property("SPEC", "Tizen.Multimedia.AudioMediaFormat.Bit A")] [Property("SPEC_URL", "-")] [Property("CRITERIA", "PRO")] - public static void Bit_READONLY() + public void Bit_READONLY() { AssertHelper.PropertyReadOnly(nameof(AudioMediaFormat.Bit)); } @@ -149,7 +149,7 @@ namespace Tizen.Multimedia.Tests [Property("SPEC", "Tizen.Multimedia.AudioMediaFormat.BitRate A")] [Property("SPEC_URL", "-")] [Property("CRITERIA", "PRO")] - public static void BitRate_READONLY() + public void BitRate_READONLY() { AssertHelper.PropertyReadOnly(nameof(AudioMediaFormat.BitRate)); } @@ -160,7 +160,7 @@ namespace Tizen.Multimedia.Tests [Property("SPEC", "Tizen.Multimedia.AudioMediaFormat.Channel A")] [Property("SPEC_URL", "-")] [Property("CRITERIA", "PRO")] - public static void Channel_READONLY() + public void Channel_READONLY() { AssertHelper.PropertyReadOnly(nameof(AudioMediaFormat.Channel)); } @@ -171,7 +171,7 @@ namespace Tizen.Multimedia.Tests [Property("SPEC", "Tizen.Multimedia.AudioMediaFormat.MimeType A")] [Property("SPEC_URL", "-")] [Property("CRITERIA", "PRO")] - public static void MimeType_READONLY() + public void MimeType_READONLY() { AssertHelper.PropertyReadOnly(nameof(AudioMediaFormat.MimeType)); } @@ -182,7 +182,7 @@ namespace Tizen.Multimedia.Tests [Property("SPEC", "Tizen.Multimedia.AudioMediaFormat.SampleRate A")] [Property("SPEC_URL", "-")] [Property("CRITERIA", "PRO")] - public static void SampleRate_READONLY() + public void SampleRate_READONLY() { AssertHelper.PropertyReadOnly(nameof(AudioMediaFormat.SampleRate)); } diff --git a/tct-suite-vs/Tizen.Multimedia.Tests/testcase/MediaTool/TSContainerMediaFormat.cs b/tct-suite-vs/Tizen.Multimedia.Tests/testcase/MediaTool/TSContainerMediaFormat.cs old mode 100755 new mode 100644 index 2b887df..119c992 --- a/tct-suite-vs/Tizen.Multimedia.Tests/testcase/MediaTool/TSContainerMediaFormat.cs +++ b/tct-suite-vs/Tizen.Multimedia.Tests/testcase/MediaTool/TSContainerMediaFormat.cs @@ -5,7 +5,7 @@ namespace Tizen.Multimedia.Tests { [TestFixture] [Description("Testing Tizen.Multimedia.ContainerMediaFormat class")] - public static class ContainerMediaFormatTests + public class ContainerMediaFormatTests { [Test] [Category("P1")] @@ -14,7 +14,7 @@ namespace Tizen.Multimedia.Tests [Property("SPEC_URL", "-")] [Property("CRITERIA", "CONSTR")] [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public static void ContainerMediaFormat_PROPERTIES_ARE_SET_BY_CONSTRUCTOR() + public void ContainerMediaFormat_PROPERTIES_ARE_SET_BY_CONSTRUCTOR() { const MediaFormatContainerMimeType mimeType = MediaFormatContainerMimeType.AacAdif; @@ -28,7 +28,7 @@ namespace Tizen.Multimedia.Tests [Property("SPEC_URL", "-")] [Property("CRITERIA", "CONSTR")] [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public static void ContainerMediaFormat_CONSTRUCTION_INVALID_MIME_TYPE() + public void ContainerMediaFormat_CONSTRUCTION_INVALID_MIME_TYPE() { MediaFormatContainerMimeType mimeType = 0; while (Enum.IsDefined(typeof(MediaFormatContainerMimeType), mimeType)) @@ -45,7 +45,7 @@ namespace Tizen.Multimedia.Tests [Property("SPEC", "Tizen.Multimedia.ContainerMediaFormat.MimeType A")] [Property("SPEC_URL", "-")] [Property("CRITERIA", "PRO")] - public static void MimeType_READONLY() + public void MimeType_READONLY() { AssertHelper.PropertyReadOnly(nameof(ContainerMediaFormat.MimeType)); } diff --git a/tct-suite-vs/Tizen.Multimedia.Tests/testcase/MediaTool/TSMediaPacket.cs b/tct-suite-vs/Tizen.Multimedia.Tests/testcase/MediaTool/TSMediaPacket.cs index 8755f18..d369b9b 100644 --- a/tct-suite-vs/Tizen.Multimedia.Tests/testcase/MediaTool/TSMediaPacket.cs +++ b/tct-suite-vs/Tizen.Multimedia.Tests/testcase/MediaTool/TSMediaPacket.cs @@ -5,12 +5,13 @@ namespace Tizen.Multimedia.Tests { [TestFixture] [Description("Testing Tizen.Multimedia.MediaPacket class")] - public static class MediaPacketTests + public class MediaPacketTests { private static readonly MediaFormat SimpleFormat = new AudioMediaFormat(MediaFormatAudioMimeType.Aac, 1, 2, 3, 4); private static ulong _timeDefault = ulong.MaxValue; + private static ulong _maxBpsDefault = ulong.MaxValue; [Test] [Category("P2")] @@ -19,7 +20,7 @@ namespace Tizen.Multimedia.Tests [Property("SPEC_URL", "-")] [Property("CRITERIA", "MEX")] [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public static void Create_NULL_MEDIA_FORMAT() + public void Create_NULL_MEDIA_FORMAT() { Assert.Throws( () => MediaPacket.Create(null)); @@ -32,7 +33,7 @@ namespace Tizen.Multimedia.Tests [Property("SPEC_URL", "-")] [Property("CRITERIA", "MEX")] [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public static void Create_INVALID_MEDIA_FORMAT() + public void Create_INVALID_MEDIA_FORMAT() { MediaFormat format = new ContainerMediaFormat(MediaFormatContainerMimeType.AacAdif); @@ -46,7 +47,7 @@ namespace Tizen.Multimedia.Tests [Property("SPEC", "Tizen.Multimedia.MediaPacket.Format A")] [Property("SPEC_URL", "-")] [Property("CRITERIA", "PRO")] - public static void Format_READONLY() + public void Format_READONLY() { AssertHelper.PropertyReadOnly(nameof(MediaPacket.Format)); } @@ -58,7 +59,7 @@ namespace Tizen.Multimedia.Tests [Property("SPEC_URL", "-")] [Property("CRITERIA", "PDV")] [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public static void Format_IS_PASSED_TO_CONSTRUCTOR() + public void Format_IS_PASSED_TO_CONSTRUCTOR() { using (MediaPacket packet = MediaPacket.Create(SimpleFormat)) { @@ -73,7 +74,7 @@ namespace Tizen.Multimedia.Tests [Property("SPEC_URL", "-")] [Property("CRITERIA", "MEX")] [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public static void Dispose_DISPOSED_OBJECT() + public void Dispose_DISPOSED_OBJECT() { MediaPacket packet = MediaPacket.Create(SimpleFormat); packet.Dispose(); @@ -89,6 +90,7 @@ namespace Tizen.Multimedia.Tests Assert.Throws(() => { var v = packet.BufferFlags; }); Assert.Throws(() => { var v = packet.Rotation; }); Assert.Throws(() => { var v = packet.Flip; }); + Assert.Throws(() => { var v = packet.Duration; }); #endregion #region Write operations @@ -97,6 +99,7 @@ namespace Tizen.Multimedia.Tests Assert.Throws(() => { packet.BufferFlags = MediaPacketBufferFlags.CodecConfig; }); Assert.Throws(() => { packet.Rotation = Rotation.Rotate90; }); Assert.Throws(() => { packet.Flip = Flips.Horizontal; }); + Assert.Throws(() => { packet.Duration = 10; }); #endregion } @@ -108,7 +111,7 @@ namespace Tizen.Multimedia.Tests [Property("SPEC_URL", "-")] [Property("CRITERIA", "PCST")] [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public static void IsDisposed_RETURNS_FALSE_BEFORE_OBJECT_DISPOSED() + public void IsDisposed_RETURNS_FALSE_BEFORE_OBJECT_DISPOSED() { MediaPacket packet = MediaPacket.Create(SimpleFormat); @@ -124,7 +127,7 @@ namespace Tizen.Multimedia.Tests [Property("SPEC_URL", "-")] [Property("CRITERIA", "PCST")] [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public static void IsDisposed_RETURNS_TRUE_AFTER_OBJECT_DISPOSED() + public void IsDisposed_RETURNS_TRUE_AFTER_OBJECT_DISPOSED() { MediaPacket packet = MediaPacket.Create(SimpleFormat); packet.Dispose(); @@ -139,7 +142,7 @@ namespace Tizen.Multimedia.Tests [Property("SPEC_URL", "-")] [Property("CRITERIA", "PDV")] [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public static void Pts_DEFAULT_VALUE() + public void Pts_DEFAULT_VALUE() { using (MediaPacket packet = MediaPacket.Create(SimpleFormat)) { @@ -154,7 +157,7 @@ namespace Tizen.Multimedia.Tests [Property("SPEC_URL", "-")] [Property("CRITERIA", "PCST")] [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public static void Pts_VALUE() + public void Pts_VALUE() { ulong value = 1; using (MediaPacket packet = MediaPacket.Create(SimpleFormat)) @@ -171,7 +174,7 @@ namespace Tizen.Multimedia.Tests [Property("SPEC_URL", "-")] [Property("CRITERIA", "PDV")] [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public static void Dts_DEFAULT_VALUE() + public void Dts_DEFAULT_VALUE() { using (MediaPacket packet = MediaPacket.Create(SimpleFormat)) { @@ -186,7 +189,7 @@ namespace Tizen.Multimedia.Tests [Property("SPEC_URL", "-")] [Property("CRITERIA", "PCST")] [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public static void Dts_SET_VALUE() + public void Dts_SET_VALUE() { ulong value = 1; using (MediaPacket packet = MediaPacket.Create(SimpleFormat)) @@ -198,12 +201,46 @@ namespace Tizen.Multimedia.Tests [Test] [Category("P1")] + [Description("Check whether default Duration value is zero or not")] + [Property("SPEC", "Tizen.Multimedia.MediaPacket.Duration A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PDV")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void Duration_DEFAULT_VALUE() + { + using (MediaPacket packet = MediaPacket.Create(SimpleFormat)) + { + Assert.AreEqual(_maxBpsDefault, packet.Duration); + } + } + + [Test] + [Category("P1")] + [Description("Check whether Duration value is readable and writable")] + [Property("SPEC", "Tizen.Multimedia.MediaPacket.Duration A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRW")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void Duration_SET_GET_VALUE() + { + using (MediaPacket packet = MediaPacket.Create(SimpleFormat)) + { + ulong duration = 10; + Assert.IsInstanceOf(packet.Duration); + + packet.Duration = duration; + Assert.AreEqual(duration, packet.Duration); + } + } + + [Test] + [Category("P1")] [Description("IsEncoded returns a value indicating whether the packet is encoded type")] [Property("SPEC", "Tizen.Multimedia.MediaPacket.IsEncoded A")] [Property("SPEC_URL", "-")] [Property("CRITERIA", "PDV")] [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public static void IsEncoded_DEPENDS_ON_FORMAT() + public void IsEncoded_DEPENDS_ON_FORMAT() { using (MediaPacket packet = MediaPacket.Create(new AudioMediaFormat(MediaFormatAudioMimeType.Aac, 1, 1, 1, 1))) @@ -227,7 +264,7 @@ namespace Tizen.Multimedia.Tests [Property("SPEC_URL", "-")] [Property("CRITERIA", "PDV")] [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public static void Buffer_RETURNS_NULL_FOR_RAW_VIDEO_FORMAT() + public void Buffer_RETURNS_NULL_FOR_RAW_VIDEO_FORMAT() { using (MediaPacket packet = MediaPacket.Create(new VideoMediaFormat(MediaFormatVideoMimeType.Argb, 1, 1))) @@ -243,7 +280,7 @@ namespace Tizen.Multimedia.Tests [Property("SPEC_URL", "-")] [Property("CRITERIA", "PDV")] [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public static void Buffer_RETURNS_NOT_NULL_FOR_NONE_RAW_VIDEO_FORMAT() + public void Buffer_RETURNS_NOT_NULL_FOR_NONE_RAW_VIDEO_FORMAT() { using (MediaPacket packet = MediaPacket.Create(new AudioMediaFormat(MediaFormatAudioMimeType.Aac, 1, 1, 1, 1))) @@ -259,7 +296,7 @@ namespace Tizen.Multimedia.Tests [Property("SPEC_URL", "-")] [Property("CRITERIA", "MEX")] [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public static void BufferWrittenLength_THROWS_IF_RAW_VIDEO_FORMAT() + public void BufferWrittenLength_THROWS_IF_RAW_VIDEO_FORMAT() { using (MediaPacket packet = MediaPacket.Create(new VideoMediaFormat(MediaFormatVideoMimeType.Argb, 1, 1))) @@ -275,7 +312,7 @@ namespace Tizen.Multimedia.Tests [Property("SPEC_URL", "-")] [Property("CRITERIA", "PAM")] [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public static void BufferWrittenLength_MAX_VALUE() + public void BufferWrittenLength_MAX_VALUE() { using (MediaPacket packet = MediaPacket.Create(new AudioMediaFormat(MediaFormatAudioMimeType.Aac, 1, 1, 1, 1))) @@ -293,7 +330,7 @@ namespace Tizen.Multimedia.Tests [Property("SPEC_URL", "-")] [Property("CRITERIA", "PDV")] [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public static void VideoPlanes_RETURNS_NULL_NONE_FOR_RAW_VIDEO_FORMAT() + public void VideoPlanes_RETURNS_NULL_NONE_FOR_RAW_VIDEO_FORMAT() { using (MediaPacket packet = MediaPacket.Create(new AudioMediaFormat(MediaFormatAudioMimeType.Aac, 1, 1, 1, 1))) @@ -309,7 +346,7 @@ namespace Tizen.Multimedia.Tests [Property("SPEC_URL", "-")] [Property("CRITERIA", "PDV")] [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public static void VideoPlanes_RETURNS_NOT_NULL_FOR_RAW_VIDEO_FORMAT() + public void VideoPlanes_RETURNS_NOT_NULL_FOR_RAW_VIDEO_FORMAT() { using (MediaPacket packet = MediaPacket.Create(new VideoMediaFormat(MediaFormatVideoMimeType.Argb, 1, 1))) @@ -325,7 +362,7 @@ namespace Tizen.Multimedia.Tests [Property("SPEC_URL", "-")] [Property("CRITERIA", "PDV")] [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public static void BufferFlags_DEFAULT_VALUE() + public void BufferFlags_DEFAULT_VALUE() { using (MediaPacket packet = MediaPacket.Create(SimpleFormat)) { @@ -340,7 +377,7 @@ namespace Tizen.Multimedia.Tests [Property("SPEC_URL", "-")] [Property("CRITERIA", "PCST")] [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public static void BufferFlags_SET() + public void BufferFlags_SET() { using (MediaPacket packet = MediaPacket.Create(SimpleFormat)) { @@ -357,7 +394,7 @@ namespace Tizen.Multimedia.Tests [Property("SPEC_URL", "-")] [Property("CRITERIA", "PRE")] [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] - public static void Rotation_VALUE() + public void Rotation_VALUE() { using (MediaPacket packet = MediaPacket.Create(SimpleFormat)) { @@ -376,7 +413,7 @@ namespace Tizen.Multimedia.Tests [Property("SPEC_URL", "-")] [Property("CRITERIA", "PEX")] [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] - public static void Rotation_CHECK_EXCEPTION() + public void Rotation_CHECK_EXCEPTION() { using (MediaPacket packet = MediaPacket.Create(SimpleFormat)) { @@ -393,7 +430,7 @@ namespace Tizen.Multimedia.Tests [Property("SPEC_URL", "-")] [Property("CRITERIA", "PRE")] [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] - public static void Flip_VALUE() + public void Flip_VALUE() { using (MediaPacket packet = MediaPacket.Create(SimpleFormat)) { @@ -412,7 +449,7 @@ namespace Tizen.Multimedia.Tests [Property("SPEC_URL", "-")] [Property("CRITERIA", "PEX")] [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] - public static void Flip_CHECK_EXCEPTION() + public void Flip_CHECK_EXCEPTION() { using (MediaPacket packet = MediaPacket.Create(SimpleFormat)) { diff --git a/tct-suite-vs/Tizen.Multimedia.Tests/testcase/MediaTool/TSMediaPacketVideoPlane.cs b/tct-suite-vs/Tizen.Multimedia.Tests/testcase/MediaTool/TSMediaPacketVideoPlane.cs old mode 100755 new mode 100644 index 040ec46..da97f80 --- a/tct-suite-vs/Tizen.Multimedia.Tests/testcase/MediaTool/TSMediaPacketVideoPlane.cs +++ b/tct-suite-vs/Tizen.Multimedia.Tests/testcase/MediaTool/TSMediaPacketVideoPlane.cs @@ -5,7 +5,7 @@ namespace Tizen.Multimedia.Tests { [TestFixture] [Description("Testing Tizen.Multimedia.MediaPacketVideoPlane class")] - public static class MediaPacketVideoPlaneTests + public class MediaPacketVideoPlaneTests { [Test] [Category("P2")] @@ -14,7 +14,7 @@ namespace Tizen.Multimedia.Tests [Property("SPEC_URL", "-")] [Property("CRITERIA", "MEX")] [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public static void Disposed() + public void Disposed() { MediaPacket packet = MediaPacket.Create( new VideoMediaFormat(MediaFormatVideoMimeType.I420, 352, 288)); @@ -39,7 +39,7 @@ namespace Tizen.Multimedia.Tests [Property("SPEC", "Tizen.Multimedia.MediaPacketVideoPlane.Buffer A")] [Property("SPEC_URL", "-")] [Property("CRITERIA", "PRO")] - public static void Buffer_READONLY() + public void Buffer_READONLY() { AssertHelper.PropertyReadOnly(nameof(MediaPacketVideoPlane.Buffer)); } @@ -50,7 +50,7 @@ namespace Tizen.Multimedia.Tests [Property("SPEC", "Tizen.Multimedia.MediaPacketVideoPlane.StrideWidth A")] [Property("SPEC_URL", "-")] [Property("CRITERIA", "PRO")] - public static void StrideWidth_READONLY() + public void StrideWidth_READONLY() { AssertHelper.PropertyReadOnly(nameof(MediaPacketVideoPlane.StrideWidth)); } @@ -61,7 +61,7 @@ namespace Tizen.Multimedia.Tests [Property("SPEC", "Tizen.Multimedia.MediaPacketVideoPlane.StrideHeight A")] [Property("SPEC_URL", "-")] [Property("CRITERIA", "PRO")] - public static void StrideHeight_READONLY() + public void StrideHeight_READONLY() { AssertHelper.PropertyReadOnly(nameof(MediaPacketVideoPlane.StrideHeight)); } diff --git a/tct-suite-vs/Tizen.Multimedia.Tests/testcase/MediaTool/TSTextMediaFormat.cs b/tct-suite-vs/Tizen.Multimedia.Tests/testcase/MediaTool/TSTextMediaFormat.cs old mode 100755 new mode 100644 index a4a5dfc..99b94ad --- a/tct-suite-vs/Tizen.Multimedia.Tests/testcase/MediaTool/TSTextMediaFormat.cs +++ b/tct-suite-vs/Tizen.Multimedia.Tests/testcase/MediaTool/TSTextMediaFormat.cs @@ -5,7 +5,7 @@ namespace Tizen.Multimedia.Tests { [TestFixture] [Description("Testing Tizen.Multimedia.TextMediaFormat class")] - public static class TextMediaFormatTests + public class TextMediaFormatTests { [Test] [Category("P1")] @@ -14,7 +14,7 @@ namespace Tizen.Multimedia.Tests [Property("SPEC_URL", "-")] [Property("CRITERIA", "CONSTR")] [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public static void TextMediaFormat_PROPERTIES_ARE_SET_BY_CONSTRUCTOR() + public void TextMediaFormat_PROPERTIES_ARE_SET_BY_CONSTRUCTOR() { const MediaFormatTextMimeType mimeType = MediaFormatTextMimeType.MP4; const MediaFormatTextType textType = MediaFormatTextType.MP4; @@ -32,7 +32,7 @@ namespace Tizen.Multimedia.Tests [Property("SPEC_URL", "-")] [Property("CRITERIA", "CONSTR")] [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public static void TextMediaFormat_CONSTRUCTION_INVALID_MIME_TYPE() + public void TextMediaFormat_CONSTRUCTION_INVALID_MIME_TYPE() { MediaFormatTextMimeType mimeType = 0; while (Enum.IsDefined(typeof(MediaFormatTextMimeType), mimeType)) @@ -51,7 +51,7 @@ namespace Tizen.Multimedia.Tests [Property("SPEC_URL", "-")] [Property("CRITERIA", "CONSTR")] [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public static void TextMediaFormat_CONSTRUCTION_INVALID_TEXT_TYPE() + public void TextMediaFormat_CONSTRUCTION_INVALID_TEXT_TYPE() { MediaFormatTextType textType = 0; while (Enum.IsDefined(typeof(MediaFormatTextType), textType)) @@ -69,7 +69,7 @@ namespace Tizen.Multimedia.Tests [Property("SPEC", "Tizen.Multimedia.TextMediaFormat.MimeType A")] [Property("SPEC_URL", "-")] [Property("CRITERIA", "PRO")] - public static void MimeType_READONLY() + public void MimeType_READONLY() { AssertHelper.PropertyReadOnly(nameof(TextMediaFormat.MimeType)); } @@ -81,7 +81,7 @@ namespace Tizen.Multimedia.Tests [Property("SPEC", "Tizen.Multimedia.TextMediaFormat.TextType A")] [Property("SPEC_URL", "-")] [Property("CRITERIA", "PRO")] - public static void TextType_READONLY() + public void TextType_READONLY() { AssertHelper.PropertyReadOnly(nameof(TextMediaFormat.TextType)); } diff --git a/tct-suite-vs/Tizen.Multimedia.Tests/testcase/MediaTool/TSVideoMediaFormat.cs b/tct-suite-vs/Tizen.Multimedia.Tests/testcase/MediaTool/TSVideoMediaFormat.cs old mode 100755 new mode 100644 index d8c3add..ba5f8ee --- a/tct-suite-vs/Tizen.Multimedia.Tests/testcase/MediaTool/TSVideoMediaFormat.cs +++ b/tct-suite-vs/Tizen.Multimedia.Tests/testcase/MediaTool/TSVideoMediaFormat.cs @@ -5,17 +5,19 @@ namespace Tizen.Multimedia.Tests { [TestFixture] [Description("Testing Tizen.Multimedia.VideoMediaFormat class")] - public static class VideoMediaFormatTests + public class VideoMediaFormatTests { private const int VALID_VIDEO_WIDTH = 10; private const int VALID_VIDEO_HEIGHT = 20; private const int VALID_VIDEO_FRAME_RATE = 30; private const int VALID_VIDEO_BIT_RATE = 40; + private const int VALID_VIDEO_MAX_BPS = 10; private const int INVALID_VIDEO_WIDTH = -1; private const int INVALID_VIDEO_HEIGHT = -2; private const int INVALID_VIDEO_FRAME_RATE = -3; private const int INVALID_VIDEO_BIT_RATE = -4; + private const int INVALID_VIDEO_MAX_BPS = -1; [Test] [Category("P1")] @@ -25,7 +27,7 @@ namespace Tizen.Multimedia.Tests [Property("CRITERIA", "CONSTR")] [Property("COVPARAM", "MediaFormatVideoMimeType, int, int, int, int")] [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public static void VideoMediaFormat_PROPERTIES_ARE_SET_BY_CONSTRUCTOR() + public void VideoMediaFormat_PROPERTIES_ARE_SET_BY_CONSTRUCTOR() { const MediaFormatVideoMimeType mimeType = MediaFormatVideoMimeType.Argb; @@ -40,6 +42,31 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P1")] + [Description("Create VideoMediaFormat instance")] + [Property("SPEC", "Tizen.Multimedia.VideoMediaFormat.VideoMediaFormat C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("COVPARAM", "MediaFormatVideoMimeType, Size, int, int, int")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void VideoMediaFormat_PROPERTIES_ARE_SET_BY_CONSTRUCTOR_WITH_MAX_BPS() + { + const MediaFormatVideoMimeType mimeType = MediaFormatVideoMimeType.Argb; + + var videoFormat = new VideoMediaFormat(mimeType, new Size(VALID_VIDEO_WIDTH, VALID_VIDEO_HEIGHT), + VALID_VIDEO_FRAME_RATE, VALID_VIDEO_BIT_RATE, VALID_VIDEO_MAX_BPS); + + Assert.IsInstanceOf(videoFormat, "Should return VideoMediaFormat instance."); + + Assert.AreEqual(mimeType, videoFormat.MimeType); + Assert.AreEqual(VALID_VIDEO_WIDTH, videoFormat.Size.Width); + Assert.AreEqual(VALID_VIDEO_HEIGHT, videoFormat.Size.Height); + Assert.AreEqual(VALID_VIDEO_FRAME_RATE, videoFormat.FrameRate); + Assert.AreEqual(VALID_VIDEO_BIT_RATE, videoFormat.BitRate); + Assert.AreEqual(VALID_VIDEO_MAX_BPS, videoFormat.MaxBps); + } + + [Test] [Category("P2")] [Description("Throw if the specified mime type is invalid")] [Property("SPEC", "Tizen.Multimedia.VideoMediaFormat.VideoMediaFormat C")] @@ -47,7 +74,7 @@ namespace Tizen.Multimedia.Tests [Property("CRITERIA", "CONSTR")] [Property("COVPARAM", "MediaFormatVideoMimeType, int, int")] [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public static void VideoMediaFormat_CONSTRUCTION_INVALID_MIME_TYPE() + public void VideoMediaFormat_CONSTRUCTION_INVALID_MIME_TYPE() { MediaFormatVideoMimeType mimeType = 0; while (Enum.IsDefined(typeof(MediaFormatVideoMimeType), mimeType)) @@ -67,7 +94,7 @@ namespace Tizen.Multimedia.Tests [Property("CRITERIA", "CONSTR")] [Property("COVPARAM", "MediaFormatVideoMimeType, int, int, int")] [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public static void VideoMediaFormat_CONSTRUCTION() + public void VideoMediaFormat_CONSTRUCTION() { Assert.DoesNotThrow(() => new VideoMediaFormat(MediaFormatVideoMimeType.Argb, VALID_VIDEO_WIDTH, VALID_VIDEO_HEIGHT, VALID_VIDEO_FRAME_RATE)); @@ -81,7 +108,7 @@ namespace Tizen.Multimedia.Tests [Property("CRITERIA", "CONSTX")] [Property("COVPARAM", "MediaFormatVideoMimeType, Size")] [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public static void VideoMediaFormat_WITH_INVALID_SIZE() + public void VideoMediaFormat_WITH_INVALID_SIZE() { Assert.That( () => new VideoMediaFormat(MediaFormatVideoMimeType.Argb, new Size(INVALID_VIDEO_WIDTH, VALID_VIDEO_HEIGHT)), @@ -96,7 +123,7 @@ namespace Tizen.Multimedia.Tests [Property("CRITERIA", "CONSTX")] [Property("COVPARAM", "MediaFormatVideoMimeType, Size, int, int")] [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public static void VideoMediaFormat_WITH_INVALID_SIZE_FRAME_RATE() + public void VideoMediaFormat_WITH_INVALID_SIZE_FRAME_RATE() { Assert.That(() => new VideoMediaFormat(MediaFormatVideoMimeType.Argb, new Size(VALID_VIDEO_WIDTH, VALID_VIDEO_HEIGHT), @@ -113,7 +140,7 @@ namespace Tizen.Multimedia.Tests [Property("CRITERIA", "CONSTX")] [Property("COVPARAM", "MediaFormatVideoMimeType, Size, int")] [Property("AUTHOR", "JungHo Kim, jhyo.kim@samsung.com")] - public static void VideoMediaFormat_WITH_SIZE_FRAME_RATE_INVALID_BITRATE() + public void VideoMediaFormat_WITH_SIZE_FRAME_RATE_INVALID_BITRATE() { Assert.That(() => new VideoMediaFormat(MediaFormatVideoMimeType.Argb, new Size(INVALID_VIDEO_WIDTH, VALID_VIDEO_HEIGHT), @@ -122,12 +149,28 @@ namespace Tizen.Multimedia.Tests } [Test] + [Category("P2")] + [Description("Throw ArgumentOutOfRangeException if maxBps parameter is invalid")] + [Property("SPEC", "Tizen.Multimedia.VideoMediaFormat.VideoMediaFormat C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTX")] + [Property("COVPARAM", "MediaFormatVideoMimeType, Size, int, int, int")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void VideoMediaFormat_WITH_SIZE_FRAME_RATE_BITRATE_INVALID_MAX_BPS() + { + Assert.That(() => new VideoMediaFormat(MediaFormatVideoMimeType.Argb, + new Size(INVALID_VIDEO_WIDTH, VALID_VIDEO_HEIGHT), + VALID_VIDEO_FRAME_RATE, VALID_VIDEO_BIT_RATE, INVALID_VIDEO_MAX_BPS), + Throws.TypeOf()); + } + + [Test] [Category("P1")] [Description("MimeType is read only")] [Property("SPEC", "Tizen.Multimedia.VideoMediaFormat.MimeType A")] [Property("SPEC_URL", "-")] [Property("CRITERIA", "PRO")] - public static void MimeType_READONLY() + public void MimeType_READONLY() { AssertHelper.PropertyReadOnly(nameof(VideoMediaFormat.MimeType)); } @@ -138,19 +181,18 @@ namespace Tizen.Multimedia.Tests [Property("SPEC", "Tizen.Multimedia.VideoMediaFormat.BitRate A")] [Property("SPEC_URL", "-")] [Property("CRITERIA", "PRO")] - public static void BitRate_READONLY() + public void BitRate_READONLY() { AssertHelper.PropertyReadOnly(nameof(VideoMediaFormat.BitRate)); } - [Test] [Category("P1")] [Description("FrameRate is read only")] [Property("SPEC", "Tizen.Multimedia.VideoMediaFormat.FrameRate A")] [Property("SPEC_URL", "-")] [Property("CRITERIA", "PRO")] - public static void FrameRate_READONLY() + public void FrameRate_READONLY() { AssertHelper.PropertyReadOnly(nameof(VideoMediaFormat.FrameRate)); } @@ -161,9 +203,27 @@ namespace Tizen.Multimedia.Tests [Property("SPEC", "Tizen.Multimedia.VideoMediaFormat.Size A")] [Property("SPEC_URL", "-")] [Property("CRITERIA", "PRO")] - public static void Size_READONLY() + public void Size_READONLY() { AssertHelper.PropertyReadOnly(nameof(VideoMediaFormat.Size)); } + + [Test] + [Category("P1")] + [Description("MaxBps is read only")] + [Property("SPEC", "Tizen.Multimedia.VideoMediaFormat.MaxBps A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRO")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void MaxBps_READONLY() + { + AssertHelper.PropertyReadOnly(nameof(VideoMediaFormat.MaxBps)); + + var videoFormat = new VideoMediaFormat(MediaFormatVideoMimeType.Argb, + new Size(VALID_VIDEO_WIDTH, VALID_VIDEO_HEIGHT), + VALID_VIDEO_FRAME_RATE, VALID_VIDEO_BIT_RATE, + VALID_VIDEO_MAX_BPS); + Assert.AreEqual(VALID_VIDEO_MAX_BPS, videoFormat.MaxBps); + } } }