feyris-tan 781636e0a3
All checks were successful
🚀 Pack skyscraper8 / make-zip (push) Successful in 1m39s
Added a further BFBS Test.
2025-11-06 16:04:55 +01:00

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);
}
}
}