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

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

Location:
trunk/TestCase/SimpleTestCase
Files:
4 edited

Legend:

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

    r352 r355  
     1/*
    12Namespace DelegateTest
    23
     
    9697
    9798DelegateTest.TestMain()
     99*/
  • 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
  • trunk/TestCase/SimpleTestCase/SimpleTestCase.ab

    r236 r355  
    22
    33#console
     4
     5Dim hStdOut = _System_hConsoleOut
     6
     7Dim csbi As CONSOLE_SCREEN_BUFFER_INFO
     8GetConsoleScreenBufferInfo(hStdOut, csbi)
     9
    410#include "SimpleTestCase.idx"
    511
     
    713    Dim resultStr As String
    814    If isSuccessful Then
    9         resultStr = Ex"OK\t"
     15        resultStr = Ex"OK      "
    1016    Else
    1117        resultStr = Ex"FAILURE!"
    1218    End If
    1319
    14     Print resultStr, msg
     20    If Not isSuccessful Then
     21        SetConsoleTextAttribute(hStdOut, BACKGROUND_RED Or BACKGROUND_GREEN Or BACKGROUND_INTENSITY)
     22    End If
     23
     24    Print resultStr; msg
     25
     26    If Not isSuccessful Then
     27        SetConsoleTextAttribute(hStdOut, csbi.wAttributes)
     28    End If
    1529End Function
    1630
  • trunk/TestCase/SimpleTestCase/SimpleTestCase.pj

    r352 r355  
    77#NAME=SimpleTestCase
    88
    9 #PLATFORM=64
     9#PLATFORM=32
    1010
    1111#USEWINDOW=0
Note: See TracChangeset for help on using the changeset viewer.