31 lines
585 B
C#
31 lines
585 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using skyscraper5.Skyscraper.IO;
|
|
|
|
namespace skyscraper8.Tests
|
|
{
|
|
public class SanityTests
|
|
{
|
|
[Fact]
|
|
public void Test15bits()
|
|
{
|
|
byte[] bcd = new byte[] { 0xa9, 0x23 };
|
|
MemoryStream ms = new MemoryStream(bcd);
|
|
byte readUInt8 = ms.ReadUInt8();
|
|
|
|
bool msbSet = (readUInt8 & 0x80) != 0;
|
|
Assert.True(msbSet);
|
|
|
|
readUInt8 &= 0b01111111;
|
|
|
|
int result = ms.ReadUInt8();
|
|
result <<= 8;
|
|
result += readUInt8;
|
|
Assert.Equal(9001, result);
|
|
}
|
|
}
|
|
}
|