Exemple #1
0
 public void TestSetUp()
 {
     library = new ArrayTexLib();
     fiLib   = new FITexLib();
     dxtLib  = new DxtTexLib();
     Assert.IsTrue(library.SupportBGRAOrder());
     library.StartLibrary(new TexAtlas());
 }
Exemple #2
0
 public ArrayTexLibraryTest()
 {
     Module.LoadLibraries();
     library = new ArrayTexLib();
     fiLib = new FITexLib();
     dxtLib = new DxtTexLib();
     Assert.True(library.SupportBGRAOrder());
     library.StartLibrary(new TexAtlas());
 }
Exemple #3
0
        public void RemoveTest(string arrayFile, int indice)
        {
            TexImage array = TestTools.Load(dxtLib, arrayFile);

            int arraySize = array.ArraySize;

            dxtLib.EndLibrary(array);
            library.StartLibrary(array); // for fun cause it's empty
            library.Execute(array, new ArrayElementRemovalRequest(indice));
            array.CurrentLibrary = library;
            array.Update();

            Assert.IsTrue(arraySize == array.ArraySize + 1);

            //Console.WriteLine("ArrayTexLibrary_Remove_" + indice + "_" + arrayFile + "." + TestTools.ComputeSHA1(array.Data, array.DataSize));
            Assert.IsTrue(TestTools.ComputeSHA1(array.Data, array.DataSize).Equals(TestTools.GetInstance().Checksum["ArrayTexLibrary_Remove_" + indice + "_" + arrayFile]));

            array.Dispose();
        }
Exemple #4
0
        public void InsertTest(string arrayFile, string newTexture, int indice)
        {
            TexImage array = TestTools.Load(dxtLib, arrayFile);

            int arraySize = array.ArraySize;

            var texture = TestTools.Load(fiLib, newTexture);

            dxtLib.EndLibrary(array);
            library.StartLibrary(array); // for fun cause it's empty
            library.Execute(array, new ArrayInsertionRequest(texture, indice));
            array.CurrentLibrary = library;
            array.Update();

            Assert.True(arraySize == array.ArraySize - 1);

            //Console.WriteLine("ArrayTexLibrary_Insert_" + Path.GetFileName(newTexture) + "_" + indice + "_" + arrayFile + "." + TestTools.ComputeSHA1(array.Data, array.DataSize));
            Assert.Equal(TestTools.GetInstance().Checksum["ArrayTexLibrary_Insert_" + Path.GetFileName(newTexture) + "_" + indice + "_" + arrayFile], TestTools.ComputeSHA1(array.Data, array.DataSize));

            array.Dispose();
        }