Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
240f9bcb
Kaydet (Commit)
240f9bcb
authored
Ara 19, 2014
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
No need for RTL_FAST_STRING in addition to LIBO_INTERNAL_ONLY
Change-Id: I5514898f588b21bafceefca95e3276826cb9a882
üst
d5c86be0
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
45 additions
and
112 deletions
+45
-112
Any.hxx
include/com/sun/star/uno/Any.hxx
+2
-2
strbuf.hxx
include/rtl/strbuf.hxx
+5
-20
string.hxx
include/rtl/string.hxx
+6
-11
stringconcat.hxx
include/rtl/stringconcat.hxx
+1
-1
stringutils.hxx
include/rtl/stringutils.hxx
+0
-6
ustrbuf.hxx
include/rtl/ustrbuf.hxx
+5
-20
ustring.hxx
include/rtl/ustring.hxx
+10
-21
test_ostring_concat.cxx
sal/qa/rtl/strings/test_ostring_concat.cxx
+10
-17
test_oustring_concat.cxx
sal/qa/rtl/strings/test_oustring_concat.cxx
+6
-14
No files found.
include/com/sun/star/uno/Any.hxx
Dosyayı görüntüle @
240f9bcb
...
...
@@ -190,7 +190,7 @@ inline Any SAL_CALL makeAny( bool const & value )
}
#ifdef
RTL_FAST_STRING
#ifdef
LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
template
<
class
C1
,
class
C2
>
inline
Any
SAL_CALL
makeAny
(
const
rtl
::
OUStringConcat
<
C1
,
C2
>&
value
)
{
...
...
@@ -220,7 +220,7 @@ inline void SAL_CALL operator <<= ( Any & rAny, bool const & value )
}
#ifdef
RTL_FAST_STRING
#ifdef
LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
template
<
class
C1
,
class
C2
>
inline
void
SAL_CALL
operator
<<=
(
Any
&
rAny
,
const
rtl
::
OUStringConcat
<
C1
,
C2
>&
value
)
{
...
...
include/rtl/strbuf.hxx
Dosyayı görüntüle @
240f9bcb
...
...
@@ -29,7 +29,7 @@
#include <rtl/string.hxx>
#include <rtl/stringutils.hxx>
#ifdef
RTL_FAST_STRING
#ifdef
LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
#include <rtl/stringconcat.hxx>
#endif
...
...
@@ -214,7 +214,7 @@ public:
rtl_stringbuffer_newFromStr_WithLength
(
&
pData
,
value
,
length
);
}
#ifdef
RTL_FAST_STRING
#ifdef
LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
/**
@overload
@internal
...
...
@@ -495,7 +495,7 @@ public:
return
*
this
;
}
#ifdef
RTL_FAST_STRING
#ifdef
LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
/**
@overload
@internal
...
...
@@ -940,21 +940,6 @@ public:
return
*
this
;
}
#ifdef LIBO_INTERNAL_ONLY
// This is to complement the RTL_FAST_STRING operator+, which allows any combination of valid operands,
// even two buffers. It's intentional it returns OString, just like the operator+ would in the fast variant.
#ifndef RTL_FAST_STRING
/**
@internal
@since LibreOffice 4.1
*/
friend
OString
operator
+
(
const
OStringBuffer
&
str1
,
const
OStringBuffer
&
str2
)
{
return
OString
(
str1
.
pData
).
concat
(
str2
.
pData
);
}
#endif
#endif
private
:
/**
A pointer to the data structure which contains the data.
...
...
@@ -967,7 +952,7 @@ private:
sal_Int32
nCapacity
;
};
#ifdef
RTL_FAST_STRING
#ifdef
LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
/**
@internal
*/
...
...
@@ -992,7 +977,7 @@ typedef rtlunittest::OStringBuffer OStringBuffer;
#undef RTL_STRING_CONST_FUNCTION
#endif
#if
def LIBO_INTERNAL_ONLY
#if
defined LIBO_INTERNAL_ONLY && !defined RTL_STRING_UNITTEST
using
::
rtl
::
OStringBuffer
;
#endif
...
...
include/rtl/string.hxx
Dosyayı görüntüle @
240f9bcb
...
...
@@ -31,7 +31,7 @@
#include <rtl/string.h>
#include <rtl/stringutils.hxx>
#ifdef
RTL_FAST_STRING
#ifdef
LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
#include <rtl/stringconcat.hxx>
#endif
...
...
@@ -231,7 +231,7 @@ public:
}
}
#ifdef
RTL_FAST_STRING
#ifdef
LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
/**
@overload
@internal
...
...
@@ -297,7 +297,7 @@ public:
return
*
this
;
}
#ifdef
RTL_FAST_STRING
#ifdef
LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
/**
@overload
@internal
...
...
@@ -1128,7 +1128,7 @@ public:
return
OString
(
pNew
,
SAL_NO_ACQUIRE
);
}
#ifndef
RTL_FAST_STRING
#ifndef
LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
friend
OString
operator
+
(
const
OString
&
str1
,
const
OString
&
str2
)
{
return
str1
.
concat
(
str2
);
...
...
@@ -1634,7 +1634,7 @@ public:
/* ======================================================================= */
#ifdef
RTL_FAST_STRING
#ifdef
LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
/**
A simple wrapper around string literal. It is usually not necessary to use, can
be mostly used to force OString operator+ working with operands that otherwise would
...
...
@@ -1684,11 +1684,6 @@ inline std::basic_ostream<charT, traits> & operator <<(
{
return
stream
<<
OString
(
concat
);
}
#else
// non-RTL_FAST_STRING needs this to compile
/// @cond INTERNAL
typedef
OString
OStringLiteral
;
/// @endcond
#endif
...
...
@@ -1752,7 +1747,7 @@ typedef rtlunittest::OString OString;
#undef RTL_STRING_CONST_FUNCTION
#endif
#if
def LIBO_INTERNAL_ONLY
#if
defined LIBO_INTERNAL_ONLY && !defined RTL_STRING_UNITTEST
using
::
rtl
::
OString
;
using
::
rtl
::
OStringHash
;
using
::
rtl
::
OStringLiteral
;
...
...
include/rtl/stringconcat.hxx
Dosyayı görüntüle @
240f9bcb
...
...
@@ -14,7 +14,7 @@
#include <string.h>
#ifdef
RTL_FAST_STRING
#ifdef
LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
#ifdef RTL_STRING_UNITTEST
#define rtl rtlunittest
...
...
include/rtl/stringutils.hxx
Dosyayı görüntüle @
240f9bcb
...
...
@@ -13,12 +13,6 @@
#include <sal/config.h>
#include <sal/types.h>
// This feature is not part of public API and is meant to be used only internally by LibreOffice.
#ifdef LIBO_INTERNAL_ONLY
// Enable fast string concatenation.
#define RTL_FAST_STRING
#endif
// The unittest uses slightly different code to help check that the proper
// calls are made. The class is put into a different namespace to make
// sure the compiler generates a different (if generating also non-inline)
...
...
include/rtl/ustrbuf.hxx
Dosyayı görüntüle @
240f9bcb
...
...
@@ -30,7 +30,7 @@
#include <rtl/stringutils.hxx>
#include <sal/types.h>
#ifdef
RTL_FAST_STRING
#ifdef
LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
#include <rtl/stringconcat.hxx>
#endif
...
...
@@ -184,7 +184,7 @@ public:
}
#endif
#ifdef
RTL_FAST_STRING
#ifdef
LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
/**
@overload
@internal
...
...
@@ -493,7 +493,7 @@ public:
return
*
this
;
}
#ifdef
RTL_FAST_STRING
#ifdef
LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
/**
@overload
@internal
...
...
@@ -1395,21 +1395,6 @@ public:
return
OUStringBuffer
(
pNew
,
count
+
16
);
}
#ifdef LIBO_INTERNAL_ONLY
// This is to complement the RTL_FAST_STRING operator+, which allows any combination of valid operands,
// even two buffers. It's intentional it returns OUString, just like the operator+ would in the fast variant.
#ifndef RTL_FAST_STRING
/**
@internal
@since LibreOffice 4.1
*/
friend
OUString
operator
+
(
const
OUStringBuffer
&
str1
,
const
OUStringBuffer
&
str2
)
{
return
OUString
(
str1
.
pData
).
concat
(
str2
.
pData
);
}
#endif
#endif
private
:
OUStringBuffer
(
rtl_uString
*
value
,
const
sal_Int32
capacity
)
{
...
...
@@ -1428,7 +1413,7 @@ private:
sal_Int32
nCapacity
;
};
#ifdef
RTL_FAST_STRING
#ifdef
LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
/**
@internal
*/
...
...
@@ -1451,7 +1436,7 @@ typedef rtlunittest::OUStringBuffer OUStringBuffer;
}
#endif
#if
def LIBO_INTERNAL_ONLY
#if
defined LIBO_INTERNAL_ONLY && !defined RTL_STRING_UNITTEST
using
::
rtl
::
OUStringBuffer
;
#endif
...
...
include/rtl/ustring.hxx
Dosyayı görüntüle @
240f9bcb
...
...
@@ -33,7 +33,7 @@
#include <rtl/textenc.h>
#include <sal/log.hxx>
#ifdef
RTL_FAST_STRING
#ifdef
LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
#include <rtl/stringconcat.hxx>
#endif
...
...
@@ -53,7 +53,7 @@ namespace rtl
#undef rtl
#endif
#if defined
RTL_FAST_STRING
#if defined
LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
/// @cond INTERNAL
/**
...
...
@@ -250,7 +250,7 @@ public:
}
#endif
#ifdef
RTL_FAST_STRING
#ifdef
LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
/// @cond INTERNAL
/**
New string from an 8-Bit string literal that is expected to contain only
...
...
@@ -324,7 +324,7 @@ public:
}
}
#ifdef
RTL_FAST_STRING
#ifdef
LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
/**
@overload
@internal
...
...
@@ -400,7 +400,7 @@ public:
return
*
this
;
}
#if defined
RTL_FAST_STRING
#if defined
LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
/// @cond INTERNAL
/** Assign a new string from a single ASCII character literal.
...
...
@@ -425,7 +425,7 @@ public:
return
*
this
;
}
#ifdef
RTL_FAST_STRING
#ifdef
LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
/**
@overload
@internal
...
...
@@ -1575,7 +1575,7 @@ public:
return
OUString
(
pNew
,
SAL_NO_ACQUIRE
);
}
#ifndef
RTL_FAST_STRING
#ifndef
LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
friend
OUString
operator
+
(
const
OUString
&
rStr1
,
const
OUString
&
rStr2
)
{
return
rStr1
.
concat
(
rStr2
);
...
...
@@ -2413,7 +2413,7 @@ public:
}
};
#if defined
RTL_FAST_STRING
#if defined
LIBO_INTERNAL_ONLY // "RTL_FAST_STRING"
/// @cond INTERNAL
/** Compare a string and an ASCII character literal for equality.
...
...
@@ -2436,12 +2436,6 @@ template<char C> bool operator !=(
return
!
(
string
==
literal
);
}
/// @endcond
#endif
/* ======================================================================= */
#ifdef RTL_FAST_STRING
/**
@internal
*/
...
...
@@ -2487,10 +2481,7 @@ inline std::basic_ostream<charT, traits> & operator <<(
{
return
stream
<<
OUString
(
concat
);
}
#else
// non-RTL_FAST_STRING needs this to compile
/// @cond INTERNAL
typedef
OUString
OUStringLiteral
;
/// @endcond
#endif
...
...
@@ -2596,16 +2587,14 @@ typedef rtlunittest::OUString OUString;
// In internal code, allow to use classes like OUString without having to
// explicitly refer to the rtl namespace, which is kind of superfluous given
// that OUString itself is namespaced by its OU prefix:
#if
def LIBO_INTERNAL_ONLY
#if
defined LIBO_INTERNAL_ONLY && !defined RTL_STRING_UNITTEST
using
::
rtl
::
OUString
;
using
::
rtl
::
OUStringHash
;
using
::
rtl
::
OStringToOUString
;
using
::
rtl
::
OUStringToOString
;
using
::
rtl
::
OUStringLiteral
;
#if defined RTL_FAST_STRING
using
::
rtl
::
OUStringLiteral1
;
#endif
#endif
#endif
/* _RTL_USTRING_HXX */
...
...
sal/qa/rtl/strings/test_ostring_concat.cxx
Dosyayı görüntüle @
240f9bcb
...
...
@@ -52,40 +52,35 @@ CPPUNIT_TEST(checkInvalid);
CPPUNIT_TEST_SUITE_END
();
};
#ifdef RTL_FAST_STRING
#define TYPES_ASSERT_EQUAL( a, b ) CPPUNIT_ASSERT_EQUAL( a, b )
#else
#define TYPES_ASSERT_EQUAL( a, b )
#endif
void
test
::
ostring
::
StringConcat
::
checkConcat
()
{
// All the extra () are to protect commas against being treated as separators of macro arguments.
CPPUNIT_ASSERT_EQUAL
(
OString
(),
OString
(
OString
()
+
OString
()));
CPPUNIT_ASSERT_EQUAL
(
OString
(
"foobar"
),
OString
(
OString
(
"foo"
)
+
OString
(
"bar"
)));
TYPES
_ASSERT_EQUAL
((
typeid
(
OStringConcat
<
OString
,
OString
>
)),
typeid
(
OString
(
"foo"
)
+
OString
(
"bar"
)));
CPPUNIT
_ASSERT_EQUAL
((
typeid
(
OStringConcat
<
OString
,
OString
>
)),
typeid
(
OString
(
"foo"
)
+
OString
(
"bar"
)));
CPPUNIT_ASSERT_EQUAL
(
OString
(
"foobar"
),
OString
(
OString
(
"foo"
)
+
"bar"
));
TYPES
_ASSERT_EQUAL
((
typeid
(
OStringConcat
<
OString
,
const
char
[
4
]
>
)),
typeid
(
OString
(
"foo"
)
+
"bar"
));
CPPUNIT
_ASSERT_EQUAL
((
typeid
(
OStringConcat
<
OString
,
const
char
[
4
]
>
)),
typeid
(
OString
(
"foo"
)
+
"bar"
));
CPPUNIT_ASSERT_EQUAL
(
OString
(
"foobarbaz"
),
OString
(
OString
(
"foo"
)
+
"bar"
+
"baz"
));
TYPES
_ASSERT_EQUAL
((
typeid
(
OStringConcat
<
OStringConcat
<
OString
,
const
char
[
4
]
>
,
const
char
[
4
]
>
)),
typeid
(
OString
(
"foo"
)
+
"bar"
+
"baz"
));
CPPUNIT
_ASSERT_EQUAL
((
typeid
(
OStringConcat
<
OStringConcat
<
OString
,
const
char
[
4
]
>
,
const
char
[
4
]
>
)),
typeid
(
OString
(
"foo"
)
+
"bar"
+
"baz"
));
CPPUNIT_ASSERT_EQUAL
(
OString
(
"foobar"
),
OString
(
OStringLiteral
(
"foo"
)
+
"bar"
));
TYPES
_ASSERT_EQUAL
((
typeid
(
OStringConcat
<
OStringLiteral
,
const
char
[
4
]
>
)),
typeid
(
OStringLiteral
(
"foo"
)
+
"bar"
));
CPPUNIT
_ASSERT_EQUAL
((
typeid
(
OStringConcat
<
OStringLiteral
,
const
char
[
4
]
>
)),
typeid
(
OStringLiteral
(
"foo"
)
+
"bar"
));
CPPUNIT_ASSERT_EQUAL
(
OString
(
"foobar"
),
OString
(
OStringLiteral
(
"foo"
)
+
(
const
char
*
)
"bar"
));
TYPES
_ASSERT_EQUAL
((
typeid
(
OStringConcat
<
OStringLiteral
,
const
char
*
>
)),
typeid
(
OStringLiteral
(
"foo"
)
+
(
const
char
*
)
"bar"
));
CPPUNIT
_ASSERT_EQUAL
((
typeid
(
OStringConcat
<
OStringLiteral
,
const
char
*
>
)),
typeid
(
OStringLiteral
(
"foo"
)
+
(
const
char
*
)
"bar"
));
const
char
d1
[]
=
"xyz"
;
char
d2
[]
=
"abc"
;
const
char
*
d3
=
d1
;
char
*
d4
=
d2
;
CPPUNIT_ASSERT_EQUAL
(
OString
(
"fooxyz"
),
OString
(
OString
(
"foo"
)
+
d1
));
TYPES
_ASSERT_EQUAL
((
typeid
(
OStringConcat
<
OString
,
const
char
[
4
]
>
)),
typeid
(
OString
(
"foo"
)
+
d1
));
CPPUNIT
_ASSERT_EQUAL
((
typeid
(
OStringConcat
<
OString
,
const
char
[
4
]
>
)),
typeid
(
OString
(
"foo"
)
+
d1
));
CPPUNIT_ASSERT_EQUAL
(
OString
(
"fooabc"
),
OString
(
OString
(
"foo"
)
+
d2
));
TYPES
_ASSERT_EQUAL
((
typeid
(
OStringConcat
<
OString
,
char
[
4
]
>
)),
typeid
(
OString
(
"foo"
)
+
d2
));
CPPUNIT
_ASSERT_EQUAL
((
typeid
(
OStringConcat
<
OString
,
char
[
4
]
>
)),
typeid
(
OString
(
"foo"
)
+
d2
));
CPPUNIT_ASSERT_EQUAL
(
OString
(
"fooxyz"
),
OString
(
OString
(
"foo"
)
+
d3
));
TYPES
_ASSERT_EQUAL
((
typeid
(
OStringConcat
<
OString
,
const
char
*
>
)),
typeid
(
OString
(
"foo"
)
+
d3
));
CPPUNIT
_ASSERT_EQUAL
((
typeid
(
OStringConcat
<
OString
,
const
char
*
>
)),
typeid
(
OString
(
"foo"
)
+
d3
));
CPPUNIT_ASSERT_EQUAL
(
OString
(
"fooabc"
),
OString
(
OString
(
"foo"
)
+
d4
));
TYPES
_ASSERT_EQUAL
((
typeid
(
OStringConcat
<
OString
,
char
*
>
)),
typeid
(
OString
(
"foo"
)
+
d4
));
CPPUNIT
_ASSERT_EQUAL
((
typeid
(
OStringConcat
<
OString
,
char
*
>
)),
typeid
(
OString
(
"foo"
)
+
d4
));
#ifdef __GNUC__
CPPUNIT_ASSERT_EQUAL
(
OString
(
"foobar"
),
OString
(
OStringBuffer
(
"foo"
)
+
OString
(
"bar"
)));
TYPES
_ASSERT_EQUAL
((
typeid
(
OStringConcat
<
OStringBuffer
,
OString
>
)),
typeid
(
OStringBuffer
(
"foo"
)
+
OString
(
"bar"
)));
CPPUNIT
_ASSERT_EQUAL
((
typeid
(
OStringConcat
<
OStringBuffer
,
OString
>
)),
typeid
(
OStringBuffer
(
"foo"
)
+
OString
(
"bar"
)));
#endif
}
...
...
@@ -145,7 +140,6 @@ void test::ostring::StringConcat::checkAppend()
void
test
::
ostring
::
StringConcat
::
checkInvalid
()
{
#ifdef RTL_FAST_STRING
CPPUNIT_ASSERT
(
!
INVALID_CONCAT
(
OString
()
+
OString
()));
CPPUNIT_ASSERT
(
INVALID_CONCAT
(
OString
(
"a"
)
+
OUString
(
"b"
)));
CPPUNIT_ASSERT
(
INVALID_CONCAT
(
OString
(
"a"
)
+
OUStringBuffer
(
"b"
)));
...
...
@@ -155,7 +149,6 @@ void test::ostring::StringConcat::checkInvalid()
rtl_uString
*
rus
=
NULL
;
CPPUNIT_ASSERT
(
INVALID_CONCAT
(
OUString
(
"b"
)
+
rs
));
CPPUNIT_ASSERT
(
INVALID_CONCAT
(
OUString
(
"b"
)
+
rus
));
#endif
}
}}
// namespace
...
...
sal/qa/rtl/strings/test_oustring_concat.cxx
Dosyayı görüntüle @
240f9bcb
...
...
@@ -52,28 +52,23 @@ CPPUNIT_TEST(checkInvalid);
CPPUNIT_TEST_SUITE_END
();
};
#ifdef RTL_FAST_STRING
#define TYPES_ASSERT_EQUAL( a, b ) CPPUNIT_ASSERT_EQUAL( a, b )
#else
#define TYPES_ASSERT_EQUAL( a, b )
#endif
void
test
::
oustring
::
StringConcat
::
checkConcat
()
{
// All the extra () are to protect commas against being treated as separators of macro arguments.
CPPUNIT_ASSERT_EQUAL
(
OUString
(),
OUString
(
OUString
()
+
OUString
()));
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"foobar"
),
OUString
(
OUString
(
"foo"
)
+
OUString
(
"bar"
)));
TYPES
_ASSERT_EQUAL
((
typeid
(
OUStringConcat
<
OUString
,
OUString
>
)),
typeid
(
OUString
(
"foo"
)
+
OUString
(
"bar"
)));
CPPUNIT
_ASSERT_EQUAL
((
typeid
(
OUStringConcat
<
OUString
,
OUString
>
)),
typeid
(
OUString
(
"foo"
)
+
OUString
(
"bar"
)));
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"foobar"
),
OUString
(
OUString
(
"foo"
)
+
"bar"
));
TYPES
_ASSERT_EQUAL
((
typeid
(
OUStringConcat
<
OUString
,
const
char
[
4
]
>
)),
typeid
(
OUString
(
"foo"
)
+
"bar"
));
CPPUNIT
_ASSERT_EQUAL
((
typeid
(
OUStringConcat
<
OUString
,
const
char
[
4
]
>
)),
typeid
(
OUString
(
"foo"
)
+
"bar"
));
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"foobarbaz"
),
OUString
(
OUString
(
"foo"
)
+
"bar"
+
"baz"
));
TYPES
_ASSERT_EQUAL
((
typeid
(
OUStringConcat
<
OUStringConcat
<
OUString
,
const
char
[
4
]
>
,
const
char
[
4
]
>
)),
typeid
(
OUString
(
"foo"
)
+
"bar"
+
"baz"
));
CPPUNIT
_ASSERT_EQUAL
((
typeid
(
OUStringConcat
<
OUStringConcat
<
OUString
,
const
char
[
4
]
>
,
const
char
[
4
]
>
)),
typeid
(
OUString
(
"foo"
)
+
"bar"
+
"baz"
));
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"foobar"
),
OUString
(
OUStringLiteral
(
"foo"
)
+
"bar"
));
TYPES
_ASSERT_EQUAL
((
typeid
(
OUStringConcat
<
OUStringLiteral
,
const
char
[
4
]
>
)),
typeid
(
OUStringLiteral
(
"foo"
)
+
"bar"
));
CPPUNIT
_ASSERT_EQUAL
((
typeid
(
OUStringConcat
<
OUStringLiteral
,
const
char
[
4
]
>
)),
typeid
(
OUStringLiteral
(
"foo"
)
+
"bar"
));
const
char
d1
[]
=
"xyz"
;
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"fooxyz"
),
OUString
(
OUString
(
"foo"
)
+
d1
));
TYPES
_ASSERT_EQUAL
((
typeid
(
OUStringConcat
<
OUString
,
const
char
[
4
]
>
)),
typeid
(
OUString
(
"foo"
)
+
d1
));
CPPUNIT
_ASSERT_EQUAL
((
typeid
(
OUStringConcat
<
OUString
,
const
char
[
4
]
>
)),
typeid
(
OUString
(
"foo"
)
+
d1
));
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"foobar"
),
OUString
(
OUStringBuffer
(
"foo"
)
+
OUString
(
"bar"
)));
TYPES
_ASSERT_EQUAL
((
typeid
(
OUStringConcat
<
OUStringBuffer
,
OUString
>
)),
typeid
(
OUStringBuffer
(
"foo"
)
+
OUString
(
"bar"
)));
CPPUNIT
_ASSERT_EQUAL
((
typeid
(
OUStringConcat
<
OUStringBuffer
,
OUString
>
)),
typeid
(
OUStringBuffer
(
"foo"
)
+
OUString
(
"bar"
)));
}
void
test
::
oustring
::
StringConcat
::
checkEnsureCapacity
()
...
...
@@ -136,7 +131,6 @@ void test::oustring::StringConcat::checkAppend()
void
test
::
oustring
::
StringConcat
::
checkInvalid
()
{
#ifdef RTL_FAST_STRING
CPPUNIT_ASSERT
(
!
INVALID_CONCAT
(
OUString
()
+
OUString
()));
CPPUNIT_ASSERT
(
INVALID_CONCAT
(
OUString
(
"a"
)
+
OString
(
"b"
)));
CPPUNIT_ASSERT
(
INVALID_CONCAT
(
OUString
(
"a"
)
+
OStringBuffer
(
"b"
)));
...
...
@@ -150,8 +144,6 @@ void test::oustring::StringConcat::checkInvalid()
rtl_uString
*
rus
=
NULL
;
CPPUNIT_ASSERT
(
INVALID_CONCAT
(
OUString
(
"b"
)
+
rs
));
CPPUNIT_ASSERT
(
INVALID_CONCAT
(
OUString
(
"b"
)
+
rus
));
#endif
}
}}
// namespace
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment