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

Justin Luth justin_luth at sil.org
Tue Feb 28 02:49:59 UTC 2017


 basic/qa/cppunit/test_append.cxx |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)

New commits:
commit 56d44e10dfc54bd9296fb0cdfe5b0772022be0b4
Author: Justin Luth <justin_luth at sil.org>
Date:   Tue Feb 21 21:28:58 2017 +0300

    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 at sil.org>
    Tested-by: Justin Luth <justin_luth at sil.org>
    Reviewed-by: Markus Mohrhard <markus.mohrhard at googlemail.com>

diff --git a/basic/qa/cppunit/test_append.cxx b/basic/qa/cppunit/test_append.cxx
index 986c941..1bda71d 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);
 }


More information about the Libreoffice-commits mailing list