From 04631b84056eb7e0434819e5ffe703cd276053f9 Mon Sep 17 00:00:00 2001 From: Sanghoon Lee Date: Wed, 1 Aug 2018 13:03:38 +0900 Subject: [PATCH] [MediaPlayer][Non-ACR][Fixed svace issues] Change-Id: I8fdd4e12270dd3c1b53fd8b3ec8952150e5a126c --- .../testcase/support/PreconditionUtil.cs | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/support/PreconditionUtil.cs b/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/support/PreconditionUtil.cs index 581bede9c..8d0a439e1 100755 --- a/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/support/PreconditionUtil.cs +++ b/tct-suite-vs/Tizen.MediaPlayer.Tests/testcase/support/PreconditionUtil.cs @@ -30,6 +30,13 @@ namespace Tizen.Multimedia.Tests string result = ReadFile("/opt/usr/home/owner/share/tct/preconfigure.json"); int index = 0; string[] resultArray = StringParser(result); + + if (resultArray == null) + { + LogUtils.Write(LogUtils.ERROR, LogUtils.TAG, "StringParser failed " + result); + return; + } + foreach (string item in resultArray) { switch (item) @@ -54,17 +61,24 @@ namespace Tizen.Multimedia.Tests { string result = null; string url = path; + StreamReader reader = null; try { - StreamReader reader = File.OpenText(path); + reader = File.OpenText(path); result = reader.ReadToEnd(); } catch (Exception e) { LogUtils.Write(LogUtils.ERROR, LogUtils.TAG, "File read error : " + e.Message); } - + finally + { + if (reader != null) + { + reader.Dispose(); + } + } return result; } private static string[] StringParser(string TCID) -- 2.34.1