- Timestamp:
- Sep 23, 2008, 10:49:35 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/ab5.0/ablib/TestCase/SimpleTestCase/SimpleTestCase.ab
r545 r632 2 2 3 3 #console 4 5 Dim hStdOut = _System_hConsoleOut6 4 7 5 Function GetTempDirectory() As String … … 28 26 'Initialize() 29 27 30 Dim csbi As CONSOLE_SCREEN_BUFFER_INFO31 GetConsoleScreenBufferInfo(hStdOut, csbi) 28 Dim prevBackColor = System.Console.BackgroundColor 29 Dim prevForeColor = System.Console.ForegroundColor 32 30 33 31 #include "SimpleTestCase.idx" 34 32 33 Imports System 34 35 35 Dim failureCount = 0 As DWord 36 37 Sub SetFailureColor() 38 Console.BackgroundColor = ConsoleColor.Yellow 39 Console.ForegroundColor = ConsoleColor.Black 40 End Sub 36 41 37 42 Sub UnitTest( msg As String, isSuccessful As Boolean ) … … 45 50 46 51 If Not isSuccessful Then 47 Set ConsoleTextAttribute(hStdOut, BACKGROUND_RED Or BACKGROUND_GREEN Or BACKGROUND_INTENSITY)52 SetFailureColor() 48 53 End If 49 54 … … 51 56 52 57 If Not isSuccessful Then 53 SetConsoleTextAttribute(hStdOut, csbi.wAttributes)58 Console.ResetColor() 54 59 End If 55 60 End Sub … … 59 64 Print Ex"OK "; msg 60 65 Else 61 Set ConsoleTextAttribute(hStdOut, BACKGROUND_RED Or BACKGROUND_GREEN Or BACKGROUND_INTENSITY)66 SetFailureColor() 62 67 Print Ex"FAILURE!"; msg 63 68 Print " 期待 = '" + expectation + "'" + " 結果 = '" + test + "'" 64 SetConsoleTextAttribute(hStdOut, csbi.wAttributes)69 Console.ResetColor() 65 70 failureCount++ 66 71 End If
Note:
See TracChangeset
for help on using the changeset viewer.