From b15d84d2d1206c61bf3bf7da8bd8dedfb4146924 Mon Sep 17 00:00:00 2001 From: ruble Date: Thu, 21 Nov 2019 13:49:08 +0900 Subject: [PATCH] [MediaPlayer][Non-ACR] fix the wrong TCs Change-Id: I069f828d8a78679f1fb4366a36c1d01c24fe8a3c --- .../Tizen.MediaPlayer.Tests/testcase/TSPlayer.cs | 77 ++++++++++++---------- 1 file changed, 42 insertions(+), 35 deletions(-) diff --git a/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/TSPlayer.cs b/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/TSPlayer.cs index 4589c28..da86693 100755 --- a/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/TSPlayer.cs +++ b/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/TSPlayer.cs @@ -2358,6 +2358,7 @@ namespace Tizen.Multimedia.Tests try { checkEquals = TestPlayer.AudioPitchEnabled.Equals(false); + Assert.That(checkEquals, Is.EqualTo(true)); } catch (NotAvailableException) { @@ -2367,10 +2368,6 @@ namespace Tizen.Multimedia.Tests else Assert.Fail($"exeption occurs even though software codec is used."); } - finally - { - Assert.That(checkEquals, Is.EqualTo(true)); - } } [Test] @@ -2385,6 +2382,7 @@ namespace Tizen.Multimedia.Tests try { TestPlayer.AudioPitchEnabled = true; + Assert.That(TestPlayer.AudioPitchEnabled, Is.EqualTo(true)); } catch (NotAvailableException) { @@ -2394,10 +2392,6 @@ namespace Tizen.Multimedia.Tests else Assert.Fail($"exeption occurs even though software codec is used."); } - finally - { - Assert.That(TestPlayer.AudioPitchEnabled, Is.EqualTo(true)); - } } [Test] @@ -2451,6 +2445,7 @@ namespace Tizen.Multimedia.Tests try { TestPlayer.AudioPitchEnabled = true; + Assert.That(TestPlayer.AudioPitch, Is.EqualTo(1)); } catch (NotAvailableException) { @@ -2460,10 +2455,6 @@ namespace Tizen.Multimedia.Tests else Assert.Fail($"exeption occurs even though software codec is used."); } - finally - { - Assert.That(TestPlayer.AudioPitch, Is.EqualTo(1)); - } } [Test] @@ -2478,6 +2469,10 @@ namespace Tizen.Multimedia.Tests try { TestPlayer.AudioPitchEnabled = true; + + const float value = 1.212F; + TestPlayer.AudioPitch = value; + Assert.That(TestPlayer.AudioPitch, Is.EqualTo(value)); } catch (NotAvailableException) { @@ -2487,12 +2482,6 @@ namespace Tizen.Multimedia.Tests else Assert.Fail($"exeption occurs even though software codec is used."); } - finally - { - const float value = 1.212F; - TestPlayer.AudioPitch = value; - Assert.That(TestPlayer.AudioPitch, Is.EqualTo(value)); - } } [Test] @@ -2507,6 +2496,10 @@ namespace Tizen.Multimedia.Tests try { TestPlayer.AudioPitchEnabled = true; + + const float value = 0.5F; + TestPlayer.AudioPitch = value; + Assert.That(TestPlayer.AudioPitch, Is.EqualTo(value)); } catch (NotAvailableException) { @@ -2516,12 +2509,6 @@ namespace Tizen.Multimedia.Tests else Assert.Fail($"exeption occurs even though software codec is used."); } - finally - { - const float value = 0.5F; - TestPlayer.AudioPitch = value; - Assert.That(TestPlayer.AudioPitch, Is.EqualTo(value)); - } } [Test] @@ -2536,6 +2523,10 @@ namespace Tizen.Multimedia.Tests try { TestPlayer.AudioPitchEnabled = true; + + const float value = 2.0F; + TestPlayer.AudioPitch = value; + Assert.That(TestPlayer.AudioPitch, Is.EqualTo(value)); } catch (NotAvailableException) { @@ -2545,12 +2536,6 @@ namespace Tizen.Multimedia.Tests else Assert.Fail($"exeption occurs even though software codec is used."); } - finally - { - const float value = 2.0F; - TestPlayer.AudioPitch = value; - Assert.That(TestPlayer.AudioPitch, Is.EqualTo(value)); - } } [Test] @@ -2562,9 +2547,20 @@ namespace Tizen.Multimedia.Tests [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")] public void AudioPitch_OUT_OF_RANGE() { - TestPlayer.AudioPitchEnabled = true; - Assert.That(() => TestPlayer.AudioPitch = 0.4F, Throws.TypeOf()); - Assert.That(() => TestPlayer.AudioPitch = 2.1F, Throws.TypeOf()); + try + { + TestPlayer.AudioPitchEnabled = true; + Assert.That(() => TestPlayer.AudioPitch = 0.4F, Throws.TypeOf()); + Assert.That(() => TestPlayer.AudioPitch = 2.1F, Throws.TypeOf()); + } + catch (NotAvailableException) + { + CodecType codecType = TestPlayer.AudioCodecType; + if (codecType == CodecType.Hardware) + Assert.Pass($"It could be not available depending on the platform capabilities"); + else + Assert.Fail($"exeption occurs even though software codec is used."); + } } [Test] @@ -2576,8 +2572,19 @@ namespace Tizen.Multimedia.Tests [Property("AUTHOR", "Jeongyoon Nam, just.nam@samsung.com")] public void AudioPitch_IS_NOT_ENABLED() { - TestPlayer.AudioPitchEnabled = false; - Assert.That(() => TestPlayer.AudioPitch = 0.82F, Throws.TypeOf()); + try + { + TestPlayer.AudioPitchEnabled = false; + Assert.That(() => TestPlayer.AudioPitch = 0.82F, Throws.TypeOf()); + } + catch (NotAvailableException) + { + CodecType codecType = TestPlayer.AudioCodecType; + if (codecType == CodecType.Hardware) + Assert.Pass($"It could be not available depending on the platform capabilities"); + else + Assert.Fail($"exeption occurs even though software codec is used."); + } } [Test] -- 2.7.4