summaryrefslogtreecommitdiff
path: root/basic/qa/basic_coverage/test_tdf125637.vb
diff options
context:
space:
mode:
Diffstat (limited to 'basic/qa/basic_coverage/test_tdf125637.vb')
-rw-r--r--basic/qa/basic_coverage/test_tdf125637.vb54
1 files changed, 54 insertions, 0 deletions
diff --git a/basic/qa/basic_coverage/test_tdf125637.vb b/basic/qa/basic_coverage/test_tdf125637.vb
new file mode 100644
index 000000000000..58fd1db3b377
--- /dev/null
+++ b/basic/qa/basic_coverage/test_tdf125637.vb
@@ -0,0 +1,54 @@
+'
+' This file is part of the LibreOffice project.
+'
+' This Source Code Form is subject to the terms of the Mozilla Public
+' License, v. 2.0. If a copy of the MPL was not distributed with this
+' file, You can obtain one at http://mozilla.org/MPL/2.0/.
+'
+
+Option Explicit
+
+Dim passCount As Integer
+Dim failCount As Integer
+Dim result As String
+
+Function doUnitTest() As String
+ result = verify_tdf125637()
+ If failCount <> 0 Or passCount = 0 Then
+ doUnitTest = 0
+ Else
+ doUnitTest = 1
+ End If
+End Function
+
+Function verify_tdf125637() As String
+
+ passCount = 0
+ failCount = 0
+
+ result = "Test Results" & Chr$(10) & "============" & Chr$(10)
+
+ ' tdf#125637 - correctly hand names ending with an underscore character at the end of the line
+ Dim test As Long
+ Dim test_ As Long
+ test_ = 1234
+ test = test_
+
+ ' Without the fix in place, this test would have failed with:
+ ' - Expected: 1234
+ ' - Actual : 0
+ TestLog_ASSERT test, 1234, "Assignment of the variable failed (tdf#125637)"
+
+ result = result & Chr$(10) & "Tests passed: " & passCount & Chr$(10) & "Tests failed: " & failCount & Chr$(10)
+ verify_tdf125637 = result
+
+End Function
+
+Sub TestLog_ASSERT(actual As Variant, expected As Variant, testName As String)
+ If expected = actual Then
+ passCount = passCount + 1
+ Else
+ result = result & Chr$(10) & "Failed: " & testName & " returned " & actual & ", expected " & expected
+ failCount = failCount + 1
+ End If
+End Sub