Changeset 468 for trunk/TestCase
- Timestamp:
- Mar 9, 2008, 12:00:01 PM (17 years ago)
- Location:
- trunk/TestCase/SimpleTestCase
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/TestCase/SimpleTestCase/SPrintFTest.ab
r385 r468 118 118 s = FormatFloatG(0.0000123456, 4, 0, None) 119 119 UnitTest("FormatFloatG(0.0000123456, precision = 4) = 1.234e-05", s, "1.234e-05") 120 s = FormatFloatG(ActiveBasic.Math.Detail.GetNaN(), DWORD_MAX, 0, None) 121 UnitTest(Ex"FormatFloatG(NaN) = \qnan\q", s, "nan") 122 s = FormatFloatG(ActiveBasic.Math.Detail.GetInf(False), DWORD_MAX, 0, Sign) 123 UnitTest(Ex"FormatFloatG(Inf, Sign) = \q+infinity\q", s, "+infinity") 120 124 121 125 s = FormatFloatA(1, DWORD_MAX, 0, None) … … 127 131 s = FormatFloatA(3.1415926535897932384626433832795, DWORD_MAX, 0, None) 128 132 UnitTest("FormatFloatA(π) = 0x1.921fb54442d18p+1", s, "0x1.921fb54442d18p+1") 133 s = FormatFloatA(3.1415926535897932384626433832795, 4, 0, None) 134 UnitTest("FormatFloatA(π, precision = 4) = 0x1.921fp+1", s, "0x1.921fp+1") 129 135 s = FormatFloatA(0, DWORD_MAX, 0, None) 130 136 UnitTest("FormatFloatA(0)", s, "0x0p+0") -
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() -
trunk/TestCase/SimpleTestCase/StringBuilderTest.ab
r457 r468 18 18 sb.Replace("こい", "いけ").Replace("いけ", "こい") 19 19 UnitTest("StringBuilder.Replace (String)", sb.ToString, "でてこいでてこいこいのこい") 20 sb.Length = 0 21 sb.Append(123) 22 UnitTest("StringBuilder.Append (Long)", sb.ToString, "123") 20 23 End Sub 21 24 … … 23 26 24 27 StringBuilderTest.TestMain() 25 -
trunk/TestCase/SimpleTestCase/XmlTest.ab
r465 r468 19 19 20 20 ' 書いて 21 doc.Save( tempDir + " \test.xml" )21 doc.Save( tempDir + "test.xml" ) 22 22 23 23 ' 読んで 24 24 Dim clone = New System.Xml.XmlDocument 25 clone.Load( tempDir + " \test.xml" )25 clone.Load( tempDir + "test.xml" ) 26 26 27 27 ' 比較してみる
Note:
See TracChangeset
for help on using the changeset viewer.