From fc731076eff4b165cfbf78470d750c692b1da46b Mon Sep 17 00:00:00 2001 From: Alex Barney Date: Sun, 9 May 2021 23:30:32 -0700 Subject: [PATCH] Remove SaveDataInfoFilter layout tests SaveDataInfoFilter is an internal struct so there's no need to test the struct's size and layout --- .../SaveDataServiceTests/TypeSizeTests.cs | 43 ------------------- 1 file changed, 43 deletions(-) delete mode 100644 tests/LibHac.Tests/FsSrv/SaveDataServiceTests/TypeSizeTests.cs diff --git a/tests/LibHac.Tests/FsSrv/SaveDataServiceTests/TypeSizeTests.cs b/tests/LibHac.Tests/FsSrv/SaveDataServiceTests/TypeSizeTests.cs deleted file mode 100644 index 517e1238..00000000 --- a/tests/LibHac.Tests/FsSrv/SaveDataServiceTests/TypeSizeTests.cs +++ /dev/null @@ -1,43 +0,0 @@ -// ReSharper disable InconsistentNaming -using System.Runtime.CompilerServices; -using LibHac.Fs; -using LibHac.FsSrv; -using LibHac.Ncm; -using LibHac.Util; -using Xunit; - -namespace LibHac.Tests.FsSrv.SaveDataServiceTests -{ - public class TypeSizeTests - { - [Fact] - public static void SaveDataInfoFilterSizeIs0x60() - { - Assert.Equal(0x60, Unsafe.SizeOf()); - } - - [Fact] - public static void SaveDataInfoFilterLayoutIsCorrect() - { - var filter = new SaveDataInfoFilter(); - - ref byte baseRef = ref Unsafe.As(ref filter); - - ref byte spaceIdRef = ref Unsafe.As, byte>(ref filter.SpaceId); - ref byte programIdRef = ref Unsafe.As, byte>(ref filter.ProgramId); - ref byte saveTypeRef = ref Unsafe.As, byte>(ref filter.SaveDataType); - ref byte userIdRef = ref Unsafe.As, byte>(ref filter.UserId); - ref byte saveIdRef = ref Unsafe.As, byte>(ref filter.SaveDataId); - ref byte indexRef = ref Unsafe.As, byte>(ref filter.Index); - ref byte rankRef = ref Unsafe.As(ref filter.Rank); - - Assert.Equal(0x00, (int)Unsafe.ByteOffset(ref baseRef, ref spaceIdRef)); - Assert.Equal(0x08, (int)Unsafe.ByteOffset(ref baseRef, ref programIdRef)); - Assert.Equal(0x18, (int)Unsafe.ByteOffset(ref baseRef, ref saveTypeRef)); - Assert.Equal(0x20, (int)Unsafe.ByteOffset(ref baseRef, ref userIdRef)); - Assert.Equal(0x38, (int)Unsafe.ByteOffset(ref baseRef, ref saveIdRef)); - Assert.Equal(0x48, (int)Unsafe.ByteOffset(ref baseRef, ref indexRef)); - Assert.Equal(0x4C, (int)Unsafe.ByteOffset(ref baseRef, ref rankRef)); - } - } -}