[Libreoffice-commits] core.git: Branch 'aoo/trunk' - sal/qa
sal/qa/osl/file/osl_File_Const.h|3 --- sal/qa/osl/module/osl_Module_Const.h|3 --- sal/qa/osl/mutex/osl_Mutex.cxx |2 -- sal/qa/osl/process/osl_process.cxx |9 +++-- sal/qa/osl/process/osl_process_child.cxx| 15 ++- sal/qa/osl/security/osl_Security_Const.h|4 sal/qa/osl/socket/osl_Socket_Const.h|3 --- sal/qa/osl/socket/osl_Socket_Const_orig.h |3 --- sal/qa/osl/socket/sockethelper.hxx |3 --- sal/qa/rtl/bootstrap/rtl_Bootstrap.cxx |2 -- sal/qa/rtl/digest/rtl_digest.cxx|2 +- sal/qa/rtl/doublelock/rtl_doublelocking.cxx |2 -- sal/qa/rtl/logfile/rtl_logfile.cxx |5 - sal/qa/rtl/uuid/rtl_Uuid.cxx|2 -- 14 files changed, 10 insertions(+), 48 deletions(-) New commits: commit 729d1c1df8068f36cc44c0e6a12241338ebf774e Author: Damjan JovanovicDate: Thu Jan 28 18:04:22 2016 + #i126787# fix unit tests on Windows Fix a regression caused by r1710853 and which always existed in some files, where and were being included before and after , yet unavailable as the tools module isn't built (and can't be) before sal. Patch by: j.nitschke at ok.de Review by: me diff --git a/sal/qa/osl/file/osl_File_Const.h b/sal/qa/osl/file/osl_File_Const.h index 0e839d6..2bb52a5 100644 --- a/sal/qa/osl/file/osl_File_Const.h +++ b/sal/qa/osl/file/osl_File_Const.h @@ -107,13 +107,10 @@ const sal_Char pBuffer_Blank[] = ""; # define PATH_SEPERATOR "/" #endif #if (defined WNT ) // Windows -#include -// #include # include # include # include # include -#include # define PATH_MAX MAX_PATH # define TEST_PLATFORM"c:/" # define TEST_PLATFORM_ROOT "c:/" diff --git a/sal/qa/osl/module/osl_Module_Const.h b/sal/qa/osl/module/osl_Module_Const.h index 3eb90e7..8071a69 100644 --- a/sal/qa/osl/module/osl_Module_Const.h +++ b/sal/qa/osl/module/osl_Module_Const.h @@ -35,10 +35,7 @@ # include #endif #if ( defined WNT ) // Windows -#include -// #include # include -#include #endif # define FILE_PREFIX "file:///" diff --git a/sal/qa/osl/mutex/osl_Mutex.cxx b/sal/qa/osl/mutex/osl_Mutex.cxx index 55ed5cc..b187494 100644 --- a/sal/qa/osl/mutex/osl_Mutex.cxx +++ b/sal/qa/osl/mutex/osl_Mutex.cxx @@ -31,10 +31,8 @@ #include #ifdef WNT -#include #define WIN32_LEAN_AND_MEAN #include -#include #endif using namespace osl; diff --git a/sal/qa/osl/process/osl_process.cxx b/sal/qa/osl/process/osl_process.cxx index 0c1ee9f..e0b3f44 100644 --- a/sal/qa/osl/process/osl_process.cxx +++ b/sal/qa/osl/process/osl_process.cxx @@ -36,12 +36,9 @@ #include #include -#if ( defined WNT ) // Windows -#include -# define WIN32_LEAN_AND_MEAN -// #include -# include -#include +#ifdef WNT // Windows +#define WIN32_LEAN_AND_MEAN +#include #endif #include diff --git a/sal/qa/osl/process/osl_process_child.cxx b/sal/qa/osl/process/osl_process_child.cxx index 57e6be2..dfe7614 100644 --- a/sal/qa/osl/process/osl_process_child.cxx +++ b/sal/qa/osl/process/osl_process_child.cxx @@ -27,16 +27,13 @@ // // includes -#if ( defined WNT ) // Windows -#include -# define UNICODE -# define _UNICODE -# define WIN32_LEAN_AND_MEAN -// #include -# include -#include +#ifdef WNT // Windows +#define UNICODE +#define _UNICODE +#define WIN32_LEAN_AND_MEAN +#include #else -# include +#include #endif #include diff --git a/sal/qa/osl/security/osl_Security_Const.h b/sal/qa/osl/security/osl_Security_Const.h index f68839d..c1909d0 100644 --- a/sal/qa/osl/security/osl_Security_Const.h +++ b/sal/qa/osl/security/osl_Security_Const.h @@ -28,11 +28,7 @@ #define _OSL_SECURITY_CONST_H_ #if ( defined WNT ) // Windows -//#define UNICODE -#include -// #include #include -#include #endif // diff --git a/sal/qa/osl/socket/osl_Socket_Const.h b/sal/qa/osl/socket/osl_Socket_Const.h index 63aa45a..3696cb4 100644 --- a/sal/qa/osl/socket/osl_Socket_Const.h +++ b/sal/qa/osl/socket/osl_Socket_Const.h @@ -86,11 +86,8 @@ extern "C" # include #endif #if ( defined WNT ) // Windows -#include -// #include # include # include -#include #endif diff --git a/sal/qa/osl/socket/osl_Socket_Const_orig.h b/sal/qa/osl/socket/osl_Socket_Const_orig.h index 5f8e367..cbaa9d7 100644 --- a/sal/qa/osl/socket/osl_Socket_Const_orig.h +++ b/sal/qa/osl/socket/osl_Socket_Const_orig.h @@ -86,11 +86,8 @@ extern "C" # include #endif #if ( defined WNT ) // Windows -#include -// #include # include # include -#include #endif diff
[Libreoffice-commits] core.git: Branch 'aoo/trunk' - sal/qa
0 files changed New commits: commit 561f3f4431baa22cde5597dafdb8427b7ed3875f Author: Damjan JovanovicDate: Fri Jan 29 01:08:46 2016 + Remove an unused empty file that is causing the RAT scan to fail. Patch by: me diff --git a/sal/qa/ByteSequence/main.cxx b/sal/qa/ByteSequence/main.cxx deleted file mode 100644 index e69de29..000 ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'aoo/trunk' - sal/qa
sal/qa/osl/mutex/osl_Mutex.cxx |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) New commits: commit 3200e44715bd1af70323ff1c02482284d55e2382 Author: Damjan JovanovicDate: Sun Nov 15 10:04:08 2015 + Fix a main/sal/qa/osl/mutex build error on MacOS. Found by: Pathangi Janardhanan Jatinshravan Patch by: Pathangi Janardhanan Jatinshravan Review by: me diff --git a/sal/qa/osl/mutex/osl_Mutex.cxx b/sal/qa/osl/mutex/osl_Mutex.cxx index e5a6a41..55ed5cc 100644 --- a/sal/qa/osl/mutex/osl_Mutex.cxx +++ b/sal/qa/osl/mutex/osl_Mutex.cxx @@ -727,7 +727,7 @@ namespace osl_ClearableGuard TimeValue aTimeVal_after; osl_getSystemTime( _after ); sal_Int32 nSec = aTimeVal_after.Seconds - aTimeVal_befor.Seconds; -printf("nSec is %"SAL_PRIdINT32"\n", nSec); +printf("nSec is %" SAL_PRIdINT32"\n", nSec); myThread.join(); ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'aoo/trunk' - sal/qa
sal/qa/ByteSequence/ByteSequence.cxx |6 ++ sal/qa/ByteSequence/main.cxx | 28 sal/qa/ByteSequence/makefile.mk |8 +--- sal/qa/OStringBuffer/makefile.mk |6 -- 4 files changed, 7 insertions(+), 41 deletions(-) New commits: commit 3b78105d7bcea8d4aecedfa85b7df735890b3bb0 Author: Damjan JovanovicDate: Tue Oct 27 15:52:42 2015 + Remove unnecessary OOO_SUBSEQUENT_TESTS from main/sal/qa/ByteSequence and main/sal/qa/OStringBuffer. diff --git a/sal/qa/ByteSequence/ByteSequence.cxx b/sal/qa/ByteSequence/ByteSequence.cxx index 6a83482..8fc5c57 100644 --- a/sal/qa/ByteSequence/ByteSequence.cxx +++ b/sal/qa/ByteSequence/ByteSequence.cxx @@ -167,3 +167,9 @@ TEST_F(Test, test_diffElem) { } +int main(int argc, char **argv) +{ +::testing::InitGoogleTest(, argv); +return RUN_ALL_TESTS(); +} + diff --git a/sal/qa/ByteSequence/main.cxx b/sal/qa/ByteSequence/main.cxx index df14e5b..e69de29 100644 --- a/sal/qa/ByteSequence/main.cxx +++ b/sal/qa/ByteSequence/main.cxx @@ -1,28 +0,0 @@ -/** - * - * Licensed to the Apache Software Foundation (ASF) under one - * or more contributor license agreements. See the NOTICE file - * distributed with this work for additional information - * regarding copyright ownership. The ASF licenses this file - * to you under the Apache License, Version 2.0 (the - * "License"); you may not use this file except in compliance - * with the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - * - */ - -#include "gtest/gtest.h" - -int main(int argc, char **argv) -{ -::testing::InitGoogleTest(, argv); -return RUN_ALL_TESTS(); -} diff --git a/sal/qa/ByteSequence/makefile.mk b/sal/qa/ByteSequence/makefile.mk index 7497219..63c33c3 100644 --- a/sal/qa/ByteSequence/makefile.mk +++ b/sal/qa/ByteSequence/makefile.mk @@ -21,10 +21,6 @@ -.IF "$(OOO_SUBSEQUENT_TESTS)" == "" -nothing .PHONY: -.ELSE - PRJ = ../.. PRJNAME = sal TARGET = qa_ByteSequence @@ -39,7 +35,7 @@ all: .ELSE -APP1OBJS = $(SLO)/ByteSequence.obj $(SLO)/main.obj +APP1OBJS = $(SLO)/ByteSequence.obj APP1RPATH = NONE APP1STDLIBS = $(GTESTLIB) $(SALLIB) APP1TARGET = rtl_ByteSequence @@ -48,5 +44,3 @@ APP1TEST = enabled .INCLUDE: target.mk .ENDIF # "$(ENABLE_UNIT_TESTS)" != "YES" - -.END # "$(OOO_SUBSEQUENT_TESTS)" == "" diff --git a/sal/qa/OStringBuffer/makefile.mk b/sal/qa/OStringBuffer/makefile.mk index 297cf7d..d3fe5c1 100644 --- a/sal/qa/OStringBuffer/makefile.mk +++ b/sal/qa/OStringBuffer/makefile.mk @@ -21,10 +21,6 @@ -.IF "$(OOO_SUBSEQUENT_TESTS)" == "" -nothing .PHONY: -.ELSE - PRJ=..$/.. PRJNAME=sal @@ -61,5 +57,3 @@ APP1TEST = enabled .INCLUDE : target.mk .ENDIF # "$(ENABLE_UNIT_TESTS)" != "YES" - -.END ___ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
[Libreoffice-commits] core.git: Branch 'aoo/trunk' - sal/qa
sal/qa/osl/file/osl_File.cxx | 278 +++ 1 file changed, 128 insertions(+), 150 deletions(-) New commits: commit 4fe9fcf7c27be4de507254e369c41a2d92a71975 Author: Damjan JovanovicDate: Mon Oct 5 18:41:29 2015 + Fix an incompletely ported Google Test. diff --git a/sal/qa/osl/file/osl_File.cxx b/sal/qa/osl/file/osl_File.cxx index 0a4967d..c52565a 100644 --- a/sal/qa/osl/file/osl_File.cxx +++ b/sal/qa/osl/file/osl_File.cxx @@ -767,179 +767,158 @@ namespace osl_FileBase class getAbsoluteFileURL:public ::testing::Test { -//::osl::FileBase aFileBase; -::rtl::OUString aResultURL1, aResultURL2, aResultURL3, aResultURL4, aResultURL5, aResultURL6; -// ::osl::FileBase::RC nError; +protected: +::osl::FileBase aFileBase; +::rtl::OUString aResultURL1, aResultURL2, aResultURL3, aResultURL4, aResultURL5, aResultURL6; +::osl::FileBase::RC nError; sal_BoolbOk; public: - +void SetUp(); +void TearDown(); void check_getAbsoluteFileURL( rtl::OUString const& _suBaseURL, rtl::OString const& _sRelativeURL, ::osl::FileBase::RC _nAssumeError, rtl::OUString const& _suAssumeResultStr ); - - void getAbsoluteFileURL_001_1(); - void getAbsoluteFileURL_001_2(); - void getAbsoluteFileURL_001_3(); - void getAbsoluteFileURL_001_4(); - void getAbsoluteFileURL_001_5(); - void getAbsoluteFileURL_001_6(); - void getAbsoluteFileURL_001_7(); - void getAbsoluteFileURL_001_8(); - void getAbsoluteFileURL_002(); - void getAbsoluteFileURL_003(); - void getAbsoluteFileURL_004(); }; //class getAbsoluteFileURL -/* use coding format as same as getSystemPathFromFileURL -// initialization -void setUp( ) -{ -sal_Char pResultURL1[] = "/relative/file1"; -sal_Char pResultURL2[] = "/relative/file2"; -sal_Char pResultURL3[] = "/file3"; -sal_Char pResultURL4[] = "/file4"; -sal_Char pResultURL5[] = "/canonical.name"; -sal_Char pResultURL6[] = "/relative/"; -aResultURL1 = aUserDirectoryURL.concat( rtl::OUString::createFromAscii( pResultURL1 ) ); -aResultURL2 = aUserDirectoryURL.concat( rtl::OUString::createFromAscii( pResultURL2 ) ); -aResultURL3 = aUserDirectoryURL.concat( rtl::OUString::createFromAscii( pResultURL3 ) ); -aResultURL4 = aUserDirectoryURL.concat( rtl::OUString::createFromAscii( pResultURL4 ) ); -aResultURL5 = aUserDirectoryURL.concat( rtl::OUString::createFromAscii( pResultURL5 ) ); -aResultURL6 = aUserDirectoryURL.concat( rtl::OUString::createFromAscii( pResultURL6 ) ); -} +/* use coding format as same as getSystemPathFromFileURL*/ +// initialization +void getAbsoluteFileURL::SetUp( ) +{ +sal_Char pResultURL1[] = "/relative/file1"; +sal_Char pResultURL2[] = "/relative/file2"; +sal_Char pResultURL3[] = "/file3"; +sal_Char pResultURL4[] = "/file4"; +sal_Char pResultURL5[] = "/canonical.name"; +sal_Char pResultURL6[] = "/relative/"; +aResultURL1 = aUserDirectoryURL.concat( rtl::OUString::createFromAscii( pResultURL1 ) ); +aResultURL2 = aUserDirectoryURL.concat( rtl::OUString::createFromAscii( pResultURL2 ) ); +aResultURL3 = aUserDirectoryURL.concat( rtl::OUString::createFromAscii( pResultURL3 ) ); +aResultURL4 = aUserDirectoryURL.concat( rtl::OUString::createFromAscii( pResultURL4 ) ); +aResultURL5 = aUserDirectoryURL.concat( rtl::OUString::createFromAscii( pResultURL5 ) ); +aResultURL6 = aUserDirectoryURL.concat( rtl::OUString::createFromAscii( pResultURL6 ) ); +} -void tearDown( ) -{ -} +void getAbsoluteFileURL::TearDown( ) +{ +} -// test code -void getAbsoluteFileURL_001( ) -{ -::rtl::OUString aUStr_AbsURL; - -::osl::FileBase::RC nError11 = aFileBase.getAbsoluteFileURL( aUserDirectoryURL, aRelURL1, aUStr_AbsURL ); -::rtl::OUString suError = ::rtl::OUString::createFromAscii("test for getAbsoluteFileURL(' "); -suError += aUserDirectoryURL; -suError += ::rtl::OUString::createFromAscii("', '"); -suError += aRelURL1; -suError += ::rtl::OUString::createFromAscii("', '"); -suError += aUStr_AbsURL; -suError += outputError( aUStr_AbsURL, aResultURL1, "' ),"); - -sal_Bool nError12 = aUStr_AbsURL.equals( aResultURL1 ); -::osl::FileBase::RC nError21 = aFileBase.getAbsoluteFileURL( aUserDirectoryURL, aRelURL2, aUStr_AbsURL ); -sal_Bool nError22 = aUStr_AbsURL.equals( aResultURL2 ); -::osl::FileBase::RC nError31 = aFileBase.getAbsoluteFileURL(
[Libreoffice-commits] core.git: Branch 'aoo/trunk' - sal/qa
sal/qa/rtl/uuid/makefile.mk | 26 +++ sal/qa/rtl/uuid/rtl_Uuid.cxx | 140 --- 2 files changed, 78 insertions(+), 88 deletions(-) New commits: commit 933db9c80d5510abdd3569a025f654102d83aaf5 Author: Damjan Jovanovic dam...@apache.org Date: Sun Aug 30 19:10:42 2015 + #i125003# migrate main/sal/qa/rtl/uuid from cppunit to Google Test. diff --git a/sal/qa/rtl/uuid/makefile.mk b/sal/qa/rtl/uuid/makefile.mk index 80f6b9a..df42f80 100644 --- a/sal/qa/rtl/uuid/makefile.mk +++ b/sal/qa/rtl/uuid/makefile.mk @@ -33,32 +33,30 @@ ENABLE_EXCEPTIONS=TRUE .INCLUDE : settings.mk +.IF $(ENABLE_UNIT_TESTS) != YES +all: +@echo unit tests are disabled. Nothing to do. + +.ELSE + CFLAGS+= $(LFS_CFLAGS) CXXFLAGS+= $(LFS_CFLAGS) -CFLAGSCXX += $(CPPUNIT_CFLAGS) # BEGIN # auto generated Target:joblist by codegen.pl -SHL1OBJS= \ +APP1OBJS= \ $(SLO)$/rtl_Uuid.obj -SHL1TARGET= rtl_Uuid -SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB) - -SHL1IMPLIB= i$(SHL1TARGET) -# SHL1DEF=$(MISC)$/$(SHL1TARGET).def +APP1TARGET= rtl_Uuid +APP1STDLIBS= $(SALLIB) $(GTESTLIB) $(TESTSHL2LIB) +APP1RPATH = NONE +APP1TEST = enabled -DEF1NAME=$(SHL1TARGET) -# DEF1EXPORTFILE= export.exp -SHL1VERSIONMAP= $(PRJ)$/qa$/export.map # END -- -#--- All object files --- -# do this here, so we get right dependencies -SLOFILES=$(SHL1OBJS) # --- Targets -- .INCLUDE : target.mk -.INCLUDE : _cppunit.mk +.ENDIF # $(ENABLE_UNIT_TESTS) != YES diff --git a/sal/qa/rtl/uuid/rtl_Uuid.cxx b/sal/qa/rtl/uuid/rtl_Uuid.cxx index 1016af1..42a6eed 100644 --- a/sal/qa/rtl/uuid/rtl_Uuid.cxx +++ b/sal/qa/rtl/uuid/rtl_Uuid.cxx @@ -27,7 +27,6 @@ #include math.h #include stdio.h -#include testshl/simpleheader.hxx #include rtl/uuid.h #include rtl/ustring.h #include rtl/ustring.hxx @@ -37,16 +36,18 @@ #include time.h #endif +#include gtest/gtest.h + using namespace rtl; /** print a UNI_CODE String. And also print some comments of the string. */ inline void printUString( const ::rtl::OUString str, const sal_Char * msg = ) { -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( ) ); } / @@ -71,21 +72,23 @@ void printUuid( sal_uInt8 *pNode ) namespace rtl_Uuid { -class createUuid : public CppUnit::TestFixture +class createUuid : public ::testing::Test { public: // initialise your test code values here. -void setUp() +void SetUp() { } -void tearDown() +void TearDown() { } +}; // class createUuid + #define TEST_UUID 20 -void createUuid_001() -{ +TEST_F(createUuid, createUuid_001) +{ sal_uInt8 aNode[TEST_UUID][16]; sal_Int32 i,i2; for( i = 0 ; i TEST_UUID ; i ++ ) @@ -106,11 +109,12 @@ public: if ( bRes == sal_False ) break; } -CPPUNIT_ASSERT_MESSAGE(createUuid: every uuid must be different., bRes == sal_True ); -} - /* -void createUuid_002() -{ +ASSERT_TRUE(bRes == sal_True) createUuid: every uuid must be different.; +} + +/* +TEST_F(createUuid, createUuid_002) +{ sal_uInt8 pNode[16]; sal_uInt8 aNode[TEST_UUID][16]; sal_Int32 i,i2; @@ -133,14 +137,8 @@ public: if ( bRes == sal_False ) break; } -CPPUNIT_ASSERT_MESSAGE(createUuid: every uuid must be different., bRes == sal_True ); -}*/ - -CPPUNIT_TEST_SUITE(createUuid); -CPPUNIT_TEST(createUuid_001); -//CPPUNIT_TEST(createUuid_002); -CPPUNIT_TEST_SUITE_END(); -}; // class createUuid +ASSERT_TRUE(bRes == sal_True) createUuid: every uuid must be different.; +}*/ namespace ThreadHelper { @@ -155,70 +153,64 @@ namespace ThreadHelper } } -class createNamedUuid : public CppUnit::TestFixture +class createNamedUuid : public ::testing::Test { public: // initialise your test code values here. -void setUp() +void SetUp() { } -void tearDown() +void TearDown() { } +}; // class createNamedUuid -void createNamedUuid_001() -{ -sal_uInt8 NameSpace_DNS[16] = RTL_UUID_NAMESPACE_DNS; -sal_uInt8 NameSpace_URL[16] = RTL_UUID_NAMESPACE_URL; -sal_uInt8 pPriorCalculatedUUID[16] = { -0x52,0xc9,0x30,0xa5, -0xd1,0x61,0x3b,0x16, -0x98,0xc5,0xf8,0xd1, -0x10,0x10,0x6d,0x4d }; - -sal_uInt8 pNamedUUID[16], pNamedUUID2[16]; - -// Same name does generate the same uuid -
[Libreoffice-commits] core.git: Branch 'aoo/trunk' - sal/qa
sal/qa/rtl/uri/makefile.mk | 39 ++ sal/qa/rtl/uri/rtl_Uri.cxx | 197 ++- sal/qa/rtl/uri/rtl_testuri.cxx | 260 + 3 files changed, 225 insertions(+), 271 deletions(-) New commits: commit 33abd0564a8a62d8452892d43906c02ef57553ee Author: Damjan Jovanovic dam...@apache.org Date: Mon Aug 31 02:16:25 2015 + #i125003# migrate main/sal/qa/rtl/uri from cppunit to Google Test. diff --git a/sal/qa/rtl/uri/makefile.mk b/sal/qa/rtl/uri/makefile.mk index 78b0c01..30021d6 100644 --- a/sal/qa/rtl/uri/makefile.mk +++ b/sal/qa/rtl/uri/makefile.mk @@ -32,40 +32,37 @@ ENABLE_EXCEPTIONS=TRUE .INCLUDE : settings.mk +.IF $(ENABLE_UNIT_TESTS) != YES +all: +@echo unit tests are disabled. Nothing to do. + +.ELSE + CFLAGS+= $(LFS_CFLAGS) CXXFLAGS+= $(LFS_CFLAGS) -CFLAGSCXX += $(CPPUNIT_CFLAGS) - # --- BEGIN -SHL1OBJS= \ +APP1OBJS= \ $(SLO)$/rtl_Uri.obj -SHL1TARGET= rtl_uri_simple -SHL1STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB) - -SHL1IMPLIB= i$(SHL1TARGET) -DEF1NAME=$(SHL1TARGET) -SHL1VERSIONMAP = $(PRJ)$/qa$/export.map +APP1TARGET= rtl_uri_simple +APP1STDLIBS= $(SALLIB) $(GTESTLIB) $(TESTSHL2LIB) +APP1RPATH = NONE +APP1TEST = enabled # END -- # --- BEGIN -SHL2OBJS= \ +APP2OBJS= \ $(SLO)$/rtl_testuri.obj -SHL2TARGET= rtl_Uri -SHL2STDLIBS= $(SALLIB) $(CPPUNITLIB) $(TESTSHL2LIB) - -SHL2IMPLIB= i$(SHL2TARGET) -DEF2NAME=$(SHL2TARGET) -SHL2VERSIONMAP = $(PRJ)$/qa$/export.map +APP2TARGET= rtl_Uri +APP2STDLIBS= $(SALLIB) $(GTESTLIB) $(TESTSHL2LIB) +APP2RPATH = NONE +APP2TEST = enabled # END -- -#--- All object files --- -# do this here, so we get right dependencies -# SLOFILES=$(SHL1OBJS) - # --- Targets -- .INCLUDE : target.mk -.INCLUDE : _cppunit.mk + +.ENDIF # $(ENABLE_UNIT_TESTS) != YES diff --git a/sal/qa/rtl/uri/rtl_Uri.cxx b/sal/qa/rtl/uri/rtl_Uri.cxx index 41a4c39..6ef2a0a 100644 --- a/sal/qa/rtl/uri/rtl_Uri.cxx +++ b/sal/qa/rtl/uri/rtl_Uri.cxx @@ -31,7 +31,7 @@ #include osl/thread.h #include osl/file.hxx -#include testshl/simpleheader.hxx +#include gtest/gtest.h // - @@ -71,15 +71,16 @@ namespace Stringtest // - -class Convert : public CppUnit::TestFixture +class Convert : public ::testing::Test { +protected: rtl::OUString m_aStr; public: /* rtl::OString toUTF8(rtl::OUString const _suStr) { rtl::OString sStrAsUTF8 = rtl::OUStringToOString(_suStr, RTL_TEXTENCODING_UTF8); -t_print(%s\n, escapeString(sStrAsUTF8).getStr()); +printf(%s\n, escapeString(sStrAsUTF8).getStr()); return sStrAsUTF8; } */ @@ -97,7 +98,7 @@ namespace Stringtest void showContent(rtl::OUString const _suStr) { rtl::OString sStr = convertToOString(_suStr); -t_print(%s\n, sStr.getStr()); +printf(%s\n, sStr.getStr()); } void toUTF8_mech(rtl::OUString const _suStr, rtl_UriEncodeMechanism _eMechanism) @@ -123,39 +124,15 @@ namespace Stringtest void toUTF8(rtl::OUString const _suStr) { -t_print(rtl_UriEncodeIgnoreEscapes \n); +printf(rtl_UriEncodeIgnoreEscapes \n); toUTF8_mech(_suStr, rtl_UriEncodeIgnoreEscapes); -t_print(\n); -t_print(# rtl_UriEncodeKeepEscapes\n); +printf(\n); +printf(# rtl_UriEncodeKeepEscapes\n); toUTF8_mech(_suStr, rtl_UriEncodeKeepEscapes); -t_print(\n); -t_print(# rtl_UriEncodeCheckEscapes\n); +printf(\n); +printf(# rtl_UriEncodeCheckEscapes\n); toUTF8_mech(_suStr, rtl_UriEncodeCheckEscapes); -t_print(\n); -} - -void test_FromUTF8_001() -{ -// string -- ustring -rtl::OString sStrUTF8(h%C3%A4llo); -rtl::OUString suStrUTF8 = rtl::OStringToOUString(sStrUTF8, RTL_TEXTENCODING_ASCII_US); - -// UTF8 -- real ustring -rtl::OUString suStr_UriDecodeToIuri = rtl::Uri::decode(suStrUTF8, rtl_UriDecodeToIuri, RTL_TEXTENCODING_UTF8); -showContent(suStr_UriDecodeToIuri); - -// string -- ustring -rtl::OString sStr(h\xE4llo); -