public void TestMultipleDispose()
        {
            DepthFrameData data = new DepthFrameData();

            data.Dispose();
            //Second call to dispose should do nothing
            data.Dispose();

            Assert.AreEqual(data.DataPointer, IntPtr.Zero);
        }
Beispiel #2
0
        public void TextCompressBodyFrame()
        {
            DepthFrameData frame = FakeImageData.RandomDepthFrame();

            SnappyFrameCompressor compressor = new SnappyFrameCompressor(KinectFrameInformation.DepthFrame);

            compressor.Compress(frame.DataPointer);

            SnappyFrameDecompressor decompressor = new SnappyFrameDecompressor(KinectFrameInformation.DepthFrame);

            var barray = compressor.CompressedFrameData;

            fixed(byte *bptr = &barray[0])
            {
                decompressor.UnCompress(new IntPtr(bptr), compressor.CompressedSize);
            }

            var decomparray = decompressor.UnCompressedFrameData;

            fixed(byte *bptr = &barray[0])
            {
                FakeImageData.ByteCheck(frame.DataPointer, new IntPtr(bptr), decompressor.UnCompressedSize);
            }

            frame.Dispose();
        }
        public void TestDisposedSize()
        {
            DepthFrameData data = new DepthFrameData();

            data.Dispose();
            Assert.AreEqual(data.SizeInBytes, 0);
        }
        public void TestDispose()
        {
            DepthFrameData data = new DepthFrameData();

            data.Dispose();
            Assert.AreEqual(data.DataPointer, IntPtr.Zero);
        }
        public void TestConstrutor()
        {
            DepthFrameData data = new DepthFrameData();
            bool           pass = data.DataPointer != IntPtr.Zero;

            data.Dispose();
            Assert.AreEqual(true, pass);
        }
        public void TestSize()
        {
            DepthFrameData data     = new DepthFrameData();
            int            expected = 512 * 424 * 2;
            bool           pass     = data.SizeInBytes == expected;

            data.Dispose();
            Assert.AreEqual(pass, true);
        }
        public void TestDisposeAccess()
        {
            DepthFrameData data = new DepthFrameData();

            data.Dispose();

            //Should throw exception
            var pointer = data.DataPointer;
        }