Changeset 468 for trunk/TestCase/SimpleTestCase/SimpleTestCase.ab
- Timestamp:
- Mar 9, 2008, 12:00:01 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/TestCase/SimpleTestCase/SimpleTestCase.ab
r465 r468 5 5 Dim hStdOut = _System_hConsoleOut 6 6 7 Function GetTempDirectory() As String 8 Return System.IO.Path.GetDirectoryName( System.Windows.Forms.Application.ExecutablePath ) + "\temp\" 9 ' Return System.IO.Path.GetTempPath() 10 End Function 11 7 12 Sub Initialize() 8 13 ' 初期化関数 9 14 10 15 ' 一時ディレクトリを空にしておく 11 Dim tempDir = System.IO.Path.GetDirectoryName( System.Windows.Forms.Application.ExecutablePath ) + "\temp"16 Dim tempDir = GetTempDirectory() 12 17 If System.IO.Directory.Exists( tempDir ) Then 13 ' 存在するときは一旦消す 14 System.IO.Directory.Delete( tempDir, True ) 18 Try 19 ' 存在するときは一旦消す 20 System.IO.Directory.Delete( tempDir, True ) 21 Catch e As System.IO.IOException 22 OutputDebugString(e.ToString) 23 End Try 15 24 End If 16 25 System.IO.Directory.CreateDirectory( tempDir ) … … 24 33 #include "SimpleTestCase.idx" 25 34 35 Dim failureCount = 0 As DWord 36 26 37 Sub UnitTest( msg As String, isSuccessful As Boolean ) 27 38 Dim resultStr = Nothing As String … … 30 41 Else 31 42 resultStr = Ex"FAILURE!" 43 failureCount++ 32 44 End If 33 45 … … 49 61 SetConsoleTextAttribute(hStdOut, BACKGROUND_RED Or BACKGROUND_GREEN Or BACKGROUND_INTENSITY) 50 62 Print Ex"FAILURE!"; msg 51 Print " test string= '" + test + "'"63 Print " 期待 = '" + expectation + "'" + " 結果 = '" + test + "'" 52 64 SetConsoleTextAttribute(hStdOut, csbi.wAttributes) 65 failureCount++ 53 66 End If 54 67 End Sub 55 68 56 69 Function GetExclusiveTempDirPath( testCaseName As String ) As String 57 Dim tempDir = System.IO.Path.GetDirectoryName( System.Windows.Forms.Application.ExecutablePath ) + "\temp"58 Dim exclusiveTempDirPath = tempDir + "\" +testCaseName70 Dim tempDir = GetTempDirectory() 71 Dim exclusiveTempDirPath = tempDir + testCaseName 59 72 60 73 If Not System.IO.Directory.Exists( exclusiveTempDirPath ) Then … … 66 79 End Function 67 80 81 Print "失敗"; failureCount; "個" 68 82 Print "Please Enter key" 69 83 System.Console.ReadLine()
Note:
See TracChangeset
for help on using the changeset viewer.