From 595b34e35fd43ea25d7ebde20ef0038e3d2086b7 Mon Sep 17 00:00:00 2001 From: Haesu Gwon Date: Mon, 17 Aug 2020 17:14:12 +0900 Subject: [PATCH] [MultimediaUtil][TCSACR-358] Supports WebP encoder and decoder Change-Id: I320f6a0e48f47b828be704567bec10216bd646b0 --- .../testcase/ImageUtil/TSWebPDecoder.cs | 33 +++++++++ .../testcase/ImageUtil/TSWebPEncoder.cs | 83 ++++++++++++++++++++++ 2 files changed, 116 insertions(+) create mode 100644 tct-suite-vs/Tizen.MultimediaUtil.Tests/testcase/ImageUtil/TSWebPDecoder.cs create mode 100644 tct-suite-vs/Tizen.MultimediaUtil.Tests/testcase/ImageUtil/TSWebPEncoder.cs diff --git a/tct-suite-vs/Tizen.MultimediaUtil.Tests/testcase/ImageUtil/TSWebPDecoder.cs b/tct-suite-vs/Tizen.MultimediaUtil.Tests/testcase/ImageUtil/TSWebPDecoder.cs new file mode 100644 index 0000000..bd1d581 --- /dev/null +++ b/tct-suite-vs/Tizen.MultimediaUtil.Tests/testcase/ImageUtil/TSWebPDecoder.cs @@ -0,0 +1,33 @@ +// Copyright 2020 by Samsung Electronics, Inc., +// +// This software is the confidential and proprietary information +// of Samsung Electronics, Inc. ("Confidential Information"). You +// shall not disclose such Confidential Information and shall use +// it only in accordance with the terms of the license agreement +// you entered into with Samsung. + +using NUnit.Framework; + +namespace Tizen.Multimedia.Util.Tests +{ + [TestFixture] + [Description("Tests Tizen.Multimedia.Util.WebPDecoder class")] + public class WebPDecoderTests + { + [Test] + [Category("P1")] + [Description("Test: Constructor for decoding WebP image - object should not be null after intializing")] + [Property("SPEC", "Tizen.Multimedia.Util.WebPDecoder.WebPDecoder C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void WebPDecoder_INIT() + { + using (var decoder = new WebPDecoder()) + { + Assert.IsNotNull(decoder, "Should not null."); + Assert.IsInstanceOf(decoder, "Should return WebPDecoder instance."); + } + } + } +} diff --git a/tct-suite-vs/Tizen.MultimediaUtil.Tests/testcase/ImageUtil/TSWebPEncoder.cs b/tct-suite-vs/Tizen.MultimediaUtil.Tests/testcase/ImageUtil/TSWebPEncoder.cs new file mode 100644 index 0000000..18bd008 --- /dev/null +++ b/tct-suite-vs/Tizen.MultimediaUtil.Tests/testcase/ImageUtil/TSWebPEncoder.cs @@ -0,0 +1,83 @@ +// Copyright 2020 by Samsung Electronics, Inc., +// +// This software is the confidential and proprietary information +// of Samsung Electronics, Inc. ("Confidential Information"). You +// shall not disclose such Confidential Information and shall use +// it only in accordance with the terms of the license agreement +// you entered into with Samsung. + +using NUnit.Framework; + +namespace Tizen.Multimedia.Util.Tests +{ + [TestFixture] + [Description("Tests Tizen.Multimedia.Util.WebPEncoder class")] + public class WebPEncoderTests + { + [Test] + [Category("P1")] + [Description("Test: Constructor for encoding WebP image - object should not be null after initializing")] + [Property("SPEC", "Tizen.Multimedia.Util.WebPEncoder.WebPEncoder C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void WebPEncoder_INIT() + { + using (var encoder = new WebPEncoder()) + { + Assert.IsNotNull(encoder, "Should not null."); + Assert.IsInstanceOf(encoder, "Should return WebPEncoder instance."); + Assert.AreEqual(encoder.Lossless, false, "The default lossless value Should be false."); + } + } + + [Test] + [Category("P1")] + [Description("Test: Constructor for encoding WebP image with lossless- object should not be null after initializing")] + [Property("SPEC", "Tizen.Multimedia.Util.WebPEncoder.WebPEncoder C")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "CONSTR")] + [Property("COVPARAM", "bool")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void WebPEncoder_INIT_WITH_Lossless() + { + using (var encoder = new WebPEncoder(true)) + { + Assert.IsNotNull(encoder, "Should not null."); + Assert.IsInstanceOf(encoder, "Should return WebPEncoder instance."); + Assert.AreEqual(encoder.Lossless, true, "Should be same value."); + } + } + + [Test] + [Category("P1")] + [Description("Check whether Lossless property is readable and writable.")] + [Property("SPEC", "Tizen.Multimedia.Util.WebPEncoder.Lossless A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PRW")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void Lossless_READ_WRITE() + { + using (var encoder = new WebPEncoder()) + { + encoder.Lossless = true; + Assert.AreEqual(encoder.Lossless, true, "Should be same value."); + + encoder.Lossless = false; + Assert.AreEqual(encoder.Lossless, false, "Should be same value."); + } + } + + [Test] + [Category("P1")] + [Description("Check whether the default value of Lossless property is false.")] + [Property("SPEC", "Tizen.Multimedia.Util.WebPEncoder.Lossless A")] + [Property("SPEC_URL", "-")] + [Property("CRITERIA", "PDV")] + [Property("AUTHOR", "Haesu Gwon, haesu.gwon@samsung.com")] + public void Lossless_CHECK_DEFAULT_VALUE() + { + Assert.AreEqual(new WebPEncoder().Lossless, false, "The default value should be false."); + } + } +} -- 2.7.4