Home » U++ Library support » U++ Core » [BUG #1855, + PATCH] FormatIntAlpha oes not always give the right results.
[BUG #1855, + PATCH] FormatIntAlpha oes not always give the right results. [message #49693] |
Wed, 04 April 2018 14:17  |
omari
Messages: 276 Registered: March 2010
|
Experienced Member |
|
|
Test Case:
void TestFormatIntAlpha()
{
ASSERT(FormatIntAlpha(1) == "A");
ASSERT(FormatIntAlpha(2) == "B");
ASSERT(FormatIntAlpha(3) == "C");
ASSERT(FormatIntAlpha(25) == "Y");
ASSERT(FormatIntAlpha(26) == "Z"); // 26*1
ASSERT(FormatIntAlpha(27) == "AA");
ASSERT(FormatIntAlpha(51) == "AY");
ASSERT(FormatIntAlpha(52) == "AZ"); // 26*2
ASSERT(FormatIntAlpha(53) == "BA");
ASSERT(FormatIntAlpha(78) == "BZ"); // 26*3
ASSERT(FormatIntAlpha(26*26) == "YZ");
ASSERT(FormatIntAlpha(26*26 + 1) == "ZA");
ASSERT(FormatIntAlpha(26*26 + 26 - 1) == "ZY");
ASSERT(FormatIntAlpha(26*26 + 26) == "ZZ");
ASSERT(FormatIntAlpha(26*26 + 26+1) == "AAA");
ASSERT(FormatIntAlpha(26*26 + 26+2) == "AAB");
ASSERT(FormatIntAlpha(26*26 + 26+3) == "AAC");
ASSERT(FormatIntAlpha(26*26 + 26+26) == "AAZ");
ASSERT(FormatIntAlpha(26*26 + 26+26 + 1) == "ABA");
}
regards
omari.
|
|
|
|
Goto Forum:
Current Time: Sun May 11 15:26:25 CEST 2025
Total time taken to generate the page: 0.02514 seconds
|