diff options
author | Theo van Klaveren <theo.van.klaveren@gmail.com> | 2011-03-17 13:15:48 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-03-18 09:34:27 +0000 |
commit | 0ca3e466c7f39a54a369e1cf65718dac4ce32498 (patch) | |
tree | 8f761fe90b3cb2285a24b81f6f0e7ae072b29b02 | |
parent | 5173f778bd6656a5050bc2321f6676226cf4e5e5 (diff) |
Make the qa/rtl/rtl_doublelock test compile again.
-rw-r--r-- | sal/qa/rtl/doublelock/rtl_doublelocking.cxx | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/sal/qa/rtl/doublelock/rtl_doublelocking.cxx b/sal/qa/rtl/doublelock/rtl_doublelocking.cxx index dc6560d7a..1ffdd0e87 100644 --- a/sal/qa/rtl/doublelock/rtl_doublelocking.cxx +++ b/sal/qa/rtl/doublelock/rtl_doublelocking.cxx @@ -33,20 +33,21 @@ //------------------------------------------------------------------------ #include <sal/types.h> -#include <rtl/string.hxx> - #include <osl/thread.hxx> #include <osl/time.h> #include <rtl/instance.hxx> +#include <rtl/ustring.hxx> -#include <testshl/simpleheader.hxx> +#include <cppunit/TestFixture.h> +#include <cppunit/extensions/HelperMacros.h> +#include <cppunit/plugin/TestPlugIn.h> // ----------------------------------------------------------------------------- #define CONST_TEST_STRING "gregorian" namespace { -struct Gregorian : public rtl::StaticWithInit<const ::rtl::OUString, Gregorian> { +struct Gregorian : public ::rtl::StaticWithInit<const ::rtl::OUString, Gregorian> { const ::rtl::OUString operator () () { return ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( CONST_TEST_STRING )); } @@ -57,9 +58,9 @@ inline void printOUString( ::rtl::OUString const & _suStr ) { rtl::OString aString; - t_print( "OUString: " ); + printf( "OUString: " ); aString = ::rtl::OUStringToOString( _suStr, RTL_TEXTENCODING_ASCII_US ); - t_print( "'%s'\n", aString.getStr( ) ); + printf( "'%s'\n", aString.getStr( ) ); } // ----------------------------------------------------------------------------- @@ -74,7 +75,7 @@ namespace ThreadHelper { // if (nVerbose == VERBOSE) // { - // t_print("wait %d tenth seconds. ", _nTenthSec ); + // printf("wait %d tenth seconds. ", _nTenthSec ); // fflush(stdout); // } #ifdef WNT //Windows @@ -88,7 +89,7 @@ namespace ThreadHelper #endif // if (nVerbose == VERBOSE) // { - // t_print("done\n"); + // printf("done\n"); // } } } @@ -126,8 +127,8 @@ protected: while(schedule()) { rtl::OUString aStr = Gregorian::get(); - // printOUString(aStr); - // printOUString(m_sConstStr); + printOUString(aStr); + printOUString(m_sConstStr); if (aStr.equals(m_sConstStr)) { m_nOK++; @@ -151,7 +152,7 @@ public: { if (isRunning()) { - t_print("error: not terminated.\n"); + printf("error: not terminated.\n"); } } }; @@ -218,8 +219,8 @@ namespace rtl_DoubleLocking sal_Int32 nValueOK2 = 0; nValueOK2 = p2Thread->getOK(); - t_print("Value in Thread #1 is %d\n", nValueOK); - t_print("Value in Thread #2 is %d\n", nValueOK2); + printf("Value in Thread #1 is %d\n", nValueOK); + printf("Value in Thread #2 is %d\n", nValueOK2); sal_Int32 nValueFails = 0; nValueFails = pThread->getFails(); @@ -227,8 +228,8 @@ namespace rtl_DoubleLocking sal_Int32 nValueFails2 = 0; nValueFails2 = p2Thread->getFails(); - t_print("Fails in Thread #1 is %d\n", nValueFails); - t_print("Fails in Thread #2 is %d\n", nValueFails2); + printf("Fails in Thread #1 is %d\n", nValueFails); + printf("Fails in Thread #2 is %d\n", nValueFails2); // ThreadHelper::thread_sleep_tenth_sec(1); pThread->join(); @@ -249,11 +250,11 @@ namespace rtl_DoubleLocking CPPUNIT_TEST_SUITE_END(); }; // class create // ----------------------------------------------------------------------------- - CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_DoubleLocking::getValue, "rtl_DoubleLocking"); + CPPUNIT_TEST_SUITE_REGISTRATION(rtl_DoubleLocking::getValue); } // namespace rtl_DoubleLocking // this macro creates an empty function, which will called by the RegisterAllFunctions() // to let the user the possibility to also register some functions by hand. -NOADDITIONAL; +CPPUNIT_PLUGIN_IMPLEMENT(); /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |