Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
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 Go to next message
omari is currently offline  omari
Messages: 264
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.
Re: [BUG #1855, + PATCH] FormatIntAlpha oes not always give the right results. [message #49720 is a reply to message #49693] Fri, 13 April 2018 14:20 Go to previous message
mirek is currently offline  mirek
Messages: 13975
Registered: November 2005
Ultimate Member
Thank you, applied.
Previous Topic: [BUG #1854] SegFault when calling CParser::NoSkipComments() before term initialisation
Next Topic: simple bug? passing String::GetVoid() to StringStream
Goto Forum:
  


Current Time: Sat Apr 20 01:00:28 CEST 2024

Total time taken to generate the page: 0.13488 seconds