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

Mike Kaganski mike.kaganski at collabora.com
Mon Jul 2 04:35:04 UTC 2018


 basic/qa/cppunit/test_vba.cxx |   26 ++++++++++++--------------
 1 file changed, 12 insertions(+), 14 deletions(-)

New commits:
commit 59d53910de13acfc2070e6240b936806af35c0a5
Author: Mike Kaganski <mike.kaganski at collabora.com>
Date:   Mon Jul 2 04:30:26 2018 +0200

    Small cleanup and simplification
    
    Change-Id: I1e8a750832f365f080f6f60c81560dc942003049
    Reviewed-on: https://gerrit.libreoffice.org/56788
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>

diff --git a/basic/qa/cppunit/test_vba.cxx b/basic/qa/cppunit/test_vba.cxx
index 24a65d02688f..9fea8e0dc064 100644
--- a/basic/qa/cppunit/test_vba.cxx
+++ b/basic/qa/cppunit/test_vba.cxx
@@ -156,13 +156,12 @@ void VBATest::testMiscVBAFunctions()
         MacroSnippet myMacro;
         myMacro.LoadSourceFromFile( sMacroURL );
         SbxVariableRef pReturn = myMacro.Run();
-        if ( pReturn.is() )
-        {
-            fprintf(stderr, "macro result for %s\n", macroSource[ i ] );
-            fprintf(stderr, "macro returned:\n%s\n", OUStringToOString( pReturn->GetOUString(), RTL_TEXTENCODING_UTF8 ).getStr() );
-        }
-        CPPUNIT_ASSERT_MESSAGE("No return variable huh?", pReturn.get() != nullptr );
-        CPPUNIT_ASSERT_EQUAL_MESSAGE("Result not as expected", OUString("OK"), pReturn->GetOUString() );
+        CPPUNIT_ASSERT_MESSAGE("No return variable huh?", pReturn.is());
+        fprintf(stderr, "macro result for %s\n", macroSource[i]);
+        fprintf(stderr, "macro returned:\n%s\n",
+                OUStringToOString(pReturn->GetOUString(), RTL_TEXTENCODING_UTF8).getStr());
+        CPPUNIT_ASSERT_EQUAL_MESSAGE("Result not as expected", OUString("OK"),
+                                     pReturn->GetOUString());
     }
 }
 
@@ -234,13 +233,12 @@ void VBATest::testMiscOLEStuff()
         MacroSnippet myMacro;
         myMacro.LoadSourceFromFile( sMacroURL );
         SbxVariableRef pReturn = myMacro.Run( aArgs );
-        if ( pReturn.is() )
-        {
-            fprintf(stderr, "macro result for %s\n", macroSource[ i ] );
-            fprintf(stderr, "macro returned:\n%s\n", OUStringToOString( pReturn->GetOUString(), RTL_TEXTENCODING_UTF8 ).getStr() );
-        }
-        CPPUNIT_ASSERT_MESSAGE("No return variable huh?", pReturn.get() != nullptr );
-        CPPUNIT_ASSERT_EQUAL_MESSAGE("Result not as expected", OUString("OK"), pReturn->GetOUString() );
+        CPPUNIT_ASSERT_MESSAGE("No return variable huh?", pReturn.is());
+        fprintf(stderr, "macro result for %s\n", macroSource[i]);
+        fprintf(stderr, "macro returned:\n%s\n",
+                OUStringToOString(pReturn->GetOUString(), RTL_TEXTENCODING_UTF8).getStr());
+        CPPUNIT_ASSERT_EQUAL_MESSAGE("Result not as expected", OUString("OK"),
+                                     pReturn->GetOUString());
     }
 #else
     // Avoid "this method is empty and should be removed" warning


More information about the Libreoffice-commits mailing list