Skip to content

Commit 6b7c293

Browse files
committed
Finally get the ArrayParameterTransformer tests working
1 parent d4b023f commit 6b7c293

File tree

3 files changed

+36
-4
lines changed

3 files changed

+36
-4
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[NameAffix("Suffix", "KhronosVendor", "OES")]
2+
[NativeFunction("opengl", EntryPoint = "glFeedbackBufferxOES")]
3+
public static void glFeedbackBufferxOES([NativeTypeName("GLsizei")] uint n, [NativeTypeName("GLenum")] uint type, [NativeTypeName("const GLfixed *")] int* buffer)
4+
{
5+
}
6+
7+
[NameAffix("Suffix", "KhronosVendor", "OES")]
8+
[NativeFunction("opengl", EntryPoint = "glFeedbackBufferxOES")]
9+
public static void glFeedbackBufferxOES([NativeTypeName("GLenum")] uint type, [NativeTypeName("const GLfixed *")] int buffer)
10+
{
11+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
[NameAffix("Suffix", "KhronosNonVendor", "Direct")]
2+
[NativeFunction("opengl", EntryPoint = "alDeleteAuxiliaryEffectSlotsDirect")]
3+
public static void alDeleteAuxiliaryEffectSlotsDirect(ALCcontext context, [NativeTypeName("ALsizei")] int n, [NativeTypeName("const ALuint *")] uint* effectslots)
4+
{
5+
}
6+
7+
[NameAffix("Suffix", "KhronosNonVendor", "Direct")]
8+
[NativeFunction("opengl", EntryPoint = "alDeleteAuxiliaryEffectSlotsDirect")]
9+
public static void alDeleteAuxiliaryEffectSlotDirect(ALCcontext context, [NativeTypeName("const ALuint *")] uint effectslots)
10+
{
11+
}

tests/SilkTouch/SilkTouch/FunctionTransformation/ArrayParameterTransformerTests.cs

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,12 @@ public async Task SingularizeAffixedName_ShouldSingularizeBaseName()
2020
"""
2121
[NameAffix("Suffix", "KhronosNonVendor", "Direct")]
2222
[NativeFunction("opengl", EntryPoint = "alDeleteAuxiliaryEffectSlotsDirect")]
23-
public static void alDeleteAuxiliaryEffectSlotsDirect(ContextHandle context, int n, uint* effectslots) { }
23+
public static void alDeleteAuxiliaryEffectSlotsDirect(
24+
ALCcontext context,
25+
[NativeTypeName("ALsizei")] int n,
26+
[NativeTypeName("const ALuint *")] uint* effectslots)
27+
{
28+
}
2429
"""
2530
)!;
2631

@@ -44,7 +49,7 @@ public static void alDeleteAuxiliaryEffectSlotsDirect(ContextHandle context, int
4449
);
4550

4651
// "Slots" should be pluralized as "Slot"
47-
await Verify(results.Select(result => result.NormalizeWhitespace().ToString()));
52+
await Verify(string.Join("\n\n", results.Select(result => result.NormalizeWhitespace())));
4853
}
4954

5055
private class SingularizeAffixedName_ShouldSingularizeBaseName_MetadataProvider
@@ -89,7 +94,12 @@ public async Task SingularizeAffixedName_ShouldNotAffectAffix()
8994
"""
9095
[NameAffix("Suffix", "KhronosVendor", "OES")]
9196
[NativeFunction("opengl", EntryPoint = "glFeedbackBufferxOES")]
92-
public static void glFeedbackBufferxOES(uint n, uint type, int* buffer) { }
97+
public static void glFeedbackBufferxOES(
98+
[NativeTypeName("GLsizei")] uint n,
99+
[NativeTypeName("GLenum")] uint type,
100+
[NativeTypeName("const GLfixed *")] int* buffer)
101+
{
102+
}
93103
"""
94104
)!;
95105

@@ -110,7 +120,7 @@ public static void glFeedbackBufferxOES(uint n, uint type, int* buffer) { }
110120
);
111121

112122
// The "OES" suffix should not be singularized as "O"
113-
await Verify(results.Select(result => result.NormalizeWhitespace().ToString()));
123+
await Verify(string.Join("\n\n", results.Select(result => result.NormalizeWhitespace())));
114124
}
115125

116126
private class SingularizeAffixedName_ShouldNotAffectAffix_MetadataProvider

0 commit comments

Comments
 (0)