public static void ExportMinMipMapTest(TexImage image, ITexLibrary library, int minMipMapSize) { String outputFile = library.GetType().Name + "_ExportTest_MinMipMapSize-" + minMipMapSize + "_" + image.Name; library.Execute(image, new ExportRequest(Module.PathToOutputImages + outputFile, minMipMapSize)); TexImage image2 = new TexImage(); library.Execute(image2, new LoadingRequest(Module.PathToOutputImages + outputFile, false)); image2.CurrentLibrary = library; image.Update(); image2.Update(); Assert.True(image.Dimension == image2.Dimension); Assert.True(image2.SubImageArray[image2.SubImageArray.Length - 1].Width >= minMipMapSize); Assert.True(image2.SubImageArray[image2.SubImageArray.Length - 1].Height >= minMipMapSize); Assert.True(image.Width == image2.Width); Assert.True(image.Height == image2.Height); Assert.True(image.Depth == image2.Depth); Assert.True(image.ArraySize == image2.ArraySize); //Console.WriteLine("ExportMinMipMapTest_" + minMipMapSize + "_" + image.Name + "." + TestTools.ComputeSHA1(Module.PathToOutputImages + outputFile)); Assert.Equal(TestTools.GetInstance().Checksum["ExportMinMipMapTest_" + minMipMapSize + "_" + image.Name], TestTools.ComputeSHA1(Module.PathToOutputImages + outputFile)); File.Delete(Module.PathToOutputImages + outputFile); image2.Dispose(); }
public static void ExportTest(TexImage image, ITexLibrary library, string file) { String outputFile = library.GetType().Name + "_ExportTest_" + file; library.Execute(image, new ExportRequest(Module.PathToOutputImages + outputFile, 0)); //Console.WriteLine("ExportTest_" + file + "." + TestTools.ComputeSHA1(Module.PathToOutputImages + outputFile)); Assert.Equal(TestTools.GetInstance().Checksum["ExportTest_" + file], TestTools.ComputeSHA1(Module.PathToOutputImages + outputFile)); File.Delete(Module.PathToOutputImages + outputFile); }
public static void ExportTest(TexImage image, ITexLibrary library, string file) { String outputFile = library.GetType().Name + "_ExportTest_" + file; library.Execute(image, new ExportRequest(TestTools.TempFolder + outputFile, 0)); //Console.WriteLine("ExportTest_" + file + "." + TestTools.ComputeSHA1(TestTools.TempFolder + outputFile)); Assert.IsTrue(TestTools.ComputeSHA1(TestTools.TempFolder + outputFile).Equals(TestTools.GetInstance().Checksum["ExportTest_" + file])); File.Delete(TestTools.TempFolder + outputFile); }
public static void ExportMinMipMapTest(TexImage image, ITexLibrary library, int minMipMapSize) { String outputFile = library.GetType().Name + "_ExportTest_MinMipMapSize-" + minMipMapSize + "_" + image.Name; library.Execute(image, new ExportRequest(Module.PathToOutputImages + outputFile, minMipMapSize)); TexImage image2 = new TexImage(); library.Execute(image2, new LoadingRequest(Module.PathToOutputImages + outputFile, false)); image2.CurrentLibrary = library; image.Update(); image2.Update(); Assert.IsTrue(image.Dimension == image2.Dimension); Assert.IsTrue(image2.SubImageArray[image2.SubImageArray.Length - 1].Width >= minMipMapSize); Assert.IsTrue(image2.SubImageArray[image2.SubImageArray.Length - 1].Height >= minMipMapSize); Assert.IsTrue(image.Width == image2.Width); Assert.IsTrue(image.Height == image2.Height); Assert.IsTrue(image.Depth == image2.Depth); Assert.IsTrue(image.ArraySize == image2.ArraySize); //Console.WriteLine("ExportMinMipMapTest_" + minMipMapSize + "_" + image.Name + "." + TestTools.ComputeSHA1(Module.PathToOutputImages + outputFile)); Assert.IsTrue(TestTools.ComputeSHA1(Module.PathToOutputImages + outputFile).Equals(TestTools.GetInstance().Checksum["ExportMinMipMapTest_" + minMipMapSize + "_" + image.Name])); File.Delete(Module.PathToOutputImages + outputFile); image2.Dispose(); }
public static void ExportTest(TexImage image, ITexLibrary library, string file) { String outputFile = library.GetType().Name + "_ExportTest_" + file; library.Execute(image, new ExportRequest(Module.PathToOutputImages + outputFile, 0)); //Console.WriteLine("ExportTest_" + file + "." + TestTools.ComputeSHA1(Module.PathToOutputImages + outputFile)); Assert.IsTrue(TestTools.ComputeSHA1(Module.PathToOutputImages + outputFile).Equals(TestTools.GetInstance().Checksum["ExportTest_" + file])); File.Delete(Module.PathToOutputImages + outputFile); }