summaryrefslogtreecommitdiff
path: root/basic
diff options
context:
space:
mode:
authorsahil <gautamsahil1947@gmail.com>2023-08-30 17:25:08 +0530
committerIlmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>2023-08-31 19:50:23 +0200
commitdf0db4132428e95d276e923d8d5fb603dbb7f7bb (patch)
treea3835bee2b1fad3b663967490151519b09d27766 /basic
parentdec20ed5e833801f70f4138a47fb0f09f006f963 (diff)
tdf#130924 replace '*printf' with 'SAL_*' logging macros.
Change-Id: I5bb4052ded82c355f7d71e4f38ebdefe3fcc25da Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156283 Tested-by: Jenkins Tested-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org> Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakangas@libreoffice.org>
Diffstat (limited to 'basic')
-rw-r--r--basic/qa/cppunit/basic_coverage.cxx7
-rw-r--r--basic/qa/cppunit/basictest.cxx8
-rw-r--r--basic/qa/cppunit/test_vba.cxx11
3 files changed, 12 insertions, 14 deletions
diff --git a/basic/qa/cppunit/basic_coverage.cxx b/basic/qa/cppunit/basic_coverage.cxx
index 0f0722917232..ee36f2d1309f 100644
--- a/basic/qa/cppunit/basic_coverage.cxx
+++ b/basic/qa/cppunit/basic_coverage.cxx
@@ -81,16 +81,15 @@ void Coverage::process_directory(const OUString& sDirName)
testMacro.LoadSourceFromFile("TestModule", sFileURL);
SbxVariableRef pReturn = testMacro.Run();
CPPUNIT_ASSERT_MESSAGE("No return variable huh?", pReturn.is());
- fprintf(stderr, "macro result for %s\n", OUStringToOString(sFileURL,RTL_TEXTENCODING_UTF8).getStr());
- fprintf(stderr, "macro returned:\n%s\n",
- OUStringToOString(pReturn->GetOUString(), RTL_TEXTENCODING_UTF8).getStr());
+ SAL_INFO("basic.qa", "macro result for " << sFileURL);
+ SAL_INFO("basic.qa", "macro returned:\n" << pReturn->GetOUString());
CPPUNIT_ASSERT_EQUAL_MESSAGE("Result not as expected", OUString("OK"),
pReturn->GetOUString());
}
}
}
}
- fprintf(stderr,"end process directory\n");
+ SAL_INFO("basic.qa", "end process directory");
}
void Coverage::Coverage_Iterator()
diff --git a/basic/qa/cppunit/basictest.cxx b/basic/qa/cppunit/basictest.cxx
index 8cf9812d5212..ebf39635620a 100644
--- a/basic/qa/cppunit/basictest.cxx
+++ b/basic/qa/cppunit/basictest.cxx
@@ -7,6 +7,7 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
+#include <sal/log.hxx>
#include "basictest.hxx"
#include <cppunit/plugin/TestPlugIn.h>
#include <basic/sbstar.hxx>
@@ -42,7 +43,7 @@ MacroSnippet::MacroSnippet()
void MacroSnippet::LoadSourceFromFile(const OUString& sModuleName, const OUString& sMacroFileURL)
{
OUString sSource;
- fprintf(stderr,"loadSource opening macro file %s\n", OUStringToOString( sMacroFileURL, RTL_TEXTENCODING_UTF8 ).getStr() );
+ SAL_INFO("basic.qa", "loadSource opening macro file" << sMacroFileURL);
osl::File aFile(sMacroFileURL);
if(aFile.open(osl_File_OpenFlag_Read) == osl::FileBase::E_None)
@@ -112,9 +113,8 @@ const ErrCode& MacroSnippet::getError() const { return maErrCode; }
IMPL_LINK( MacroSnippet, BasicErrorHdl, StarBASIC *, /*pBasic*/, bool)
{
- fprintf(stderr,"(%d:%d)\n",
- StarBASIC::GetLine(), StarBASIC::GetCol1());
- fprintf(stderr,"Basic error: %s\n", OUStringToOString( StarBASIC::GetErrorText(), RTL_TEXTENCODING_UTF8 ).getStr() );
+ SAL_INFO("basic.qa", '(' << StarBASIC::GetLine() << ':' << StarBASIC::GetCol1() << ")");
+ SAL_INFO("basic.qa", "Basic error: " << StarBASIC::GetErrorText());
mbError = true;
maErrCode = StarBASIC::GetErrorCode();
return false;
diff --git a/basic/qa/cppunit/test_vba.cxx b/basic/qa/cppunit/test_vba.cxx
index 8a15ba7234e8..a95e2db6a7bd 100644
--- a/basic/qa/cppunit/test_vba.cxx
+++ b/basic/qa/cppunit/test_vba.cxx
@@ -6,6 +6,7 @@
* 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/.
*/
+#include <sal/log.hxx>
#include "basictest.hxx"
#include <unotools/syslocaleoptions.hxx>
@@ -168,9 +169,8 @@ void VBATest::testMiscVBAFunctions()
myMacro.LoadSourceFromFile("TestModule", sMacroURL);
SbxVariableRef pReturn = myMacro.Run();
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());
+ SAL_INFO("basic.qa", "macro result for" << macroSource[i]);
+ SAL_INFO("basic.qa", "macro returned:\n" << pReturn->GetOUString());
CPPUNIT_ASSERT_EQUAL_MESSAGE("Result not as expected", OUString("OK"),
pReturn->GetOUString());
}
@@ -248,9 +248,8 @@ void VBATest::testMiscOLEStuff()
myMacro.LoadSourceFromFile("TestModule", sMacroURL);
SbxVariableRef pReturn = myMacro.Run( aArgs );
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());
+ SAL_INFO("basic.qa", "macro result for" << macroSource[i]);
+ SAL_INFO("basic.qa", "macro returned:\n" << pReturn->GetOUString());
CPPUNIT_ASSERT_EQUAL_MESSAGE("Result not as expected", OUString("OK"),
pReturn->GetOUString());
}