diff options
author | Justin Luth <justin_luth@sil.org> | 2017-02-21 21:28:58 +0300 |
---|---|---|
committer | Markus Mohrhard <markus.mohrhard@googlemail.com> | 2017-02-28 02:49:25 +0000 |
commit | 56d44e10dfc54bd9296fb0cdfe5b0772022be0b4 (patch) | |
tree | 38b584baf7b7128c18054de30b98fc8a6b249c6c /basic/qa | |
parent | 97caa8a8a0d80baa1a77859b117a8bc2b8b952f8 (diff) |
VBA: unit test for PtrSafe and compiler directives
#If Vba7
Declare PtrSafe Function xx
#Else
Declare Function xx
#End if
Change-Id: I807efb9fa68b5ac50f2bd59ba7cfa45c499af189
Reviewed-on: https://gerrit.libreoffice.org/34522
Reviewed-by: Justin Luth <justin_luth@sil.org>
Tested-by: Justin Luth <justin_luth@sil.org>
Reviewed-by: Markus Mohrhard <markus.mohrhard@googlemail.com>
Diffstat (limited to 'basic/qa')
-rw-r--r-- | basic/qa/cppunit/test_append.cxx | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/basic/qa/cppunit/test_append.cxx b/basic/qa/cppunit/test_append.cxx index 986c94119fd7..1bda71d37287 100644 --- a/basic/qa/cppunit/test_append.cxx +++ b/basic/qa/cppunit/test_append.cxx @@ -20,12 +20,14 @@ namespace public: EnableTest() : BootstrapFixture(true, false) {}; void testDimEnable(); + void testWin64(); void testEnableRuntime(); // Adds code needed to register the test suite CPPUNIT_TEST_SUITE(EnableTest); // Declares the method as a test to call CPPUNIT_TEST(testDimEnable); + CPPUNIT_TEST(testWin64); CPPUNIT_TEST(testEnableRuntime); // End of test suite definition @@ -63,6 +65,21 @@ void EnableTest::testDimEnable() CPPUNIT_ASSERT_MESSAGE("Dim causes compile error", !myMacro.HasError() ); } +void EnableTest::testWin64() +{ + OUStringBuffer aSource1(" #If Win64\n"); + aSource1.append("Declare PtrSafe Function aht_apiGetOpenFileName Lib "); + aSource1.append('"'); + aSource1.append("comdlg32.dll"); + aSource1.append('"'); + aSource1.append("\n"); + aSource1.append("#End if\n"); + + MacroSnippet myMacro(aSource1.toString()); + myMacro.Compile(); + CPPUNIT_ASSERT_MESSAGE("#if Win64 Declare PtrSafe causes compile error", !myMacro.HasError() ); +} + // Put the test suite in the registry CPPUNIT_TEST_SUITE_REGISTRATION(EnableTest); } |