diff options
author | Theo van Klaveren <theo.van.klaveren@gmail.com> | 2011-03-17 13:32:10 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2011-03-18 09:35:18 +0000 |
commit | f737c717b917685f574b0c462d2bebf63a2fae71 (patch) | |
tree | 400f9f1f804120674cc62d3fe9a46daac3f7b8cf | |
parent | df8e3ca428e3216ec5e33efd38a25cae952ad7e3 (diff) |
Make the qa/rtl/rtl_logfile test compile again.
-rw-r--r-- | sal/qa/rtl/logfile/rtl_logfile.cxx | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/sal/qa/rtl/logfile/rtl_logfile.cxx b/sal/qa/rtl/logfile/rtl_logfile.cxx index f3a482fb3c95..4d82eda190f5 100644 --- a/sal/qa/rtl/logfile/rtl_logfile.cxx +++ b/sal/qa/rtl/logfile/rtl_logfile.cxx @@ -42,7 +42,6 @@ #endif #include <rtl/logfile.hxx> -#include <testshl/simpleheader.hxx> #include <osl/file.hxx> #if ( defined WNT ) // Windows @@ -51,6 +50,10 @@ #include <postwin.h> #endif +#include <cppunit/TestFixture.h> +#include <cppunit/extensions/HelperMacros.h> +#include <cppunit/plugin/TestPlugIn.h> + using namespace ::osl; inline void printUString( const ::rtl::OUString & str, const sal_Char * msg = "" ) @@ -58,11 +61,11 @@ inline void printUString( const ::rtl::OUString & str, const sal_Char * msg = "" if (strlen(msg) > 0) { - t_print("%s: ", msg ); + printf("%s: ", msg ); } rtl::OString aString; aString = ::rtl::OUStringToOString( str, RTL_TEXTENCODING_ASCII_US ); - t_print("%s\n", (char *)aString.getStr( ) ); + printf("%s\n", (char *)aString.getStr( ) ); } /** get the absolute source file URL "file:///.../sal/qa/rtl/logfile/" @@ -150,7 +153,7 @@ namespace rtl_logfile sal_Char buffer_read[400]; sal_uInt64 nCount_read; nError1 = aTestFile.read( buffer_read, 400, nCount_read ); - //t_print("buffer is %s\n", buffer_read ); + //printf("buffer is %s\n", buffer_read ); CPPUNIT_ASSERT_MESSAGE("write right logs", strstr( buffer_read, "trace 1 2 3") != NULL ); aTestFile.sync(); aTestFile.close(); @@ -211,10 +214,10 @@ namespace rtl_logfile } // namespace rtl_logfile // ----------------------------------------------------------------------------- -CPPUNIT_TEST_SUITE_NAMED_REGISTRATION( rtl_logfile::logfile, "rtl_logfile" ); +CPPUNIT_TEST_SUITE_REGISTRATION( rtl_logfile::logfile); // ----------------------------------------------------------------------------- -NOADDITIONAL; +CPPUNIT_PLUGIN_IMPLEMENT(); //~ do some clean up work after all test completed. class GlobalObject @@ -224,7 +227,7 @@ public: { try { - t_print( "\n#Do some clean-ups ... only delete logfile1_*.log here!\n" ); + printf( "\n#Do some clean-ups ... only delete logfile1_*.log here!\n" ); rtl::OUString suFilePath = getTempPath(); suFilePath += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("logfile1_")) + getCurrentPID( ); suFilePath += rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(".log")); @@ -233,16 +236,16 @@ public: ::osl::FileBase::RC nError1; nError1 = osl::File::remove( suFilePath ); #ifdef WNT - t_print("Please remove logfile* manully! Error is Permision denied!"); + printf("Please remove logfile* manully! Error is Permision denied!"); #endif } catch (CppUnit::Exception &e) { - t_print("Exception caught in GlobalObject dtor(). Exception message: '%s'. Source line: %d\n", e.what(), e.sourceLine().lineNumber()); + printf("Exception caught in GlobalObject dtor(). Exception message: '%s'. Source line: %d\n", e.what(), e.sourceLine().lineNumber()); } catch (...) { - t_print("Exception caught (...) in GlobalObject dtor()\n"); + printf("Exception caught (...) in GlobalObject dtor()\n"); } } }; |