basic/qa/cppunit/basic_coverage.cxx | 7 +++---- basic/qa/cppunit/basictest.cxx | 8 ++++---- basic/qa/cppunit/test_vba.cxx | 11 +++++------ include/sal/log-areas.dox | 1 + 4 files changed, 13 insertions(+), 14 deletions(-)
New commits: commit df0db4132428e95d276e923d8d5fb603dbb7f7bb Author: sahil <gautamsahil1...@gmail.com> AuthorDate: Wed Aug 30 17:25:08 2023 +0530 Commit: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org> CommitDate: Thu Aug 31 19:50:23 2023 +0200 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.lauhakan...@libreoffice.org> Reviewed-by: Ilmari Lauhakangas <ilmari.lauhakan...@libreoffice.org> 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()); } diff --git a/include/sal/log-areas.dox b/include/sal/log-areas.dox index 275f33e1d073..646c7b3d58a2 100644 --- a/include/sal/log-areas.dox +++ b/include/sal/log-areas.dox @@ -40,6 +40,7 @@ certain functionality. @section basic @li @c basic +@li @c basic.qa @li @c basic.sbx @section bridges