Browse Source

Always upper-cased the first character of a function.

Signed-off-by: Dimitar Dobrev <dpldobrev@protonmail.com>
pull/787/merge
Dimitar Dobrev 9 years ago
parent
commit
dd82358a04
  1. 4
      src/Generator/Passes/RenamePass.cs
  2. 1
      tests/Common/Common.Tests.cs
  3. 4
      tests/Common/Common.cpp
  4. 2
      tests/Common/Common.h

4
src/Generator/Passes/RenamePass.cs

@ -354,8 +354,8 @@ namespace CppSharp.Passes @@ -354,8 +354,8 @@ namespace CppSharp.Passes
switch (pattern)
{
case RenameCasePattern.UpperCamelCase:
// ensure separation by not ending up with more capitals in a row than before
if (sb.Length == 1 || !char.IsUpper(sb[1]))
// ensure separation in enum items by not ending up with more capitals in a row than before
if (sb.Length == 1 || !char.IsUpper(sb[1]) || !(decl is Enumeration.Item))
sb[0] = char.ToUpperInvariant(sb[0]);
if (@class != null && @class.Type == ClassType.Interface)
sb[1] = char.ToUpperInvariant(sb[1]);

1
tests/Common/Common.Tests.cs

@ -42,6 +42,7 @@ public class CommonTests : GeneratorTestFixture @@ -42,6 +42,7 @@ public class CommonTests : GeneratorTestFixture
e = EnumWithUnderscores.CAPITALS_More;
e = EnumWithUnderscores.UsesDigits1_0;
e.GetHashCode();
Common.SMallFollowedByCapital();
#pragma warning restore 0168
#pragma warning restore 0219

4
tests/Common/Common.cpp

@ -660,3 +660,7 @@ void hasPointerParam(Foo* foo, int i) @@ -660,3 +660,7 @@ void hasPointerParam(Foo* foo, int i)
void hasPointerParam(const Foo& foo)
{
}
void sMallFollowedByCapital()
{
}

2
tests/Common/Common.h

@ -1220,3 +1220,5 @@ DLL_API void hasPointerParam(const Foo& foo); @@ -1220,3 +1220,5 @@ DLL_API void hasPointerParam(const Foo& foo);
enum EmptyEnum { };
enum __enum_with_underscores { lOWER_BEFORE_CAPITAL, CAPITALS_More, underscore_at_end_, usesDigits1_0 };
void DLL_API sMallFollowedByCapital();

Loading…
Cancel
Save