[Libreoffice-commits] core.git: core/basic

LibreOfficiant (via logerrit) logerrit at kemper.freedesktop.org
Fri Nov 29 04:56:13 UTC 2019


 core/basic/qa/basic_coverage/test_For_loops.vb |   28 +++++++++++++++++++++++++
 1 file changed, 28 insertions(+)

New commits:
commit 1dd1b76bc1c6ca249bd2b3c605de642f0761072d
Author:     LibreOfficiant <LibreOfficiant at sfr.fr>
AuthorDate: Wed Nov 27 18:48:02 2019 +0200
Commit:     Mike Kaganski <mike.kaganski at collabora.com>
CommitDate: Fri Nov 29 05:55:22 2019 +0100

    tdf#128655 LibO Basic For loops variations
    
    2 variations of FOR loops exist. 1st form is missing in local/online
    help. This test case seems necessary prior to update help doc.
    
    Change-Id: Ic4ba8a7dc0e1ce5ad1e62dfcf2ce570016f7e117
    Reviewed-on: https://gerrit.libreoffice.org/83931
    Reviewed-by: LibreOfficiant <LibreOfficiant at sfr.fr>
    Reviewed-by: <andreas.heinisch at yahoo.de>
    Reviewed-by: himajin100000 <himajin100000 at gmail.com>
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
    Tested-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/core/basic/qa/basic_coverage/test_For_loops.vb b/core/basic/qa/basic_coverage/test_For_loops.vb
new file mode 100644
index 000000000000..2bd4e432cab6
--- /dev/null
+++ b/core/basic/qa/basic_coverage/test_For_loops.vb
@@ -0,0 +1,28 @@
+'
+' 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/.
+'
+
+Function doUnitTest
+  Dim s1 As Integer, s2 As Integer, value As Integer
+
+  ' FOR EACH
+  numbers = Array(3,4,5,6,7,8,9,10,11)
+  For Each value in numbers
+    s1 = s1 + value
+  Next value
+
+  ' FOR .. TO .. STEP ..
+  For value = 5 To 21 Step 3
+    s2 = s2 + value
+  Next value
+
+  If s1<>9*7 Or s2<>3*25 Then
+    doUnitTest = 0
+  Else
+    doUnitTest = 1 'Ok
+  End If
+End Function
\ No newline at end of file


More information about the Libreoffice-commits mailing list