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
This commit is contained in:
parent
46c67c4323
commit
d35eac83ab
@ -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
|
||||
|
||||
|
@ -17,7 +17,9 @@
|
||||
* the License at http://www.apache.org/licenses/LICENSE-2.0 .
|
||||
*/
|
||||
|
||||
// include files
|
||||
#include <sal/config.h>
|
||||
|
||||
#include <iostream>
|
||||
|
||||
#include <sal/types.h>
|
||||
|
||||
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user