Fixing a couple tests related to the struct packing fix

This commit is contained in:
Tanner Gooding 2021-08-19 09:59:16 -07:00
Родитель 47a91c97cf
Коммит 7d4f662962
9 изменённых файлов: 32 добавлений и 18 удалений

Просмотреть файл

@ -15,8 +15,7 @@
},
"GenerateLocal": {
"commandName": "Project",
"commandLineArgs": "@generate.rsp",
"workingDirectory": "C:\\Users\\tagoo\\Source\\repos\\terrafx.interop.windows\\generation\\um\\dwmapi"
"commandLineArgs": "-c help"
}
}
}

Просмотреть файл

@ -133,12 +133,13 @@ union MyUnion3
unsigned int o0_b1_1 : 1;
};
";
var expectedPack = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? ", Pack = 1" : "";
var expectedOutputContents = $@"using System.Runtime.InteropServices;
namespace ClangSharp.Test
{{
[StructLayout(LayoutKind.Explicit)]
[StructLayout(LayoutKind.Explicit{expectedPack})]
public partial struct MyUnion1
{{
[FieldOffset(0)]
@ -287,7 +288,7 @@ namespace ClangSharp.Test
}}
}}
[StructLayout(LayoutKind.Explicit)]
[StructLayout(LayoutKind.Explicit{expectedPack})]
public partial struct MyUnion3
{{
[FieldOffset(0)]

Просмотреть файл

@ -134,11 +134,13 @@ union MyUnion3
};
";
var expectedPack = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? ", Pack = 1" : "";
var expectedOutputContents = $@"using System.Runtime.InteropServices;
namespace ClangSharp.Test
{{
[StructLayout(LayoutKind.Explicit)]
[StructLayout(LayoutKind.Explicit{expectedPack})]
public partial struct MyUnion1
{{
[FieldOffset(0)]
@ -293,7 +295,7 @@ namespace ClangSharp.Test
}}
}}
[StructLayout(LayoutKind.Explicit)]
[StructLayout(LayoutKind.Explicit{expectedPack})]
public partial struct MyUnion3
{{
[FieldOffset(0)]

Просмотреть файл

@ -134,11 +134,13 @@ union MyUnion3
};
";
var expectedPack = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? ", Pack = 1" : "";
var expectedOutputContents = $@"using System.Runtime.InteropServices;
namespace ClangSharp.Test
{{
[StructLayout(LayoutKind.Explicit)]
[StructLayout(LayoutKind.Explicit{expectedPack})]
public partial struct MyUnion1
{{
[FieldOffset(0)]
@ -287,7 +289,7 @@ namespace ClangSharp.Test
}}
}}
[StructLayout(LayoutKind.Explicit)]
[StructLayout(LayoutKind.Explicit{expectedPack})]
public partial struct MyUnion3
{{
[FieldOffset(0)]

Просмотреть файл

@ -134,11 +134,13 @@ union MyUnion3
};
";
var expectedPack = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? ", Pack = 1" : "";
var expectedOutputContents = $@"using System.Runtime.InteropServices;
namespace ClangSharp.Test
{{
[StructLayout(LayoutKind.Explicit)]
[StructLayout(LayoutKind.Explicit{expectedPack})]
public partial struct MyUnion1
{{
[FieldOffset(0)]
@ -293,7 +295,7 @@ namespace ClangSharp.Test
}}
}}
[StructLayout(LayoutKind.Explicit)]
[StructLayout(LayoutKind.Explicit{expectedPack})]
public partial struct MyUnion3
{{
[FieldOffset(0)]

Просмотреть файл

@ -128,10 +128,12 @@ union MyUnion3
};
";
var expectedPack = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? @" pack=""1""" : "";
var expectedOutputContents = $@"<?xml version=""1.0"" encoding=""UTF-8"" standalone=""yes"" ?>
<bindings>
<namespace name=""ClangSharp.Test"">
<struct name=""MyUnion1"" access=""public"" layout=""Explicit"">
<struct name=""MyUnion1"" access=""public"" layout=""Explicit""{expectedPack}>
<field name=""_bitfield1"" access=""public"" offset=""0"">
<type>uint</type>
</field>
@ -240,7 +242,7 @@ union MyUnion3
</set>
</field>
</struct>
<struct name=""MyUnion3"" access=""public"" layout=""Explicit"">
<struct name=""MyUnion3"" access=""public"" layout=""Explicit""{expectedPack}>
<field name=""_bitfield"" access=""public"" offset=""0"">
<type>uint</type>
</field>

Просмотреть файл

@ -128,10 +128,12 @@ union MyUnion3
};
";
var expectedPack = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? @" pack=""1""" : "";
var expectedOutputContents = $@"<?xml version=""1.0"" encoding=""UTF-8"" standalone=""yes"" ?>
<bindings>
<namespace name=""ClangSharp.Test"">
<struct name=""MyUnion1"" access=""public"" layout=""Explicit"">
<struct name=""MyUnion1"" access=""public"" layout=""Explicit""{expectedPack}>
<field name=""_bitfield1"" access=""public"" offset=""0"">
<type>uint</type>
</field>
@ -246,7 +248,7 @@ union MyUnion3
</set>
</field>
</struct>
<struct name=""MyUnion3"" access=""public"" layout=""Explicit"">
<struct name=""MyUnion3"" access=""public"" layout=""Explicit""{expectedPack}>
<field name=""_bitfield"" access=""public"" offset=""0"">
<type>uint</type>
</field>

Просмотреть файл

@ -128,10 +128,12 @@ union MyUnion3
};
";
var expectedPack = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? @" pack=""1""" : "";
var expectedOutputContents = $@"<?xml version=""1.0"" encoding=""UTF-8"" standalone=""yes"" ?>
<bindings>
<namespace name=""ClangSharp.Test"">
<struct name=""MyUnion1"" access=""public"" layout=""Explicit"">
<struct name=""MyUnion1"" access=""public"" layout=""Explicit""{expectedPack}>
<field name=""_bitfield1"" access=""public"" offset=""0"">
<type>uint</type>
</field>
@ -240,7 +242,7 @@ union MyUnion3
</set>
</field>
</struct>
<struct name=""MyUnion3"" access=""public"" layout=""Explicit"">
<struct name=""MyUnion3"" access=""public"" layout=""Explicit""{expectedPack}>
<field name=""_bitfield"" access=""public"" offset=""0"">
<type>uint</type>
</field>

Просмотреть файл

@ -128,10 +128,12 @@ union MyUnion3
};
";
var expectedPack = RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? @" pack=""1""" : "";
var expectedOutputContents = $@"<?xml version=""1.0"" encoding=""UTF-8"" standalone=""yes"" ?>
<bindings>
<namespace name=""ClangSharp.Test"">
<struct name=""MyUnion1"" access=""public"" layout=""Explicit"">
<struct name=""MyUnion1"" access=""public"" layout=""Explicit""{expectedPack}>
<field name=""_bitfield1"" access=""public"" offset=""0"">
<type>uint</type>
</field>
@ -246,7 +248,7 @@ union MyUnion3
</set>
</field>
</struct>
<struct name=""MyUnion3"" access=""public"" layout=""Explicit"">
<struct name=""MyUnion3"" access=""public"" layout=""Explicit""{expectedPack}>
<field name=""_bitfield"" access=""public"" offset=""0"">
<type>uint</type>
</field>