using System.Runtime.CompilerServices; using LibHac.Common.FixedArrays; using Xunit; namespace LibHac.Tests.Common; public class FixedArraySizeTests { [Fact] public static void Array1SpanSizeIsCorrect() => Assert.Equal(1, new Array1().Items.Length); [Fact] public static void Array1ByteSizeIsCorrect() => Assert.Equal(sizeof(byte) * 1, Unsafe.SizeOf>()); [Fact] public static void Array1LongSizeIsCorrect() => Assert.Equal(sizeof(long) * 1, Unsafe.SizeOf>()); [Fact] public static void Array3SpanSizeIsCorrect() => Assert.Equal(3, new Array3().Items.Length); [Fact] public static void Array3ByteSizeIsCorrect() => Assert.Equal(sizeof(byte) * 3, Unsafe.SizeOf>()); [Fact] public static void Array3LongSizeIsCorrect() => Assert.Equal(sizeof(long) * 3, Unsafe.SizeOf>()); [Fact] public static void Array8SpanSizeIsCorrect() => Assert.Equal(8, new Array8().Items.Length); [Fact] public static void Array8ByteSizeIsCorrect() => Assert.Equal(sizeof(byte) * 8, Unsafe.SizeOf>()); [Fact] public static void Array8LongSizeIsCorrect() => Assert.Equal(sizeof(long) * 8, Unsafe.SizeOf>()); [Fact] public static void Array12SpanSizeIsCorrect() => Assert.Equal(12, new Array12().Items.Length); [Fact] public static void Array12ByteSizeIsCorrect() => Assert.Equal(sizeof(byte) * 12, Unsafe.SizeOf>()); [Fact] public static void Array12LongSizeIsCorrect() => Assert.Equal(sizeof(long) * 12, Unsafe.SizeOf>()); [Fact] public static void Array32SpanSizeIsCorrect() => Assert.Equal(32, new Array32().Items.Length); [Fact] public static void Array32ByteSizeIsCorrect() => Assert.Equal(sizeof(byte) * 32, Unsafe.SizeOf>()); [Fact] public static void Array32LongSizeIsCorrect() => Assert.Equal(sizeof(long) * 32, Unsafe.SizeOf>()); [Fact] public static void Array64SpanSizeIsCorrect() => Assert.Equal(64, new Array64().Items.Length); [Fact] public static void Array64ByteSizeIsCorrect() => Assert.Equal(sizeof(byte) * 64, Unsafe.SizeOf>()); [Fact] public static void Array64LongSizeIsCorrect() => Assert.Equal(sizeof(long) * 64, Unsafe.SizeOf>()); [Fact] public static void Array128SpanSizeIsCorrect() => Assert.Equal(128, new Array128().Items.Length); [Fact] public static void Array128ByteSizeIsCorrect() => Assert.Equal(sizeof(byte) * 128, Unsafe.SizeOf>()); [Fact] public static void Array128LongSizeIsCorrect() => Assert.Equal(sizeof(long) * 128, Unsafe.SizeOf>()); [Fact] public static void Array256SpanSizeIsCorrect() => Assert.Equal(256, new Array256().Items.Length); [Fact] public static void Array256ByteSizeIsCorrect() => Assert.Equal(sizeof(byte) * 256, Unsafe.SizeOf>()); [Fact] public static void Array256LongSizeIsCorrect() => Assert.Equal(sizeof(long) * 256, Unsafe.SizeOf>()); }