Esempio n. 1
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldPutAndGetByteWiseLittleEndianLong()
        internal virtual void ShouldPutAndGetByteWiseLittleEndianLong()
        {
            // GIVEN
            int sizeInBytes             = 8;
            GlobalMemoryTracker tracker = GlobalMemoryTracker.INSTANCE;
            long p     = allocateMemory(sizeInBytes, tracker);
            long value = 0b11001100_10101010_10011001_01100110__10001000_01000100_00100010_00010001L;

            // WHEN
            UnsafeUtil.PutLongByteWiseLittleEndian(p, value);
            long readValue = UnsafeUtil.GetLongByteWiseLittleEndian(p);

            // THEN
            free(p, sizeInBytes, tracker);
            assertEquals(value, readValue);
        }
Esempio n. 2
0
//JAVA TO C# CONVERTER TODO TASK: Most Java annotations will not have direct .NET equivalent attributes:
//ORIGINAL LINE: @Test void shouldPutAndGetByteWiseLittleEndianShort()
        internal virtual void ShouldPutAndGetByteWiseLittleEndianShort()
        {
            // GIVEN
            int sizeInBytes             = 2;
            GlobalMemoryTracker tracker = GlobalMemoryTracker.INSTANCE;
            long  p     = allocateMemory(sizeInBytes, tracker);
            short value = ( short )0b11001100_10101010;

            // WHEN
            UnsafeUtil.PutShortByteWiseLittleEndian(p, value);
            short readValue = UnsafeUtil.GetShortByteWiseLittleEndian(p);

            // THEN
            free(p, sizeInBytes, tracker);
            assertEquals(value, readValue);
        }