diff --git a/VSharp.Test/Tests/Marshaling.cs b/VSharp.Test/Tests/Marshaling.cs index 54a94cf2c..f1d232bed 100644 --- a/VSharp.Test/Tests/Marshaling.cs +++ b/VSharp.Test/Tests/Marshaling.cs @@ -1,3 +1,4 @@ +using System; using NUnit.Framework; using System.Collections.Generic; using ChessDotNet; @@ -196,7 +197,7 @@ public static int Indirect_Change() return x; } - [TestSvm] + [TestSvm(100)] public static Dictionary CreateRepeatingDictionary() { Dictionary fenMappings = new Dictionary() @@ -209,7 +210,7 @@ public static Dictionary CreateRepeatingDictionary() return fenMappings; } - [Ignore("GetTypeFromHandle() is not implemented")] + [TestSvm(100)] public static Dictionary CreateDictionary() { Dictionary fenMappings = new Dictionary() diff --git a/VSharp.Test/Tests/Strings.cs b/VSharp.Test/Tests/Strings.cs index 6cb230f97..bc47b711a 100644 --- a/VSharp.Test/Tests/Strings.cs +++ b/VSharp.Test/Tests/Strings.cs @@ -1,4 +1,5 @@ using System; +using System.Collections; using System.Text; using NUnit.Framework; using VSharp.Test; @@ -339,12 +340,12 @@ public static string StringRegex1(string str) } [Ignore("takes too much time")] - public static string StringRegex2(string str) + public static int StringRegex2(string str) { var result = System.Text.RegularExpressions.Regex.Match(str, ".*"); if (result.Value != str) - return ""; - return result.Value; + return -1; + return 1; } [TestSvm(100, strat: SearchStrategy.ExecutionTreeContributedCoverage)] @@ -356,7 +357,7 @@ public static string StringRegex3(string str) return result.Groups["major"].Value + result.Groups["minor"].Value + result.Groups["patch"].Value; } - [TestSvm(100, strat: SearchStrategy.ExecutionTreeContributedCoverage)] + [TestSvm(100)] public static string StringRegex4() { var input = "7.3.7"; @@ -364,6 +365,46 @@ public static string StringRegex4() return result.Groups["major"].Value + result.Groups["minor"].Value + result.Groups["patch"].Value; } + [TestSvm(100)] + public static string StringRegex5() + { + var input = "kek"; + var result = System.Text.RegularExpressions.Regex.Match(input, "(?)"); + return result.Groups["fst"].Value; + } + + [TestSvm(100)] + public static bool StringHashtable() + { + var table = new Hashtable { { "fst", 1 } }; + return table.ContainsKey("fst"); + } + + [Ignore("fix strings comparison")] + public static int StringGetHashCode(string str) + { + if (str == "abc") + { + if (str.GetHashCode() == "abc".GetHashCode()) + return 1; + return -1; + } + + return 0; + } + + [Ignore("takes too much time")] + public static int StringGetHashCode1(string str) + { + if (str == "abc") + { + if (str.GetHashCode() == "abc".GetHashCode()) + return 1; + return -1; + } + + return 0; + } [TestSvm(100, strat: SearchStrategy.ExecutionTreeContributedCoverage)] public static int FromUtf16(char[] a) {