From d35eac83abff0a8860cd31c6e08b294e5ee8688f Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 4 Mar 2016 12:19:10 +0100 Subject: [PATCH] This is test code, OK to unconditionally print to stdout ...and where appropriate use CPPUNIT_ASSERT_EQUAL to have no need to always print out certain values Change-Id: Iad2ccb235b09852fffd3f010cf069c45b36e2d4b --- include/sal/log-areas.dox | 1 - sal/qa/rtl/doublelock/rtl_doublelocking.cxx | 15 ++++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/include/sal/log-areas.dox b/include/sal/log-areas.dox index 1ccf4b193fe8..6ed94fba73ed 100644 --- a/include/sal/log-areas.dox +++ b/include/sal/log-areas.dox @@ -32,7 +32,6 @@ certain functionality. @li @c sal.textenc - the textencoding SAL library @li @c sal.w32 @li @c sal.test -@li @c sal.doublelock @section basctl diff --git a/sal/qa/rtl/doublelock/rtl_doublelocking.cxx b/sal/qa/rtl/doublelock/rtl_doublelocking.cxx index 8678ee069620..164e4a5186e1 100644 --- a/sal/qa/rtl/doublelock/rtl_doublelocking.cxx +++ b/sal/qa/rtl/doublelock/rtl_doublelocking.cxx @@ -17,7 +17,9 @@ * the License at http://www.apache.org/licenses/LICENSE-2.0 . */ -// include files +#include + +#include #include @@ -190,24 +192,23 @@ namespace rtl_DoubleLocking sal_Int32 nValueOK2 = 0; nValueOK2 = p2Thread->getOK(); - SAL_INFO("sal.doublelock", "Value in Thread #1 is " << nValueOK); - SAL_INFO("sal.doublelock", "Value in Thread #2 is " << nValueOK2); + std::cout << "Value in Thread #1 is " << nValueOK << "\n"; + std::cout << "Value in Thread #2 is " << nValueOK2 << "\n"; sal_Int32 nValueFails = 0; nValueFails = pThread->getFails(); sal_Int32 nValueFails2 = 0; nValueFails2 = p2Thread->getFails(); - SAL_INFO("sal.doublelock", "Fails in Thread #1 is " << nValueFails); - SAL_INFO("sal.doublelock", "Fails in Thead #2 is " << nValueFails2); - delete pThread; delete p2Thread; CPPUNIT_ASSERT_MESSAGE( "getValue() failed, wrong value expected.", - nValueOK != 0 && nValueFails == 0 && nValueFails2 == 0 + nValueOK != 0 ); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nValueFails); + CPPUNIT_ASSERT_EQUAL(sal_Int32(0), nValueFails2); } CPPUNIT_TEST_SUITE(getValue);