Esempio n. 1
0
        public void should_append_value_as_hex_3()
        {
            StringBuffer buffer = new StringBuffer(1024);
            int          x      = 0x10203040;
            var          bytes  = BitConverter.GetBytes(x);
            byte *       x_ptr  = (byte *)&x;

            HexUtils.AppendValueAsHex(buffer, x_ptr, sizeof(int));
            var s        = buffer.ToString();
            var expected = BitConverter.IsLittleEndian ? "40302010" : "10203040";

            Assert.That(s, Is.EqualTo(expected));
        }
Esempio n. 2
0
 public void AppendUnformattedTo(StringBuffer stringBuffer, byte *valuePtr)
 {
     stringBuffer.Append("Unmanaged(0x");
     HexUtils.AppendValueAsHex(stringBuffer, valuePtr, _typeSize);
     stringBuffer.Append(")");
 }
Esempio n. 3
0
 private static void AppendUnregistered(StringBuffer buffer, byte *valuePtr, int size)
 {
     buffer.Append("Unmanaged(0x");
     HexUtils.AppendValueAsHex(buffer, valuePtr, size);
     buffer.Append(")");
 }