1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 100 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
10 #include <sal/config.h>
11 #include "basictest.hxx"
12 #include <basic/sberrors.hxx>
13 #include <unotest/bootstrapfixturebase.hxx>
15 CPPUNIT_TEST_FIXTURE(CppUnit::TestFixture
, testRedefineArgument
)
17 MacroSnippet
aMacro("Sub doUnitTest(argName)\n"
23 CPPUNIT_ASSERT(aMacro
.HasError());
24 CPPUNIT_ASSERT_EQUAL(ERRCODE_BASIC_VAR_DEFINED
, aMacro
.getError().StripDynamic());
27 CPPUNIT_TEST_FIXTURE(CppUnit::TestFixture
, testDoubleArgument
)
29 MacroSnippet
aMacro("Sub doUnitTest(argName, argName)\n"
32 CPPUNIT_ASSERT(aMacro
.HasError());
33 CPPUNIT_ASSERT_EQUAL(ERRCODE_BASIC_VAR_DEFINED
, aMacro
.getError().StripDynamic());
36 CPPUNIT_TEST_FIXTURE(CppUnit::TestFixture
, testTdf149157
)
38 MacroSnippet
aMacro("Function extentComment() As Integer\n"
40 " If Not extentComment Then\n"
41 " extentComment = 1\n"
45 CPPUNIT_ASSERT(!aMacro
.HasError());
48 CPPUNIT_TEST_FIXTURE(CppUnit::TestFixture
, testTdf149157_compatible
)
50 MacroSnippet
aMacro("Option Compatible\n"
51 "Function extentComment() As Integer\n"
54 " If Not extentComment Then\n"
55 " extentComment = 1\n"
59 CPPUNIT_ASSERT(!aMacro
.HasError());
62 CPPUNIT_TEST_FIXTURE(CppUnit::TestFixture
, testTdf149157_vba
)
64 MacroSnippet
aMacro("Option VBASupport 1\n"
65 "Function extentComment() As Integer\n"
68 " If Not extentComment Then\n"
69 " extentComment = 1\n"
73 CPPUNIT_ASSERT(!aMacro
.HasError());
76 CPPUNIT_TEST_FIXTURE(CppUnit::TestFixture
, testTdf149402
)
78 MacroSnippet
aMacro("Function extentComment() As Integer\n"
80 " If Not extentComment Then\n"
81 " extentComment = 1\n"
86 CPPUNIT_ASSERT(!aMacro
.HasError());
89 CPPUNIT_TEST_FIXTURE(CppUnit::TestFixture
, testTdf149402_compatible
)
91 MacroSnippet
aMacro("Option Compatible\n"
92 "Function extentComment() As Integer\n"
94 " If Not extentComment Then\n"
95 " extentComment = 1\n"
100 CPPUNIT_ASSERT(!aMacro
.HasError());
103 CPPUNIT_TEST_FIXTURE(CppUnit::TestFixture
, testTdf149402_vba
)
105 MacroSnippet
aMacro("Option VBASupport 1\n"
106 "Function extentComment() As Integer\n"
108 " If Not extentComment Then\n"
109 " extentComment = 1\n"
114 CPPUNIT_ASSERT(!aMacro
.HasError());
117 /* vim:set shiftwidth=4 softtabstop=4 expandtab cinoptions=b1,g0,N-s cinkeys+=0=break: */