You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
27 lines
574 B
C#
27 lines
574 B
C#
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
|
|
|
namespace EpicGames.Serialization.Tests
|
|
{
|
|
[TestClass]
|
|
public class VarIntTests
|
|
{
|
|
[TestMethod]
|
|
public void TestVarInt()
|
|
{
|
|
byte[] buffer = new byte[20];
|
|
|
|
int length = VarInt.Write(buffer, -1);
|
|
Assert.AreEqual(9, length);
|
|
Assert.AreEqual(9, VarInt.Measure(-1));
|
|
|
|
Assert.AreEqual(9, VarInt.Measure(buffer));
|
|
int value = (int)(long)VarInt.Read(buffer, out int bytesRead);
|
|
Assert.AreEqual(9, bytesRead);
|
|
|
|
Assert.AreEqual(-1, value);
|
|
}
|
|
}
|
|
}
|