diff options
author | Jelle van der Waa <jelle@vdwaa.nl> | 2013-09-10 20:01:23 +0200 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2013-09-11 15:50:41 +0000 |
commit | 550b275e634a5a16bf55cbb716f21608fa211e3e (patch) | |
tree | b704d133d84e5911dde8ed6a87c43278a9e926bb /sal/qa | |
parent | ac26b103af987f080ca14ad243033e5e0acda189 (diff) |
fdo#39625 Make existing cppunittests work
Change-Id: Ia3a59456fe82926141ccb2921aa47df4183ead86
Reviewed-on: https://gerrit.libreoffice.org/5905
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sal/qa')
-rw-r--r-- | sal/qa/rtl/process/rtl_Process.cxx | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/sal/qa/rtl/process/rtl_Process.cxx b/sal/qa/rtl/process/rtl_Process.cxx index 6f4826a429ef..fdc9f1998757 100644 --- a/sal/qa/rtl/process/rtl_Process.cxx +++ b/sal/qa/rtl/process/rtl_Process.cxx @@ -23,7 +23,10 @@ #include <string.h> #include <sal/types.h> -#include <testshl/simpleheader.hxx> +#include <cppunit/TestFixture.h> +#include <cppunit/extensions/HelperMacros.h> +#include <cppunit/plugin/TestPlugIn.h> + #include <rtl/ustring.hxx> #include <rtl/string.hxx> #include <rtl/process.h> @@ -44,14 +47,13 @@ inline void printUString( const ::rtl::OUString & str, const sal_Char * msg = NU { if ( msg != NULL ) { - t_print("#%s #printUString_u# ", msg ); + printf("#%s #printUString_u# ", 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( ) ); } -// ----------------------------------------------------------------------------- inline ::rtl::OUString getModulePath( void ) { ::rtl::OUString suDirPath; @@ -65,8 +67,6 @@ inline ::rtl::OUString getModulePath( void ) return suDirPath; } -// ----------------------------------------------------------------------------- - namespace rtl_Process { class getAppCommandArg : public CppUnit::TestFixture @@ -142,7 +142,7 @@ public: osl_Process_E_None == osl_error ); - t_print("the exit code is %d.\n", pInfo->Code ); + printf("the exit code is %d.\n", pInfo->Code ); CPPUNIT_ASSERT_MESSAGE("rtl_getAppCommandArg or rtl_getAppCommandArgCount error.", pInfo->Code == 2); delete pInfo; } @@ -262,11 +262,11 @@ public: sal_Char pUUID2[33]; pUUID2[32] = '\0'; - sal_uInt64 nRead = 0; - osl_readFile( *pChildOutputRead, pUUID2, 32, &nRead ); - t_print("read buffer is %s, nRead is %d \n", pUUID2, nRead ); - OUString suUUID2 = OUString::createFromAscii( pUUID2 ); - CPPUNIT_ASSERT_MESSAGE("getGlobalProcessId: got two same ProcessIds.", suUUID2.equalsAsciiL( pUUID1, 32) == sal_False ); + sal_uInt64 nRead = 0; + osl_readFile( *pChildOutputRead, pUUID2, 32, &nRead ); + printf("read buffer is %s, nRead is %" SAL_PRIdINT64 "\n", pUUID2, nRead ); + OUString suUUID2 = OUString::createFromAscii( pUUID2 ); + CPPUNIT_ASSERT_MESSAGE("getGlobalProcessId: got two same ProcessIds.", suUUID2.equalsAsciiL( pUUID1, 32) == sal_False ); } CPPUNIT_TEST_SUITE(getGlobalProcessId); @@ -282,10 +282,8 @@ CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_Process::getAppCommandArg, "rtl_Proces CPPUNIT_TEST_SUITE_NAMED_REGISTRATION(rtl_Process::getGlobalProcessId, "rtl_Process"); -// ----------------------------------------------------------------------------- - // 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: */ |