Kaydet (Commit) 1da0c806 authored tarafından Eike Rathke's avatar Eike Rathke

remove trailing blanks rubbish

Change-Id: I97cee7ea1d63375b73f0d4003022e9f09ad38e5f
üst 68495ab3
......@@ -30,24 +30,24 @@ Function verify_ByteArrayString() As String
Dim x() As Byte
Dim count As Integer
testName = "Test the conversion between bytearray and string"
On Error GoTo errorHandler
MyString = "abc"
x = MyString ' string -> byte array
result = "Test Results" & Chr$(10) & "============" & Chr$(10)
count = UBound(x) ' 6 byte
' test bytes in string
result = result + updateResultString("test1 numbytes ", (count), 5)
MyString = x 'byte array -> string
result = result + updateResultString("test assign byte array to string", MyString, "abc")
result = result & Chr$(10) & "Tests passed: " & passCount & Chr$(10) & "Tests failed: " & failCount & Chr$(10)
verify_ByteArrayString = result
Exit Function
......
......@@ -26,9 +26,9 @@ Function verify_testDateSerial() as String
testName = "Test DateSerial function"
date2 = 36326
On Error GoTo errorHandler
date1 = DateSerial(1999, 6, 15) '6/15/1999
TestLog_ASSERT date1 = date2, "the return date is: " & date1
date1 = DateSerial(2000, 1 - 7, 15) '6/15/1999
......@@ -36,7 +36,7 @@ Function verify_testDateSerial() as String
date1 = DateSerial(1999, 1, 166) '6/15/1999
TestLog_ASSERT date1 = date2, "the return date is: " & date1
result = result & Chr$(10) & "Tests passed: " & passCount & Chr$(10) & "Tests failed: " & failCount & Chr$(10)
verify_testDateSerial = result
Exit Function
......@@ -60,6 +60,6 @@ Sub TestLog_ASSERT(assertion As Boolean, Optional testId As String, Optional tes
result = result & Chr$(10) & " Failed: " & testMsg
failCount = failCount + 1
End If
End Sub
This diff is collapsed.
......@@ -17,13 +17,13 @@ objCmd.ActiveConnection = cn
If objCmd.ActiveConnection.CommandTimeout <> modifiedTimeout Then
Rem if we copied the object by reference then we should have the
Rem modified timeout ( because we should be just pointing as cn )
doUnitTest = "FAIL expected modified timeout " & modifiedTimeout & " but got " & objCmd.ActiveConnection.CommandTimeout
doUnitTest = "FAIL expected modified timeout " & modifiedTimeout & " but got " & objCmd.ActiveConnection.CommandTimeout
Exit Function
End If
cn.CommandTimeout = origTimeout ' restore timeout
Rem Double check objCmd.ActiveConnection is pointing to objCmd.ActiveConnection
If objCmd.ActiveConnection.CommandTimeout <> origTimeout Then
doUnitTest = "FAIL expected orignal timeout " & origTimeout & " but got " & objCmd.ActiveConnection.CommandTimeout
doUnitTest = "FAIL expected orignal timeout " & origTimeout & " but got " & objCmd.ActiveConnection.CommandTimeout
Exit Function
End If
doUnitTest = "OK" ' no error
......
......@@ -24,23 +24,23 @@ Function verify_testPartition() as String
Dim retStr As String
testName = "Test Partition function"
On Error GoTo errorHandler
retStr = Partition(20, 0, 98, 5)
'MsgBox retStr
TestLog_ASSERT retStr = "20:24", "the number 20 occurs in the range:" & retStr
retStr = Partition(20, 0, 99, 1)
'MsgBox retStr
TestLog_ASSERT retStr = " 20: 20", "the number 20 occurs in the range:" & retStr
retStr = Partition(120, 0, 99, 5)
'MsgBox retStr
TestLog_ASSERT retStr = "100: ", "the number 120 occurs in the range:" & retStr
retStr = Partition(-5, 0, 99, 5)
'MsgBox retStr
TestLog_ASSERT retStr = " : -1", "the number -5 occurs in the range:" & retStr
retStr = Partition(2, 0, 5, 2)
'MsgBox retStr
TestLog_ASSERT retStr = " 2: 3", "the number 2 occurs in the range:" & retStr
......@@ -67,5 +67,5 @@ Sub TestLog_ASSERT(assertion As Boolean, Optional testId As String, Optional tes
result = result & Chr$(10) & " Failed: " & testMsg
failCount = failCount + 1
End If
End Sub
......@@ -44,7 +44,7 @@ Function verify_testReplace() as String
TestLog_ASSERT retStr = "abcbcdBc", "start = 1, count = 0, not support in Unix: " & retStr
result = result & Chr$(10) & "Tests passed: " & passCount & Chr$(10) & "Tests failed: " & failCount & Chr$(10)
verify_testReplace = result
Exit Function
errorHandler:
TestLog_ASSERT (False), testName & ": hit error handler"
......@@ -66,5 +66,5 @@ Sub TestLog_ASSERT(assertion As Boolean, Optional testId As String, Optional tes
result = result & Chr$(10) & " Failed: " & testMsg
failCount = failCount + 1
End If
End Sub
......@@ -25,43 +25,43 @@ Function verify_testStrConv() as String
srcStr = "abc EFG hij"
testName = "Test StrConv function"
On Error GoTo errorHandler
retStr = StrConv(srcStr, vbUpperCase)
'MsgBox retStr
TestLog_ASSERT retStr = "ABC EFG HIJ", "Converts the string to uppercase characters:" & retStr
retStr = StrConv(srcStr, vbLowerCase)
'MsgBox retStr
TestLog_ASSERT retStr = "abc efg hij", "Converts the string to lowercase characters:" & retStr
retStr = StrConv(srcStr, vbProperCase)
'MsgBox retStr
TestLog_ASSERT retStr = "Abc Efg Hij", "Converts the first letter of every word in string to uppercase:" & retStr
'retStr = StrConv("ABCDEVB¥ì¥¹¥­¥å©`", vbWide)
'MsgBox retStr
'TestLog_ASSERT retStr = "£Á£Â£Ã£Ä£ÅVB¥ì¥¹¥­¥å©`", "Converts narrow (single-byte) characters in string to wide"
'retStr = StrConv("£Á£Â£Ã£Ä£ÅVB¥ì¥¹¥­¥å©`", vbNarrow)
'MsgBox retStr
'TestLog_ASSERT retStr = "ABCDEVB¥ì¥¹¥­¥å©`", "Converts wide (double-byte) characters in string to narrow (single-byte) characters." & retStr
'retStr = StrConv("¤Ï¤Ê¤Á¤ã¤ó", vbKatakana)
'MsgBox retStr
'TestLog_ASSERT retStr = "¥Ï¥Ê¥Á¥ã¥ó", "Converts Hiragana characters in string to Katakana characters.." & retStr
' retStr = StrConv("¥Ï¥Ê¥Á¥ã¥ó", vbHiragana)
'MsgBox retStr
' TestLog_ASSERT retStr = "¤Ï¤Ê¤Á¤ã¤ó", "Converts Katakana characters in string to Hiragana characters.." & retStr
'x = StrConv("ÉϺ£ÊÐABC", vbFromUnicode)
'MsgBox retStr
'TestLog_ASSERT UBound(x) = 8, "Converts the string from Unicode, the length is : " & UBound(x) + 1
' retStr = StrConv(x, vbUnicode)
'MsgBox retStr
' TestLog_ASSERT retStr = "ÉϺ£ÊÐABC", "Converts the string to Unicode: " & retStr
result = result & Chr$(10) & "Tests passed: " & passCount & Chr$(10) & "Tests failed: " & failCount & Chr$(10)
verify_testStrConv = result
......@@ -86,5 +86,5 @@ Sub TestLog_ASSERT(assertion As Boolean, Optional testId As String, Optional tes
result = result & Chr$(10) & " Failed: " & testMsg
failCount = failCount + 1
End If
End Sub
......@@ -30,76 +30,76 @@ Sub DSD()
Dim testName As String
testName = "double = string + double"
Dim testCompute As String
Dim s As String
Dim d As Double
Dim r As Double
On Error GoTo ErrorHandler
testCompute = "s = null, d = null, r = s + d"
r = s + d
TestLog_ASSERT r = -1, testCompute & " .The result is: " & r
testCompute = "s = null, d = null, r = s & d"
r = s & d
TestLog_ASSERT r = 0, testCompute & " .The result is: " & r
testCompute = "s = null, d = 20, r = s + d"
d = 20
r = s + d
TestLog_ASSERT r = -1, testCompute & " .The result is: " & r
testCompute = "s = null, d = 20, r = s & d"
d = 20
r = s & d
TestLog_ASSERT r = 20, testCompute & " .The result is: " & r
''''''''''''''
s = "10"
Dim d2 As Double
testCompute = "s = '10', d = null, r = s + d"
r = s + d2
TestLog_ASSERT r = 10, testCompute & " .The result is: " & r
testCompute = "s = '10', d = null, r = s & d"
r = s & d2
TestLog_ASSERT r = 100, testCompute & " .The result is: " & r
testCompute = "s = '10', d = 20, r = s + d"
d2 = 20
r = s + d2
TestLog_ASSERT r = 30, testCompute & " .The result is: " & r
testCompute = "s = '10', d = 20, r = s & d"
d2 = 20
r = s & d2
TestLog_ASSERT r = 1020, testCompute & " .The result is: " & r
''''''''''''''
s = "abc"
Dim d3 As Double
testCompute = "s = 'abc', d = null, r = s + d"
r = s + d3
TestLog_ASSERT r = -1, testCompute & " .The result is: " & r
testCompute = "s = 'abc', d = null, r = s & d"
r = s & d3
TestLog_ASSERT r = -1, testCompute & " .The result is: " & r
testCompute = "s = 'abc', d = 20, r = s + d"
d3 = 20
r = s + d3
TestLog_ASSERT r = -1, testCompute & " .The result is: " & r
testCompute = "s = 'abc', d = 20, r = s & d"
d3 = 20
r = s & d3
TestLog_ASSERT r = -1, testCompute & " .The result is: " & r
Exit Sub
ErrorHandler:
r = -1
' TestLog_Comment "The next compute raises error: " & testCompute
......@@ -111,75 +111,75 @@ Sub SSD()
Dim testName As String
testName = "string = string + double"
Dim testCompute As String
Dim s As String
Dim d As Double
Dim r As String
On Error GoTo ErrorHandler
testCompute = "s = null, d = null, r = s + d"
r = s + d
TestLog_ASSERT r = "-1", testCompute & " .The result is: " & r
testCompute = "s = null, d = null, r = s & d"
r = s & d
TestLog_ASSERT r = "0", testCompute & " .The result is: " & r
testCompute = "s = null, d = 20, r = s + d"
d = 20
r = s + d
TestLog_ASSERT r = "-1", testCompute & " .The result is: " & r
testCompute = "s = null, d = 20, r = s & d"
d = 20
r = s & d
TestLog_ASSERT r = "20", testCompute & " .The result is: " & r
''''''''''''''
s = "10"
Dim d2 As Double
testCompute = "s = '10', d = null, r = s + d"
r = s + d2
TestLog_ASSERT r = "10", testCompute & " .The result is: " & r
testCompute = "s = '10', d = null, r = s & d"
r = s & d2
TestLog_ASSERT r = "100", testCompute & " .The result is: " & r
testCompute = "s = '10', d = 20, r = s + d"
d2 = 20
r = s + d2
TestLog_ASSERT r = "30", testCompute & " .The result is: " & r
testCompute = "s = '10', d = 20, r = s & d"
d2 = 20
r = s & d2
TestLog_ASSERT r = "1020", testCompute & " .The result is: " & r
''''''''''''''
s = "abc"
Dim d3 As Double
testCompute = "s = 'abc', d = null, r = s + d"
r = s + d3
TestLog_ASSERT r = "-1", testCompute & " .The result is: " & r
testCompute = "s = 'abc', d = null, r = s & d"
r = s & d3
TestLog_ASSERT r = "abc0", testCompute & " .The result is: " & r
testCompute = "s = 'abc', d = 20, r = s + d"
d3 = 20
r = s + d3
TestLog_ASSERT r = "-1", testCompute & " .The result is: " & r
testCompute = "s = 'abc', d = 20, r = s & d"
d3 = 20
r = s & d3
TestLog_ASSERT r = "abc20", testCompute & " .The result is: " & r
Exit Sub
ErrorHandler:
r = "-1"
' TestLog_Comment "The next compute raises error: " & testCompute
......@@ -190,75 +190,75 @@ Sub DSS()
Dim testName As String
testName = "double = string + string"
Dim testCompute As String
Dim s As String
Dim d As String
Dim r As Double
On Error GoTo ErrorHandler
testCompute = "s = null, d = null, r = s + d"
r = s + d
TestLog_ASSERT r = -1, testCompute & " .The result is: " & r
testCompute = "s = null, d = null, r = s & d"
r = s & d
TestLog_ASSERT r = -1, testCompute & " .The result is: " & r
testCompute = "s = null, d = 20, r = s + d"
d = "20"
r = s + d
TestLog_ASSERT r = 20, testCompute & " .The result is: " & r
testCompute = "s = null, d = 20, r = s & d"
d = "20"
r = s & d
TestLog_ASSERT r = 20, testCompute & " .The result is: " & r
''''''''''''''
s = "10"
Dim d2 As String
testCompute = "s = '10', d = null, r = s + d"
r = s + d2
TestLog_ASSERT r = 10, testCompute & " .The result is: " & r
testCompute = "s = '10', d = null, r = s & d"
r = s & d2
TestLog_ASSERT r = 10, testCompute & " .The result is: " & r
testCompute = "s = '10', d = 20, r = s + d"
d2 = "20"
r = s + d2
TestLog_ASSERT r = 1020, testCompute & " .The result is: " & r
testCompute = "s = '10', d = 20, r = s & d"
d2 = "20"
r = s & d2
TestLog_ASSERT r = 1020, testCompute & " .The result is: " & r
''''''''''''''
s = "abc"
Dim d3 As String
testCompute = "s = 'abc', d = null, r = s + d"
r = s + d3
TestLog_ASSERT r = -1, testCompute & " .The result is: " & r
testCompute = "s = 'abc', d = null, r = s & d"
r = s & d3
TestLog_ASSERT r = -1, testCompute & " .The result is: " & r
testCompute = "s = 'abc', d = 20, r = s + d"
d3 = "20"
r = s + d3
TestLog_ASSERT r = -1, testCompute & " .The result is: " & r
testCompute = "s = 'abc', d = 20, r = s & d"
d3 = "20"
r = s & d3
TestLog_ASSERT r = -1, testCompute & " .The result is: " & r
Exit Sub
ErrorHandler:
r = -1
' TestLog_Comment "The next compute raises error: " & testCompute
......@@ -280,13 +280,13 @@ Sub testBolean()
Dim b As Boolean
Dim c As Boolean
Dim d As String
b = True
a = "1"
c = a + b ' c = false
MsgBox c
d = a + b 'd = 0
MsgBox d
End Sub
......@@ -296,16 +296,16 @@ Sub testCurrency()
Dim b As Currency
Dim c As Currency
Dim d As String
a = "10"
b = 30.3
c = a + b ' c = 40.3
MsgBox c
d = a + b ' c =40.3
MsgBox d
End Sub
Sub TestLog_ASSERT(assertion As Boolean, Optional testId As String, Optional testComment As String)
......@@ -324,5 +324,5 @@ Sub TestLog_ASSERT(assertion As Boolean, Optional testId As String, Optional tes
result = result & Chr$(10) & " Failed: " & testMsg
failCount = failCount + 1
End If
End Sub
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment