Ignore:
Timestamp:
Oct 13, 2007, 2:11:22 PM (17 years ago)
Author:
イグトランス (egtra)
Message:

FormatIntegerDを実装。
UnitTestの失敗時の表示を目立つようにした。
ArrayListを名前空間System.Collectionsに入れた。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/TestCase/SimpleTestCase/SPrintFTest.ab

    r337 r355  
    22' Test case of SPrintF Function and etc...
    33'--------------------------------------------------------------------
     4
     5#require <Classes/ActiveBasic/Strings/SPrintF.ab>
    46
    57Imports ActiveBasic.Strings
     
    2123
    2224    s = FormatFloatE(9.876543e021, 6, 0, None)
    23     UnitTest("FormatFloatE(9876543e021)", s = "9.876543e021")
     25    UnitTest("FormatFloatE(9876543e+21)", s = "9.876543e+21")
    2426
    25     s = FormatFloatE(7.81250000E-003, 8, 0, Cap)
    26     UnitTest("FormatFloatE(7.81250000E-003)", s = "7.81250000E-003")
    27     /*
    28     上は、現在s = 7.81250000E-03となり失敗する。
    29     FormatIntegerDを作成していないことが要因。
    30     */
     27    s = FormatFloatE(7.81250000E-03, 8, 0, Cap)
     28    UnitTest("FormatFloatE(7.81250000E-03)", s = "7.81250000E-03")
     29
     30    s = FormatFloatE(1.2345e67, 4, 15, 0)
     31    UnitTest("FormatFloatE(1.2345e+67, field width = 15)", s = "     1.2345e+67")
     32    s = FormatFloatE(1.2345e67, 4, 15, Zero)
     33    UnitTest("FormatFloatE(1.2345e+67, field width = 15, Zero)", s = "000001.2345e+67")
     34    s = FormatFloatE(-1.2345e67, 4, 15, 0)
     35    UnitTest("FormatFloatE(-1.2345e+67, field width = 15)", s = "    -1.2345e+67")
     36    s = FormatFloatE(-1.2345e67, 4, 15, Zero)
     37    UnitTest("FormatFloatE(-1.2345e+67, field width = 15, Zero)", s = "-00001.2345e+67")
     38    s = FormatFloatE(1.2345e67, 4, 15, Sign)
     39    UnitTest("FormatFloatE(1.2345e+67, field width = 15, Sign)", s = "    +1.2345e+67")
     40    s = FormatFloatE(1.2345e67, 4, 15, Zero Or Sign)
     41    UnitTest("FormatFloatE(1.2345e+67, field width = 15, Zero Or Sign)", s = "+00001.2345e+67")
     42    s = FormatFloatE(1.2345e67, 4, 15, Zero Or Blank)
     43    UnitTest("FormatFloatE(1.2345e+67, field width = 15, Zero Or Blank)", s = " 00001.2345e+67")
     44    s = FormatFloatE(-1.2345e67, 4, 15, Zero Or Sign)
     45    UnitTest("FormatFloatE(-1.2345e+67, field width = 15, Zero Or Sign)", s = "-00001.2345e+67")
     46    s = FormatFloatE(-1.2345e67, 4, 15, Zero Or Blank)
     47    UnitTest("FormatFloatE(-1.2345e+67, field width = 15, Zero Or Blank)", s = "-00001.2345e+67")
     48
     49    s = FormatFloatE(1.2345e+67, 4, 0, Cap)
     50    UnitTest("FormatFloatE(1.2345E+67, Cap)", s = "1.2345E+67")
     51
     52    s = FormatFloatE(1.2345e67, 3, 0, None)
     53    UnitTest("FormatFloatE(1.2345e+67, precision = 3)", s = "1.234e+67")
     54
    3155
    3256    s = FormatIntegerU(777, 0, 0, None)
     
    3458
    3559    s = FormatIntegerU(513, 0, 5, None)
    36     UnitTest("FormatIntegerU(513, Field size = 5)", s = "  513")
     60    UnitTest("FormatIntegerU(513, field width = 5)", s = "  513")
     61
     62    s = FormatIntegerD(-3, 2, 0, Sign)
     63    UnitTest("FormatIntegerD(-3, precision = 2)", s = "-03")
     64
     65    s = FormatIntegerD(3, 0, 5, Sign)
     66    UnitTest("FormatIntegerD(+3, field width = 5)", s = "   +3")
     67
     68'   s = FormatIntegerLU(8589934590, DWORD_MAX, 0, None)
     69'   UnitTest("FormatIntegerLU(8589934590)", s = "8589934590")
     70
     71   
    3772
    3873End Sub
Note: See TracChangeset for help on using the changeset viewer.