Bug #1855

FormatIntAlpha does not always give the right results.

Added by Abdelghani Omari about 6 years ago. Updated almost 6 years ago.

Status:ApprovedStart date:03/07/2018
Priority:NormalDue date:
Assignee:Miroslav Fidler% Done:

0%

Category:CoreSpent time:-
Target version:Release 2019.1

Description

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");
}

Format.cpp.patch Magnifier (581 Bytes) Abdelghani Omari, 03/08/2018 11:49 AM

History

#1 Updated by Abdelghani Omari about 6 years ago

after more reflections, I propose this new patch :

#2 Updated by Abdelghani Omari about 6 years ago

  • File deleted (Format.cpp.patch)

#3 Updated by Abdelghani Omari about 6 years ago

  • Target version set to Release 2018.1

#4 Updated by Zbigniew Rebacz about 6 years ago

  • Target version changed from Release 2018.1 to Release 2019.1

#5 Updated by Abdelghani Omari about 6 years ago

  • Description updated (diff)

#6 Updated by Abdelghani Omari almost 6 years ago

  • Status changed from Patch ready to Approved

Also available in: Atom PDF