[Libreoffice-commits] core.git: basic/qa include/sal
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, 14 insertions(+), 13 deletions(-) New commits: commit 115c8b42b8db7882f3e10e7ff1ef2f48d3ef973c Author: Ilmari Lauhakangas AuthorDate: Sun Sep 3 13:33:13 2023 +0300 Commit: Ilmari Lauhakangas CommitDate: Sun Sep 3 13:22:55 2023 +0200 Revert "tdf#130924 replace '*printf' with 'SAL_*' logging macros." My mistake, did not notice https://bugs.documentfoundation.org/show_bug.cgi?id=130924#c5 We shouldn't hide test output. This reverts commit df0db4132428e95d276e923d8d5fb603dbb7f7bb. Change-Id: Ieac40effb5722f8db8ead093a83765d17a09 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/156479 Tested-by: Jenkins Tested-by: Ilmari Lauhakangas Reviewed-by: Ilmari Lauhakangas diff --git a/basic/qa/cppunit/basic_coverage.cxx b/basic/qa/cppunit/basic_coverage.cxx index ee36f2d1309f..0f0722917232 100644 --- a/basic/qa/cppunit/basic_coverage.cxx +++ b/basic/qa/cppunit/basic_coverage.cxx @@ -81,15 +81,16 @@ void Coverage::process_directory(const OUString& sDirName) testMacro.LoadSourceFromFile("TestModule", sFileURL); SbxVariableRef pReturn = testMacro.Run(); CPPUNIT_ASSERT_MESSAGE("No return variable huh?", pReturn.is()); -SAL_INFO("basic.qa", "macro result for " << sFileURL); -SAL_INFO("basic.qa", "macro returned:\n" << pReturn->GetOUString()); +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()); CPPUNIT_ASSERT_EQUAL_MESSAGE("Result not as expected", OUString("OK"), pReturn->GetOUString()); } } } } -SAL_INFO("basic.qa", "end process directory"); +fprintf(stderr,"end process directory\n"); } void Coverage::Coverage_Iterator() diff --git a/basic/qa/cppunit/basictest.cxx b/basic/qa/cppunit/basictest.cxx index ebf39635620a..8cf9812d5212 100644 --- a/basic/qa/cppunit/basictest.cxx +++ b/basic/qa/cppunit/basictest.cxx @@ -7,7 +7,6 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ -#include #include "basictest.hxx" #include #include @@ -43,7 +42,7 @@ MacroSnippet::MacroSnippet() void MacroSnippet::LoadSourceFromFile(const OUString& sModuleName, const OUString& sMacroFileURL) { OUString sSource; -SAL_INFO("basic.qa", "loadSource opening macro file" << sMacroFileURL); +fprintf(stderr,"loadSource opening macro file %s\n", OUStringToOString( sMacroFileURL, RTL_TEXTENCODING_UTF8 ).getStr() ); osl::File aFile(sMacroFileURL); if(aFile.open(osl_File_OpenFlag_Read) == osl::FileBase::E_None) @@ -113,8 +112,9 @@ const ErrCode& MacroSnippet::getError() const { return maErrCode; } IMPL_LINK( MacroSnippet, BasicErrorHdl, StarBASIC *, /*pBasic*/, bool) { -SAL_INFO("basic.qa", '(' << StarBASIC::GetLine() << ':' << StarBASIC::GetCol1() << ")"); -SAL_INFO("basic.qa", "Basic error: " << StarBASIC::GetErrorText()); +fprintf(stderr,"(%d:%d)\n", +StarBASIC::GetLine(), StarBASIC::GetCol1()); +fprintf(stderr,"Basic error: %s\n", OUStringToOString( StarBASIC::GetErrorText(), RTL_TEXTENCODING_UTF8 ).getStr() ); mbError = true; maErrCode = StarBASIC::GetErrorCode(); return false; diff --git a/basic/qa/cppunit/test_vba.cxx b/basic/qa/cppunit/test_vba.cxx index a95e2db6a7bd..8a15ba7234e8 100644 --- a/basic/qa/cppunit/test_vba.cxx +++ b/basic/qa/cppunit/test_vba.cxx @@ -6,7 +6,6 @@ * 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 #include "basictest.hxx" #include @@ -169,8 +168,9 @@ void VBATest::testMiscVBAFunctions() myMacro.LoadSourceFromFile("TestModule", sMacroURL); SbxVariableRef pReturn = myMacro.Run(); CPPUNIT_ASSERT_MESSAGE("No return variable huh?", pReturn.is()); -SAL_INFO("basic.qa", "macro result for" << macroSource[i]); -SAL_INFO("basic.qa", "macro returned:\n" << pReturn->GetOUString()); +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()); } @@ -248,8 +248,9 @@ void VBATest::testMiscOLEStuff()
[Libreoffice-commits] core.git: basic/qa include/sal
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 AuthorDate: Wed Aug 30 17:25:08 2023 +0530 Commit: Ilmari Lauhakangas 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 Reviewed-by: Ilmari Lauhakangas 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 #include "basictest.hxx" #include #include @@ -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 #include "basictest.hxx" #include @@ -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]); -