diff --git a/MapleHaSuite.sln b/MapleHaSuite.sln index 7bb676f5..f2d496f4 100644 --- a/MapleHaSuite.sln +++ b/MapleHaSuite.sln @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 16 -VisualStudioVersion = 16.0.30907.101 +# Visual Studio Version 17 +VisualStudioVersion = 17.1.32203.90 MinimumVisualStudioVersion = 10.0.40219.1 Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MapleLib", "MapleLib\MapleLib.csproj", "{28AAB36D-942E-4476-A000-0E9DE380F390}" EndProject @@ -26,6 +26,10 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "squishpng", "squish-1.11\vs EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "squishtest", "squish-1.11\vs9\squishtest\squishtest.vcxproj", "{77A3F26C-A1D6-4535-9E37-7D3DF34E4B4B}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Test", "Test", "{55DA028C-3222-448E-A01C-BBB5A42F586D}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UnitTest_WzFile", "UnitTest_WzFile\UnitTest_WzFile.csproj", "{82A30B11-2700-4F40-B05B-9BE5DEAD522B}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -174,6 +178,22 @@ Global {77A3F26C-A1D6-4535-9E37-7D3DF34E4B4B}.Release|x64.Build.0 = Release|x64 {77A3F26C-A1D6-4535-9E37-7D3DF34E4B4B}.Release|x86.ActiveCfg = Release|Win32 {77A3F26C-A1D6-4535-9E37-7D3DF34E4B4B}.Release|x86.Build.0 = Release|Win32 + {82A30B11-2700-4F40-B05B-9BE5DEAD522B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {82A30B11-2700-4F40-B05B-9BE5DEAD522B}.Debug|Any CPU.Build.0 = Debug|Any CPU + {82A30B11-2700-4F40-B05B-9BE5DEAD522B}.Debug|Win32.ActiveCfg = Debug|Any CPU + {82A30B11-2700-4F40-B05B-9BE5DEAD522B}.Debug|Win32.Build.0 = Debug|Any CPU + {82A30B11-2700-4F40-B05B-9BE5DEAD522B}.Debug|x64.ActiveCfg = Debug|Any CPU + {82A30B11-2700-4F40-B05B-9BE5DEAD522B}.Debug|x64.Build.0 = Debug|Any CPU + {82A30B11-2700-4F40-B05B-9BE5DEAD522B}.Debug|x86.ActiveCfg = Debug|Any CPU + {82A30B11-2700-4F40-B05B-9BE5DEAD522B}.Debug|x86.Build.0 = Debug|Any CPU + {82A30B11-2700-4F40-B05B-9BE5DEAD522B}.Release|Any CPU.ActiveCfg = Release|Any CPU + {82A30B11-2700-4F40-B05B-9BE5DEAD522B}.Release|Any CPU.Build.0 = Release|Any CPU + {82A30B11-2700-4F40-B05B-9BE5DEAD522B}.Release|Win32.ActiveCfg = Release|Any CPU + {82A30B11-2700-4F40-B05B-9BE5DEAD522B}.Release|Win32.Build.0 = Release|Any CPU + {82A30B11-2700-4F40-B05B-9BE5DEAD522B}.Release|x64.ActiveCfg = Release|Any CPU + {82A30B11-2700-4F40-B05B-9BE5DEAD522B}.Release|x64.Build.0 = Release|Any CPU + {82A30B11-2700-4F40-B05B-9BE5DEAD522B}.Release|x86.ActiveCfg = Release|Any CPU + {82A30B11-2700-4F40-B05B-9BE5DEAD522B}.Release|x86.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -188,6 +208,7 @@ Global {6A8518C3-D81A-4428-BD7F-C37933088AC1} = {BF308906-0C4D-496F-A030-FA6D3CF89563} {3BC7CF47-F1C8-4BDA-BE30-92F17B21D2C7} = {BF308906-0C4D-496F-A030-FA6D3CF89563} {77A3F26C-A1D6-4535-9E37-7D3DF34E4B4B} = {BF308906-0C4D-496F-A030-FA6D3CF89563} + {82A30B11-2700-4F40-B05B-9BE5DEAD522B} = {55DA028C-3222-448E-A01C-BBB5A42F586D} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {3544F28D-545F-4E21-B8A8-A86A825F53B5} diff --git a/UnitTest_WzFile/Properties/AssemblyInfo.cs b/UnitTest_WzFile/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..f29ba829 --- /dev/null +++ b/UnitTest_WzFile/Properties/AssemblyInfo.cs @@ -0,0 +1,20 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("UnitTest_WzFile")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("UnitTest_WzFile")] +[assembly: AssemblyCopyright("Copyright © 2022")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +[assembly: ComVisible(false)] + +[assembly: Guid("82a30b11-2700-4f40-b05b-9be5dead522b")] + +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/UnitTest_WzFile/UnitTest1.cs b/UnitTest_WzFile/UnitTest1.cs new file mode 100644 index 00000000..b8c30633 --- /dev/null +++ b/UnitTest_WzFile/UnitTest1.cs @@ -0,0 +1,67 @@ +using MapleLib.WzLib; +using Microsoft.VisualStudio.TestTools.UnitTesting; +using System; +using System.Collections.Generic; +using System.IO; + +namespace UnitTest_WzFile +{ + [TestClass] + public class UnitTest1 + { + private static List> _testFiles = new List>(); + + public UnitTest1() + { + // KMS + _testFiles.Add(new Tuple("TamingMob_000_KMS_359.wz", WzMapleVersion.BMS)); + + // GMS + _testFiles.Add(new Tuple("TamingMob_GMS_146.wz", WzMapleVersion.BMS)); + _testFiles.Add(new Tuple("TamingMob_GMS_176.wz", WzMapleVersion.BMS)); + _testFiles.Add(new Tuple("TamingMob_GMS_230.wz", WzMapleVersion.BMS)); + _testFiles.Add(new Tuple("TamingMob_GMS_75.wz", WzMapleVersion.GMS)); + _testFiles.Add(new Tuple("TamingMob_GMS_87.wz", WzMapleVersion.GMS)); + _testFiles.Add(new Tuple("TamingMob_GMS_95.wz", WzMapleVersion.GMS)); + + // MSEA + _testFiles.Add(new Tuple("TamingMob_SEA_135.wz", WzMapleVersion.BMS)); + _testFiles.Add(new Tuple("TamingMob_SEA_160.wz", WzMapleVersion.BMS)); + _testFiles.Add(new Tuple("TamingMob_SEA_211.wz", WzMapleVersion.BMS)); + _testFiles.Add(new Tuple("TamingMob_SEA_212.wz", WzMapleVersion.BMS)); + + // Thailand MS + _testFiles.Add(new Tuple("TamingMob_ThaiMS_3.wz", WzMapleVersion.BMS)); + + // TaiwanMS + _testFiles.Add(new Tuple("TamingMob_TMS_113.wz", WzMapleVersion.EMS)); + } + + [TestMethod] + public void TestOlderWzFiles() + { + foreach (Tuple testFile in _testFiles) + { + string fileName = testFile.Item1; + WzMapleVersion wzMapleVerEnc = testFile.Item2; + + string filePath = Path.Combine(Directory.GetCurrentDirectory(), "WzFiles", fileName); + + try + { + WzFile f = new WzFile(filePath, (short) -1, wzMapleVerEnc); + + WzFileParseStatus parseStatus = f.ParseWzFile(); + + Assert.IsFalse(parseStatus != WzFileParseStatus.Success, + "Error initializing " + fileName + " (" + parseStatus.GetErrorDescription() + ")."); + } + catch (Exception e) + { + Assert.IsTrue(true, + "Error initializing " + Path.GetFileName(filePath) + " (" + e.Message + ").\r\nAlso, check that the directory is valid and the file is not in use."); + } + } + } + } +} diff --git a/UnitTest_WzFile/UnitTest_WzFile.csproj b/UnitTest_WzFile/UnitTest_WzFile.csproj new file mode 100644 index 00000000..018d59d4 --- /dev/null +++ b/UnitTest_WzFile/UnitTest_WzFile.csproj @@ -0,0 +1,117 @@ + + + + + + Debug + AnyCPU + {82A30B11-2700-4F40-B05B-9BE5DEAD522B} + Library + Properties + UnitTest_WzFile + UnitTest_WzFile + v4.8 + 512 + {3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + 15.0 + $(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion) + $(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages + False + UnitTest + + + + + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\MSTest.TestFramework.2.2.7\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.dll + + + ..\packages\MSTest.TestFramework.2.2.7\lib\net45\Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions.dll + + + + + + + + + + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + Always + + + + + {5411388b-f3cb-4d52-9f55-abd15cfe966c} + HaSharedLibrary + + + {28aab36d-942e-4476-a000-0e9de380f390} + MapleLib + + + + + + + This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. + + + + + + \ No newline at end of file diff --git a/UnitTest_WzFile/WzFiles/TamingMob_000_KMS_359.wz b/UnitTest_WzFile/WzFiles/TamingMob_000_KMS_359.wz new file mode 100644 index 00000000..a53d4bc6 Binary files /dev/null and b/UnitTest_WzFile/WzFiles/TamingMob_000_KMS_359.wz differ diff --git a/UnitTest_WzFile/WzFiles/TamingMob_GMS_146.wz b/UnitTest_WzFile/WzFiles/TamingMob_GMS_146.wz new file mode 100644 index 00000000..6c355cf1 Binary files /dev/null and b/UnitTest_WzFile/WzFiles/TamingMob_GMS_146.wz differ diff --git a/UnitTest_WzFile/WzFiles/TamingMob_GMS_176.wz b/UnitTest_WzFile/WzFiles/TamingMob_GMS_176.wz new file mode 100644 index 00000000..de739049 Binary files /dev/null and b/UnitTest_WzFile/WzFiles/TamingMob_GMS_176.wz differ diff --git a/UnitTest_WzFile/WzFiles/TamingMob_GMS_230.wz b/UnitTest_WzFile/WzFiles/TamingMob_GMS_230.wz new file mode 100644 index 00000000..f44a871b Binary files /dev/null and b/UnitTest_WzFile/WzFiles/TamingMob_GMS_230.wz differ diff --git a/UnitTest_WzFile/WzFiles/TamingMob_GMS_75.wz b/UnitTest_WzFile/WzFiles/TamingMob_GMS_75.wz new file mode 100644 index 00000000..20ce2202 Binary files /dev/null and b/UnitTest_WzFile/WzFiles/TamingMob_GMS_75.wz differ diff --git a/UnitTest_WzFile/WzFiles/TamingMob_GMS_87.wz b/UnitTest_WzFile/WzFiles/TamingMob_GMS_87.wz new file mode 100644 index 00000000..329ab0ad Binary files /dev/null and b/UnitTest_WzFile/WzFiles/TamingMob_GMS_87.wz differ diff --git a/UnitTest_WzFile/WzFiles/TamingMob_GMS_95.wz b/UnitTest_WzFile/WzFiles/TamingMob_GMS_95.wz new file mode 100644 index 00000000..60734d1d Binary files /dev/null and b/UnitTest_WzFile/WzFiles/TamingMob_GMS_95.wz differ diff --git a/UnitTest_WzFile/WzFiles/TamingMob_SEA_135.wz b/UnitTest_WzFile/WzFiles/TamingMob_SEA_135.wz new file mode 100644 index 00000000..7c70b053 Binary files /dev/null and b/UnitTest_WzFile/WzFiles/TamingMob_SEA_135.wz differ diff --git a/UnitTest_WzFile/WzFiles/TamingMob_SEA_160.wz b/UnitTest_WzFile/WzFiles/TamingMob_SEA_160.wz new file mode 100644 index 00000000..671c229f Binary files /dev/null and b/UnitTest_WzFile/WzFiles/TamingMob_SEA_160.wz differ diff --git a/UnitTest_WzFile/WzFiles/TamingMob_SEA_211.wz b/UnitTest_WzFile/WzFiles/TamingMob_SEA_211.wz new file mode 100644 index 00000000..264ace72 Binary files /dev/null and b/UnitTest_WzFile/WzFiles/TamingMob_SEA_211.wz differ diff --git a/UnitTest_WzFile/WzFiles/TamingMob_SEA_212.wz b/UnitTest_WzFile/WzFiles/TamingMob_SEA_212.wz new file mode 100644 index 00000000..6e375086 Binary files /dev/null and b/UnitTest_WzFile/WzFiles/TamingMob_SEA_212.wz differ diff --git a/UnitTest_WzFile/WzFiles/TamingMob_TMS_113.wz b/UnitTest_WzFile/WzFiles/TamingMob_TMS_113.wz new file mode 100644 index 00000000..5527aa2c Binary files /dev/null and b/UnitTest_WzFile/WzFiles/TamingMob_TMS_113.wz differ diff --git a/UnitTest_WzFile/WzFiles/TamingMob_ThaiMS_3.wz b/UnitTest_WzFile/WzFiles/TamingMob_ThaiMS_3.wz new file mode 100644 index 00000000..2a78c2d3 Binary files /dev/null and b/UnitTest_WzFile/WzFiles/TamingMob_ThaiMS_3.wz differ diff --git a/UnitTest_WzFile/packages.config b/UnitTest_WzFile/packages.config new file mode 100644 index 00000000..d35ea08e --- /dev/null +++ b/UnitTest_WzFile/packages.config @@ -0,0 +1,5 @@ + + + + + \ No newline at end of file