summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorThomas Arnhold <thomas@arnhold.org>2014-05-13 06:06:54 +0200
committerThomas Arnhold <thomas@arnhold.org>2014-05-13 06:08:05 +0200
commita5b93782a18a2ddb6dee4033a578d919b10b6964 (patch)
tree32c8b312c1dbb988361a84f8c4c2e272c9bbe6a3 /basic
parent876a54067cf9c70c1462c6694591365a863363bd (diff)
basic: update descriptions and add some more tests
Change-Id: Ice829c70482171bbfc22719e4b9e30c5ac058f5e
Diffstat (limited to 'basic')
-rw-r--r--basic/qa/vba_tests/cdec.vb26
1 files changed, 20 insertions, 6 deletions
diff --git a/basic/qa/vba_tests/cdec.vb b/basic/qa/vba_tests/cdec.vb
index 50757de1c05c..3ed82b33ac90 100644
--- a/basic/qa/vba_tests/cdec.vb
+++ b/basic/qa/vba_tests/cdec.vb
@@ -25,24 +25,38 @@ Function verify_testCDec() as String
On Error GoTo errorHandler
ret = CDec("")
- TestLog_ASSERT ret = 0, "Converts the string to uppercase characters:" & ret
+ TestLog_ASSERT ret = 0, "Empty string test:" & ret
ret = CDec("1234")
- TestLog_ASSERT ret = "1234", "Converts the string to uppercase characters:" & ret
+ TestLog_ASSERT ret = 1234, "Simple number:" & ret
ret = CDec(" 1234 ")
- TestLog_ASSERT ret = 1234, "Converts the string to uppercase characters:" & ret
+ TestLog_ASSERT ret = 1234, "Simple number with whitespaces:" & ret
+
+ ret = CDec("-1234")
+ TestLog_ASSERT ret = -1234, "Simple negative number:" & ret
+
+ ret = CDec(" - 1234 ")
+ TestLog_ASSERT ret = -1234, "Simple negative number with whitespaces:" & ret
'''''''''''''''
' Those are erroneous, see i#64348
ret = CDec("1234-")
- TestLog_ASSERT ret = -1234, "Converts the string to uppercase characters:" & ret
+ TestLog_ASSERT ret = -1234, "Wrong negative number1:" & ret
ret = CDec(" 1234 -")
- TestLog_ASSERT ret = -1234, "Converts the string to uppercase characters:" & ret
+ TestLog_ASSERT ret = -1234, "Wrong negative number2:" & ret
+
+ 'ret = CDec("79228162514264300000000000001")
+ 'TestLog_ASSERT ret = 79228162514264300000000000001, "Very long number1:" & ret
+ 'ret = ret+1
+ 'TestLog_ASSERT ret = 79228162514264300000000000002, "Very long number2:" & ret
ret = CDec("79228162514264400000000000000")
- TestLog_ASSERT ret = 62406456049664, "Converts the string to uppercase characters:" & ret
+ TestLog_ASSERT ret = 62406456049664, "Very long number3:" & ret
+
+ ret = CDec("79228162514264340000000000000") ' gives zero
+ TestLog_ASSERT ret = 0, "Very long number4:" & ret
result = result & Chr$(10) & "Tests passed: " & passCount & Chr$(10) & "Tests failed: " & failCount & Chr$(10)
verify_testCDec = result