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
3591554d
Kaydet (Commit)
3591554d
authored
Nis 27, 2015
tarafından
Stephan Bergmann
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
More loplugin:simplifybool
Change-Id: I9414d9167213c0156fb97559a8af5e55a4e1c1de
üst
badc69d7
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
61 additions
and
61 deletions
+61
-61
profile.cxx
sal/osl/unx/profile.cxx
+7
-7
rtl_alloc.cxx
sal/qa/rtl/alloc/rtl_alloc.cxx
+4
-4
rtl_OUString2.cxx
sal/qa/rtl/oustring/rtl_OUString2.cxx
+27
-27
test_ostring_stringliterals.cxx
sal/qa/rtl/strings/test_ostring_stringliterals.cxx
+22
-22
test_oustring_stringliterals.cxx
sal/qa/rtl/strings/test_oustring_stringliterals.cxx
+1
-1
No files found.
sal/osl/unx/profile.cxx
Dosyayı görüntüle @
3591554d
...
@@ -196,7 +196,7 @@ sal_Bool SAL_CALL osl_closeProfile(oslProfile Profile)
...
@@ -196,7 +196,7 @@ sal_Bool SAL_CALL osl_closeProfile(oslProfile Profile)
pthread_mutex_lock
(
&
(
pProfile
->
m_AccessLock
));
pthread_mutex_lock
(
&
(
pProfile
->
m_AccessLock
));
if
(
pProfile
->
m_bIsValid
==
false
)
if
(
!
pProfile
->
m_bIsValid
)
{
{
SAL_WARN
(
"sal.osl"
,
"!pProfile->m_bIsValid"
);
SAL_WARN
(
"sal.osl"
,
"!pProfile->m_bIsValid"
);
pthread_mutex_unlock
(
&
(
pProfile
->
m_AccessLock
));
pthread_mutex_unlock
(
&
(
pProfile
->
m_AccessLock
));
...
@@ -293,7 +293,7 @@ sal_Bool SAL_CALL osl_flushProfile(oslProfile Profile)
...
@@ -293,7 +293,7 @@ sal_Bool SAL_CALL osl_flushProfile(oslProfile Profile)
pthread_mutex_lock
(
&
(
pProfile
->
m_AccessLock
));
pthread_mutex_lock
(
&
(
pProfile
->
m_AccessLock
));
if
(
pProfile
->
m_bIsValid
==
false
)
if
(
!
pProfile
->
m_bIsValid
)
{
{
SAL_WARN_IF
(
!
pProfile
->
m_bIsValid
,
"sal.osl"
,
"!pProfile->m_bIsValid"
);
SAL_WARN_IF
(
!
pProfile
->
m_bIsValid
,
"sal.osl"
,
"!pProfile->m_bIsValid"
);
pthread_mutex_unlock
(
&
(
pProfile
->
m_AccessLock
));
pthread_mutex_unlock
(
&
(
pProfile
->
m_AccessLock
));
...
@@ -370,7 +370,7 @@ sal_Bool SAL_CALL osl_readProfileString(oslProfile Profile,
...
@@ -370,7 +370,7 @@ sal_Bool SAL_CALL osl_readProfileString(oslProfile Profile,
pthread_mutex_lock
(
&
(
pTmpProfile
->
m_AccessLock
));
pthread_mutex_lock
(
&
(
pTmpProfile
->
m_AccessLock
));
if
(
pTmpProfile
->
m_bIsValid
==
false
)
if
(
!
pTmpProfile
->
m_bIsValid
)
{
{
pthread_mutex_unlock
(
&
(
pTmpProfile
->
m_AccessLock
));
pthread_mutex_unlock
(
&
(
pTmpProfile
->
m_AccessLock
));
...
@@ -504,7 +504,7 @@ sal_Bool SAL_CALL osl_writeProfileString(oslProfile Profile,
...
@@ -504,7 +504,7 @@ sal_Bool SAL_CALL osl_writeProfileString(oslProfile Profile,
pthread_mutex_lock
(
&
(
pTmpProfile
->
m_AccessLock
));
pthread_mutex_lock
(
&
(
pTmpProfile
->
m_AccessLock
));
if
(
pTmpProfile
->
m_bIsValid
==
false
)
if
(
!
pTmpProfile
->
m_bIsValid
)
{
{
SAL_WARN_IF
(
!
pTmpProfile
->
m_bIsValid
,
"sal.osl"
,
"!pTmpProfile->m_bIsValid"
);
SAL_WARN_IF
(
!
pTmpProfile
->
m_bIsValid
,
"sal.osl"
,
"!pTmpProfile->m_bIsValid"
);
pthread_mutex_unlock
(
&
(
pTmpProfile
->
m_AccessLock
));
pthread_mutex_unlock
(
&
(
pTmpProfile
->
m_AccessLock
));
...
@@ -657,7 +657,7 @@ sal_Bool SAL_CALL osl_removeProfileEntry(oslProfile Profile,
...
@@ -657,7 +657,7 @@ sal_Bool SAL_CALL osl_removeProfileEntry(oslProfile Profile,
pthread_mutex_lock
(
&
(
pTmpProfile
->
m_AccessLock
));
pthread_mutex_lock
(
&
(
pTmpProfile
->
m_AccessLock
));
if
(
pTmpProfile
->
m_bIsValid
==
false
)
if
(
!
pTmpProfile
->
m_bIsValid
)
{
{
SAL_WARN_IF
(
!
pTmpProfile
->
m_bIsValid
,
"sal.osl"
,
"!pTmpProfile->m_bIsValid"
);
SAL_WARN_IF
(
!
pTmpProfile
->
m_bIsValid
,
"sal.osl"
,
"!pTmpProfile->m_bIsValid"
);
pthread_mutex_unlock
(
&
(
pTmpProfile
->
m_AccessLock
));
pthread_mutex_unlock
(
&
(
pTmpProfile
->
m_AccessLock
));
...
@@ -727,7 +727,7 @@ sal_uInt32 SAL_CALL osl_getProfileSectionEntries(oslProfile Profile,
...
@@ -727,7 +727,7 @@ sal_uInt32 SAL_CALL osl_getProfileSectionEntries(oslProfile Profile,
pthread_mutex_lock
(
&
(
pTmpProfile
->
m_AccessLock
));
pthread_mutex_lock
(
&
(
pTmpProfile
->
m_AccessLock
));
if
(
pTmpProfile
->
m_bIsValid
==
false
)
if
(
!
pTmpProfile
->
m_bIsValid
)
{
{
SAL_WARN_IF
(
!
pTmpProfile
->
m_bIsValid
,
"sal.osl"
,
"!pTmpProfile->m_bIsValid"
);
SAL_WARN_IF
(
!
pTmpProfile
->
m_bIsValid
,
"sal.osl"
,
"!pTmpProfile->m_bIsValid"
);
...
@@ -810,7 +810,7 @@ sal_uInt32 SAL_CALL osl_getProfileSections(oslProfile Profile,
...
@@ -810,7 +810,7 @@ sal_uInt32 SAL_CALL osl_getProfileSections(oslProfile Profile,
pthread_mutex_lock
(
&
(
pTmpProfile
->
m_AccessLock
));
pthread_mutex_lock
(
&
(
pTmpProfile
->
m_AccessLock
));
if
(
pTmpProfile
->
m_bIsValid
==
false
)
if
(
!
pTmpProfile
->
m_bIsValid
)
{
{
SAL_WARN_IF
(
!
pTmpProfile
->
m_bIsValid
,
"sal.osl"
,
"!pTmpProfile->m_bIsValid"
);
SAL_WARN_IF
(
!
pTmpProfile
->
m_bIsValid
,
"sal.osl"
,
"!pTmpProfile->m_bIsValid"
);
pthread_mutex_unlock
(
&
(
pTmpProfile
->
m_AccessLock
));
pthread_mutex_unlock
(
&
(
pTmpProfile
->
m_AccessLock
));
...
...
sal/qa/rtl/alloc/rtl_alloc.cxx
Dosyayı görüntüle @
3591554d
...
@@ -73,7 +73,7 @@ public:
...
@@ -73,7 +73,7 @@ public:
{
{
CPPUNIT_ASSERT_MESSAGE
(
"Can get zero memory."
,
m_pMemory
!=
NULL
);
CPPUNIT_ASSERT_MESSAGE
(
"Can get zero memory."
,
m_pMemory
!=
NULL
);
memset
(
m_pMemory
,
1
,
m_nSizeOfMemory
);
memset
(
m_pMemory
,
1
,
m_nSizeOfMemory
);
CPPUNIT_ASSERT_MESSAGE
(
"memory contains wrong value."
,
checkMemory
(
m_pMemory
,
m_nSizeOfMemory
,
1
)
==
true
);
CPPUNIT_ASSERT_MESSAGE
(
"memory contains wrong value."
,
checkMemory
(
m_pMemory
,
m_nSizeOfMemory
,
1
));
}
}
void
rtl_reallocateMemory_001
()
void
rtl_reallocateMemory_001
()
...
@@ -83,7 +83,7 @@ public:
...
@@ -83,7 +83,7 @@ public:
CPPUNIT_ASSERT_MESSAGE
(
"Can reallocate memory."
,
m_pMemory
!=
NULL
);
CPPUNIT_ASSERT_MESSAGE
(
"Can reallocate memory."
,
m_pMemory
!=
NULL
);
memset
(
m_pMemory
,
2
,
nSize
);
memset
(
m_pMemory
,
2
,
nSize
);
CPPUNIT_ASSERT_MESSAGE
(
"memory contains wrong value."
,
checkMemory
(
m_pMemory
,
nSize
,
2
)
==
true
);
CPPUNIT_ASSERT_MESSAGE
(
"memory contains wrong value."
,
checkMemory
(
m_pMemory
,
nSize
,
2
));
}
}
CPPUNIT_TEST_SUITE
(
Memory
);
CPPUNIT_TEST_SUITE
(
Memory
);
...
@@ -123,10 +123,10 @@ public:
...
@@ -123,10 +123,10 @@ public:
void
rtl_allocateZeroMemory_001
()
void
rtl_allocateZeroMemory_001
()
{
{
CPPUNIT_ASSERT_MESSAGE
(
"Can get zero memory."
,
m_pZeroMemory
!=
NULL
);
CPPUNIT_ASSERT_MESSAGE
(
"Can get zero memory."
,
m_pZeroMemory
!=
NULL
);
CPPUNIT_ASSERT_MESSAGE
(
"memory contains wrong value."
,
checkMemory
(
m_pZeroMemory
,
m_nSizeOfZeroMemory
,
0
)
==
true
);
CPPUNIT_ASSERT_MESSAGE
(
"memory contains wrong value."
,
checkMemory
(
m_pZeroMemory
,
m_nSizeOfZeroMemory
,
0
));
memset
(
m_pZeroMemory
,
3
,
m_nSizeOfZeroMemory
);
memset
(
m_pZeroMemory
,
3
,
m_nSizeOfZeroMemory
);
CPPUNIT_ASSERT_MESSAGE
(
"memory contains wrong value."
,
checkMemory
(
m_pZeroMemory
,
m_nSizeOfZeroMemory
,
3
)
==
true
);
CPPUNIT_ASSERT_MESSAGE
(
"memory contains wrong value."
,
checkMemory
(
m_pZeroMemory
,
m_nSizeOfZeroMemory
,
3
));
}
}
CPPUNIT_TEST_SUITE
(
TestZeroMemory
);
CPPUNIT_TEST_SUITE
(
TestZeroMemory
);
...
...
sal/qa/rtl/oustring/rtl_OUString2.cxx
Dosyayı görüntüle @
3591554d
...
@@ -62,7 +62,7 @@ class number : public CppUnit::TestFixture
...
@@ -62,7 +62,7 @@ class number : public CppUnit::TestFixture
double
nValueATOF
=
doubleToFloat
(
atof
(
sValue
.
getStr
()
));
double
nValueATOF
=
doubleToFloat
(
atof
(
sValue
.
getStr
()
));
bool
bEqualResult
=
is_float_equal
(
_nValue
,
nValueATOF
);
bool
bEqualResult
=
is_float_equal
(
_nValue
,
nValueATOF
);
CPPUNIT_ASSERT_MESSAGE
(
"Values are not equal."
,
bEqualResult
==
true
);
CPPUNIT_ASSERT_MESSAGE
(
"Values are not equal."
,
bEqualResult
);
}
}
void
number_float_test
(
float
_nValue
)
void
number_float_test
(
float
_nValue
)
...
@@ -133,7 +133,7 @@ private:
...
@@ -133,7 +133,7 @@ private:
double
nValueATOF
=
atof
(
sValue
.
getStr
()
);
double
nValueATOF
=
atof
(
sValue
.
getStr
()
);
bool
bEqualResult
=
is_double_equal
(
_nValue
,
nValueATOF
);
bool
bEqualResult
=
is_double_equal
(
_nValue
,
nValueATOF
);
CPPUNIT_ASSERT_MESSAGE
(
"Values are not equal."
,
bEqualResult
==
true
);
CPPUNIT_ASSERT_MESSAGE
(
"Values are not equal."
,
bEqualResult
);
}
}
void
number_double_test
(
double
_nValue
)
void
number_double_test
(
double
_nValue
)
...
@@ -256,7 +256,7 @@ public:
...
@@ -256,7 +256,7 @@ public:
//printf("result data is %e\n", nValueToDouble);
//printf("result data is %e\n", nValueToDouble);
bool
bEqualResult
=
is_double_equal
(
nValueToDouble
,
nValueATOF
);
bool
bEqualResult
=
is_double_equal
(
nValueToDouble
,
nValueATOF
);
CPPUNIT_ASSERT_MESSAGE
(
"Values are not equal."
,
bEqualResult
==
true
);
CPPUNIT_ASSERT_MESSAGE
(
"Values are not equal."
,
bEqualResult
);
}
}
void
toDouble_test
(
rtl
::
OString
const
&
_sValue
)
void
toDouble_test
(
rtl
::
OString
const
&
_sValue
)
...
@@ -273,22 +273,22 @@ public:
...
@@ -273,22 +273,22 @@ public:
void
toDouble_selftest
()
void
toDouble_selftest
()
{
{
printf
(
"Start selftest:
\n
"
);
printf
(
"Start selftest:
\n
"
);
CPPUNIT_ASSERT
(
is_double_equal
(
1.0
,
1.01
)
==
false
);
CPPUNIT_ASSERT
(
!
is_double_equal
(
1.0
,
1.01
)
);
CPPUNIT_ASSERT
(
is_double_equal
(
1.0
,
1.001
)
==
false
);
CPPUNIT_ASSERT
(
!
is_double_equal
(
1.0
,
1.001
)
);
CPPUNIT_ASSERT
(
is_double_equal
(
1.0
,
1.0001
)
==
false
);
CPPUNIT_ASSERT
(
!
is_double_equal
(
1.0
,
1.0001
)
);
CPPUNIT_ASSERT
(
is_double_equal
(
1.0
,
1.00001
)
==
false
);
CPPUNIT_ASSERT
(
!
is_double_equal
(
1.0
,
1.00001
)
);
CPPUNIT_ASSERT
(
is_double_equal
(
1.0
,
1.000001
)
==
false
);
CPPUNIT_ASSERT
(
!
is_double_equal
(
1.0
,
1.000001
)
);
CPPUNIT_ASSERT
(
is_double_equal
(
1.0
,
1.0000001
)
==
false
);
CPPUNIT_ASSERT
(
!
is_double_equal
(
1.0
,
1.0000001
)
);
CPPUNIT_ASSERT
(
is_double_equal
(
1.0
,
1.00000001
)
==
false
);
CPPUNIT_ASSERT
(
!
is_double_equal
(
1.0
,
1.00000001
)
);
CPPUNIT_ASSERT
(
is_double_equal
(
1.0
,
1.000000001
)
==
false
);
CPPUNIT_ASSERT
(
!
is_double_equal
(
1.0
,
1.000000001
)
);
CPPUNIT_ASSERT
(
is_double_equal
(
1.0
,
1.0000000001
)
==
false
);
CPPUNIT_ASSERT
(
!
is_double_equal
(
1.0
,
1.0000000001
)
);
CPPUNIT_ASSERT
(
is_double_equal
(
1.0
,
1.00000000001
)
==
false
);
CPPUNIT_ASSERT
(
!
is_double_equal
(
1.0
,
1.00000000001
)
);
CPPUNIT_ASSERT
(
is_double_equal
(
1.0
,
1.000000000001
)
==
false
);
CPPUNIT_ASSERT
(
!
is_double_equal
(
1.0
,
1.000000000001
)
);
CPPUNIT_ASSERT
(
is_double_equal
(
1.0
,
1.0000000000001
)
==
false
);
CPPUNIT_ASSERT
(
!
is_double_equal
(
1.0
,
1.0000000000001
)
);
// we check til 15 values after comma
// we check til 15 values after comma
CPPUNIT_ASSERT
(
is_double_equal
(
1.0
,
1.00000000000001
)
==
true
);
CPPUNIT_ASSERT
(
is_double_equal
(
1.0
,
1.00000000000001
));
CPPUNIT_ASSERT
(
is_double_equal
(
1.0
,
1.000000000000001
)
==
true
);
CPPUNIT_ASSERT
(
is_double_equal
(
1.0
,
1.000000000000001
));
CPPUNIT_ASSERT
(
is_double_equal
(
1.0
,
1.0000000000000001
)
==
true
);
CPPUNIT_ASSERT
(
is_double_equal
(
1.0
,
1.0000000000000001
));
printf
(
"Selftest done.
\n
"
);
printf
(
"Selftest done.
\n
"
);
}
}
...
@@ -391,7 +391,7 @@ public:
...
@@ -391,7 +391,7 @@ public:
//printf("the result str is %.10f\n", nValueToFloat);
//printf("the result str is %.10f\n", nValueToFloat);
bool
bEqualResult
=
is_float_equal
(
nValueToFloat
,
nValueATOF
);
bool
bEqualResult
=
is_float_equal
(
nValueToFloat
,
nValueATOF
);
CPPUNIT_ASSERT_MESSAGE
(
"Values are not equal."
,
bEqualResult
==
true
);
CPPUNIT_ASSERT_MESSAGE
(
"Values are not equal."
,
bEqualResult
);
}
}
void
toFloat_test
(
rtl
::
OString
const
&
_sValue
)
void
toFloat_test
(
rtl
::
OString
const
&
_sValue
)
...
@@ -408,14 +408,14 @@ public:
...
@@ -408,14 +408,14 @@ public:
void
toFloat_selftest
()
void
toFloat_selftest
()
{
{
printf
(
"Start selftest:
\n
"
);
printf
(
"Start selftest:
\n
"
);
CPPUNIT_ASSERT
(
is_float_equal
(
1.0
f
,
1.01
f
)
==
false
);
CPPUNIT_ASSERT
(
!
is_float_equal
(
1.0
f
,
1.01
f
)
);
CPPUNIT_ASSERT
(
is_float_equal
(
1.0
f
,
1.001
f
)
==
false
);
CPPUNIT_ASSERT
(
!
is_float_equal
(
1.0
f
,
1.001
f
)
);
CPPUNIT_ASSERT
(
is_float_equal
(
1.0
f
,
1.0001
f
)
==
false
);
CPPUNIT_ASSERT
(
!
is_float_equal
(
1.0
f
,
1.0001
f
)
);
CPPUNIT_ASSERT
(
is_float_equal
(
1.0
f
,
1.00001
f
)
==
false
);
CPPUNIT_ASSERT
(
!
is_float_equal
(
1.0
f
,
1.00001
f
)
);
CPPUNIT_ASSERT
(
is_float_equal
(
1.0
f
,
1.000002
f
)
==
false
);
CPPUNIT_ASSERT
(
!
is_float_equal
(
1.0
f
,
1.000002
f
)
);
CPPUNIT_ASSERT
(
is_float_equal
(
1.0
f
,
1.0000001
f
)
==
true
);
CPPUNIT_ASSERT
(
is_float_equal
(
1.0
f
,
1.0000001
f
));
CPPUNIT_ASSERT
(
is_float_equal
(
1.0
f
,
1.00000001
f
)
==
true
);
CPPUNIT_ASSERT
(
is_float_equal
(
1.0
f
,
1.00000001
f
));
CPPUNIT_ASSERT
(
is_float_equal
(
1.0
f
,
1.000000001
f
)
==
true
);
CPPUNIT_ASSERT
(
is_float_equal
(
1.0
f
,
1.000000001
f
));
printf
(
"Selftest done.
\n
"
);
printf
(
"Selftest done.
\n
"
);
}
}
...
...
sal/qa/rtl/strings/test_ostring_stringliterals.cxx
Dosyayı görüntüle @
3591554d
...
@@ -126,53 +126,53 @@ void test::ostring::StringLiterals::checkUsage()
...
@@ -126,53 +126,53 @@ void test::ostring::StringLiterals::checkUsage()
rtl_string_unittest_non_const_literal_function
=
false
;
// and check for non-const variants
rtl_string_unittest_non_const_literal_function
=
false
;
// and check for non-const variants
rtl_string_unittest_const_literal_function
=
false
;
rtl_string_unittest_const_literal_function
=
false
;
CPPUNIT_ASSERT_EQUAL
(
foo
,
rtl
::
OString
()
=
"foo"
);
CPPUNIT_ASSERT_EQUAL
(
foo
,
rtl
::
OString
()
=
"foo"
);
CPPUNIT_ASSERT
(
rtl_string_unittest_const_literal_function
==
true
);
CPPUNIT_ASSERT
(
rtl_string_unittest_const_literal_function
);
rtl_string_unittest_const_literal_function
=
false
;
rtl_string_unittest_const_literal_function
=
false
;
CPPUNIT_ASSERT
(
FoO
.
equalsIgnoreAsciiCase
(
"fOo"
));
CPPUNIT_ASSERT
(
FoO
.
equalsIgnoreAsciiCase
(
"fOo"
));
CPPUNIT_ASSERT
(
rtl_string_unittest_const_literal_function
==
true
);
CPPUNIT_ASSERT
(
rtl_string_unittest_const_literal_function
);
rtl_string_unittest_const_literal_function
=
false
;
rtl_string_unittest_const_literal_function
=
false
;
CPPUNIT_ASSERT
(
foobarfoo
.
match
(
"bar"
,
3
));
CPPUNIT_ASSERT
(
foobarfoo
.
match
(
"bar"
,
3
));
CPPUNIT_ASSERT
(
rtl_string_unittest_const_literal_function
==
true
);
CPPUNIT_ASSERT
(
rtl_string_unittest_const_literal_function
);
rtl_string_unittest_const_literal_function
=
false
;
rtl_string_unittest_const_literal_function
=
false
;
CPPUNIT_ASSERT
(
foobar
.
match
(
"foo"
));
CPPUNIT_ASSERT
(
foobar
.
match
(
"foo"
));
CPPUNIT_ASSERT
(
rtl_string_unittest_const_literal_function
==
true
);
CPPUNIT_ASSERT
(
rtl_string_unittest_const_literal_function
);
rtl_string_unittest_const_literal_function
=
false
;
rtl_string_unittest_const_literal_function
=
false
;
CPPUNIT_ASSERT
(
FooBaRfoo
.
matchIgnoreAsciiCase
(
"bAr"
,
3
));
CPPUNIT_ASSERT
(
FooBaRfoo
.
matchIgnoreAsciiCase
(
"bAr"
,
3
));
CPPUNIT_ASSERT
(
rtl_string_unittest_const_literal_function
==
true
);
CPPUNIT_ASSERT
(
rtl_string_unittest_const_literal_function
);
rtl_string_unittest_const_literal_function
=
false
;
rtl_string_unittest_const_literal_function
=
false
;
CPPUNIT_ASSERT
(
FooBaR
.
matchIgnoreAsciiCase
(
"fOo"
));
CPPUNIT_ASSERT
(
FooBaR
.
matchIgnoreAsciiCase
(
"fOo"
));
CPPUNIT_ASSERT
(
rtl_string_unittest_const_literal_function
==
true
);
CPPUNIT_ASSERT
(
rtl_string_unittest_const_literal_function
);
rtl_string_unittest_const_literal_function
=
false
;
rtl_string_unittest_const_literal_function
=
false
;
CPPUNIT_ASSERT
(
foobar
.
startsWith
(
"foo"
));
CPPUNIT_ASSERT
(
foobar
.
startsWith
(
"foo"
));
CPPUNIT_ASSERT
(
rtl_string_unittest_const_literal_function
==
true
);
CPPUNIT_ASSERT
(
rtl_string_unittest_const_literal_function
);
rtl_string_unittest_const_literal_function
=
false
;
rtl_string_unittest_const_literal_function
=
false
;
CPPUNIT_ASSERT
(
foobar
.
endsWith
(
"bar"
));
CPPUNIT_ASSERT
(
foobar
.
endsWith
(
"bar"
));
CPPUNIT_ASSERT
(
rtl_string_unittest_const_literal_function
==
true
);
CPPUNIT_ASSERT
(
rtl_string_unittest_const_literal_function
);
// rtl_string_unittest_const_literal_function = false;
// rtl_string_unittest_const_literal_function = false;
// CPPUNIT_ASSERT( FooBaR.endsWithIgnoreAsciiCase( "bar" ));
// CPPUNIT_ASSERT( FooBaR.endsWithIgnoreAsciiCase( "bar" ));
// CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
// CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
rtl_string_unittest_const_literal_function
=
false
;
rtl_string_unittest_const_literal_function
=
false
;
CPPUNIT_ASSERT
(
foo
==
"foo"
);
CPPUNIT_ASSERT
(
foo
==
"foo"
);
CPPUNIT_ASSERT
(
rtl_string_unittest_const_literal_function
==
true
);
CPPUNIT_ASSERT
(
rtl_string_unittest_const_literal_function
);
rtl_string_unittest_const_literal_function
=
false
;
rtl_string_unittest_const_literal_function
=
false
;
CPPUNIT_ASSERT
(
"foo"
==
foo
);
CPPUNIT_ASSERT
(
"foo"
==
foo
);
CPPUNIT_ASSERT
(
rtl_string_unittest_const_literal_function
==
true
);
CPPUNIT_ASSERT
(
rtl_string_unittest_const_literal_function
);
rtl_string_unittest_const_literal_function
=
false
;
rtl_string_unittest_const_literal_function
=
false
;
CPPUNIT_ASSERT
(
foo
!=
"bar"
);
CPPUNIT_ASSERT
(
foo
!=
"bar"
);
CPPUNIT_ASSERT
(
rtl_string_unittest_const_literal_function
==
true
);
CPPUNIT_ASSERT
(
rtl_string_unittest_const_literal_function
);
rtl_string_unittest_const_literal_function
=
false
;
rtl_string_unittest_const_literal_function
=
false
;
CPPUNIT_ASSERT
(
"foo"
!=
bar
);
CPPUNIT_ASSERT
(
"foo"
!=
bar
);
CPPUNIT_ASSERT
(
rtl_string_unittest_const_literal_function
==
true
);
CPPUNIT_ASSERT
(
rtl_string_unittest_const_literal_function
);
rtl_string_unittest_const_literal_function
=
false
;
rtl_string_unittest_const_literal_function
=
false
;
CPPUNIT_ASSERT
(
foobarfoo
.
indexOf
(
"foo"
,
1
)
==
6
);
CPPUNIT_ASSERT
(
foobarfoo
.
indexOf
(
"foo"
,
1
)
==
6
);
CPPUNIT_ASSERT
(
rtl_string_unittest_const_literal_function
==
true
);
CPPUNIT_ASSERT
(
rtl_string_unittest_const_literal_function
);
// rtl_string_unittest_const_literal_function = false;
// rtl_string_unittest_const_literal_function = false;
// CPPUNIT_ASSERT( foobarfoo.lastIndexOf( "foo" ) == 6 );
// CPPUNIT_ASSERT( foobarfoo.lastIndexOf( "foo" ) == 6 );
// CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
// CPPUNIT_ASSERT( rtl_string_unittest_const_literal_function == true );
// if this is not true, some of the calls above converted to OString
// if this is not true, some of the calls above converted to OString
CPPUNIT_ASSERT
(
rtl_string_unittest_const_literal
==
false
);
CPPUNIT_ASSERT
(
!
rtl_string_unittest_const_literal
);
// if this is not true, some of the calls above used non-const variants
// if this is not true, some of the calls above used non-const variants
CPPUNIT_ASSERT
(
rtl_string_unittest_non_const_literal_function
==
false
);
CPPUNIT_ASSERT
(
!
rtl_string_unittest_non_const_literal_function
);
}
}
void
test
::
ostring
::
StringLiterals
::
checkNonConstUsage
()
void
test
::
ostring
::
StringLiterals
::
checkNonConstUsage
()
...
@@ -223,8 +223,8 @@ void test::ostring::StringLiterals::checkNonConstUsage()
...
@@ -223,8 +223,8 @@ void test::ostring::StringLiterals::checkNonConstUsage()
// CPPUNIT_ASSERT( foobarfoo.lastIndexOf( (const char*)foo_c ) == 6 );
// CPPUNIT_ASSERT( foobarfoo.lastIndexOf( (const char*)foo_c ) == 6 );
// CPPUNIT_ASSERT( foobarfoo.lastIndexOf( foo_c ) == 6 );
// CPPUNIT_ASSERT( foobarfoo.lastIndexOf( foo_c ) == 6 );
// if this is not true, some of the calls above used const variants
// if this is not true, some of the calls above used const variants
CPPUNIT_ASSERT
(
rtl_string_unittest_const_literal
==
false
);
CPPUNIT_ASSERT
(
!
rtl_string_unittest_const_literal
);
CPPUNIT_ASSERT
(
rtl_string_unittest_const_literal_function
==
false
);
CPPUNIT_ASSERT
(
!
rtl_string_unittest_const_literal_function
);
}
}
void
test
::
ostring
::
StringLiterals
::
checkBuffer
()
void
test
::
ostring
::
StringLiterals
::
checkBuffer
()
...
@@ -232,15 +232,15 @@ void test::ostring::StringLiterals::checkBuffer()
...
@@ -232,15 +232,15 @@ void test::ostring::StringLiterals::checkBuffer()
rtl
::
OStringBuffer
buf
;
rtl
::
OStringBuffer
buf
;
rtl_string_unittest_const_literal_function
=
false
;
rtl_string_unittest_const_literal_function
=
false
;
buf
.
append
(
"foo"
);
buf
.
append
(
"foo"
);
CPPUNIT_ASSERT
(
rtl_string_unittest_const_literal_function
==
true
);
CPPUNIT_ASSERT
(
rtl_string_unittest_const_literal_function
);
CPPUNIT_ASSERT_EQUAL
(
rtl
::
OString
(
"foo"
),
buf
.
toString
());
CPPUNIT_ASSERT_EQUAL
(
rtl
::
OString
(
"foo"
),
buf
.
toString
());
rtl_string_unittest_const_literal_function
=
false
;
rtl_string_unittest_const_literal_function
=
false
;
buf
.
append
(
"bar"
);
buf
.
append
(
"bar"
);
CPPUNIT_ASSERT
(
rtl_string_unittest_const_literal_function
==
true
);
CPPUNIT_ASSERT
(
rtl_string_unittest_const_literal_function
);
CPPUNIT_ASSERT_EQUAL
(
rtl
::
OString
(
"foobar"
),
buf
.
toString
());
CPPUNIT_ASSERT_EQUAL
(
rtl
::
OString
(
"foobar"
),
buf
.
toString
());
rtl_string_unittest_const_literal_function
=
false
;
rtl_string_unittest_const_literal_function
=
false
;
buf
.
insert
(
3
,
"baz"
);
buf
.
insert
(
3
,
"baz"
);
CPPUNIT_ASSERT
(
rtl_string_unittest_const_literal_function
==
true
);
CPPUNIT_ASSERT
(
rtl_string_unittest_const_literal_function
);
CPPUNIT_ASSERT_EQUAL
(
rtl
::
OString
(
"foobazbar"
),
buf
.
toString
());
CPPUNIT_ASSERT_EQUAL
(
rtl
::
OString
(
"foobazbar"
),
buf
.
toString
());
rtl
::
OString
foobazbard
(
"foobazbard"
);
rtl
::
OString
foobazbard
(
"foobazbard"
);
...
@@ -250,8 +250,8 @@ void test::ostring::StringLiterals::checkBuffer()
...
@@ -250,8 +250,8 @@ void test::ostring::StringLiterals::checkBuffer()
char
d
[]
=
"d"
;
char
d
[]
=
"d"
;
CPPUNIT_ASSERT_EQUAL
(
foobazbard
,
buf
.
append
(
d
).
toString
());
CPPUNIT_ASSERT_EQUAL
(
foobazbard
,
buf
.
append
(
d
).
toString
());
CPPUNIT_ASSERT_EQUAL
(
foodbazbard
,
buf
.
insert
(
3
,
d
).
toString
()
);
CPPUNIT_ASSERT_EQUAL
(
foodbazbard
,
buf
.
insert
(
3
,
d
).
toString
()
);
CPPUNIT_ASSERT
(
rtl_string_unittest_const_literal
==
false
);
CPPUNIT_ASSERT
(
!
rtl_string_unittest_const_literal
);
CPPUNIT_ASSERT
(
rtl_string_unittest_const_literal_function
==
false
);
CPPUNIT_ASSERT
(
!
rtl_string_unittest_const_literal_function
);
}
}
#undef CONST_CTOR_USED
#undef CONST_CTOR_USED
...
...
sal/qa/rtl/strings/test_oustring_stringliterals.cxx
Dosyayı görüntüle @
3591554d
...
@@ -132,7 +132,7 @@ void test::oustring::StringLiterals::checkUsage()
...
@@ -132,7 +132,7 @@ void test::oustring::StringLiterals::checkUsage()
CPPUNIT_ASSERT
(
foobarfoo
.
replaceAll
(
"foo"
,
"test"
)
==
"testbartest"
);
CPPUNIT_ASSERT
(
foobarfoo
.
replaceAll
(
"foo"
,
"test"
)
==
"testbartest"
);
CPPUNIT_ASSERT
(
foo
.
reverseCompareTo
(
"foo"
)
==
0
);
CPPUNIT_ASSERT
(
foo
.
reverseCompareTo
(
"foo"
)
==
0
);
// if this is not true, some of the calls above converted to OUString
// if this is not true, some of the calls above converted to OUString
CPPUNIT_ASSERT
(
rtl_string_unittest_const_literal
==
false
);
CPPUNIT_ASSERT
(
!
rtl_string_unittest_const_literal
);
}
}
void
test
::
oustring
::
StringLiterals
::
checkExtraIntArgument
()
void
test
::
oustring
::
StringLiterals
::
checkExtraIntArgument
()
...
...
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