From f13c6ad5f020a196a0e3aa6f28bda3dc185d465b Mon Sep 17 00:00:00 2001 From: Noel Grandin Date: Mon, 14 Oct 2019 14:27:57 +0200 Subject: new loplugin:bufferadd look for OUStringBuffer append sequences that can be turned into creating an OUString with + operations Change-Id: Ica840dc096000307b4a105fb4d9ec7588a15ade6 Reviewed-on: https://gerrit.libreoffice.org/80809 Tested-by: Jenkins Reviewed-by: Noel Grandin --- basic/qa/cppunit/test_append.cxx | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'basic/qa') diff --git a/basic/qa/cppunit/test_append.cxx b/basic/qa/cppunit/test_append.cxx index 1bda71d37287..242d16fa0b46 100644 --- a/basic/qa/cppunit/test_append.cxx +++ b/basic/qa/cppunit/test_append.cxx @@ -67,15 +67,12 @@ void EnableTest::testDimEnable() 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"); + OUString aSource1 = " #If Win64\n" + "Declare PtrSafe Function aht_apiGetOpenFileName Lib \"comdlg32.dll\"" + "\n" + "#End if\n"; - MacroSnippet myMacro(aSource1.toString()); + MacroSnippet myMacro(aSource1); myMacro.Compile(); CPPUNIT_ASSERT_MESSAGE("#if Win64 Declare PtrSafe causes compile error", !myMacro.HasError() ); } -- cgit