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
b02f792f
Kaydet (Commit)
b02f792f
authored
Agu 06, 2015
tarafından
Eike Rathke
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
unit test for short name ambiguity, tdf#93080
Change-Id: I97f33c8db59d2fc084b5e4eb389bff3d8254d4f0
üst
c7d66949
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
0 deletions
+35
-0
svl.cxx
svl/qa/unit/svl.cxx
+35
-0
No files found.
svl/qa/unit/svl.cxx
Dosyayı görüntüle @
b02f792f
...
...
@@ -1048,6 +1048,41 @@ void Test::testIsNumberFormat()
CPPUNIT_ASSERT_EQUAL
(
aTests
[
i
].
bIsNumber
,
bIsNumber
);
}
// Test Spanish "mar" short name ambiguity, day "martes" or month "marzo".
// Day of week names are only parsed away, not evaluated if they actually
// correspond to the date given.
struct
SpanishDate
{
const
char
*
mpInput
;
bool
mbNumber
;
const
char
*
mpOutput
;
}
aSpanishTests
[]
=
{
{
"22/11/1999"
,
true
,
"22/11/1999"
},
{
"Lun 22/11/1999"
,
true
,
"22/11/1999"
},
{
"Mar 22/11/1999"
,
true
,
"22/11/1999"
},
{
"Abr 22/11/1999"
,
false
,
""
},
// month name AND numeric month don't go along
{
"Lun Mar 22/11/1999"
,
false
,
""
},
// month name AND numeric month don't go along
{
"Mar Mar 22/11/1999"
,
false
,
""
},
// month name AND numeric month don't go along
{
"Lun Mar 22 1999"
,
true
,
"22/03/1999"
},
{
"Mar Mar 22 1999"
,
true
,
"22/03/1999"
},
{
"Mar Lun 22 1999"
,
false
,
""
}
// day name only at the beginning (could change?)
};
sal_uInt32
nIndex
=
aFormatter
.
GetFormatIndex
(
NF_DATE_SYS_DDMMYYYY
,
LANGUAGE_SPANISH
);
for
(
size_t
i
=
0
;
i
<
SAL_N_ELEMENTS
(
aSpanishTests
);
++
i
)
{
double
fNumber
=
0
;
OUString
aString
=
OUString
::
createFromAscii
(
aSpanishTests
[
i
].
mpInput
);
bool
bIsNumber
=
aFormatter
.
IsNumberFormat
(
aString
,
nIndex
,
fNumber
);
CPPUNIT_ASSERT_EQUAL
(
aSpanishTests
[
i
].
mbNumber
,
bIsNumber
);
if
(
aSpanishTests
[
i
].
mbNumber
)
{
Color
*
pColor
;
aFormatter
.
GetOutputString
(
fNumber
,
nIndex
,
aString
,
&
pColor
);
CPPUNIT_ASSERT_EQUAL
(
OUString
::
createFromAscii
(
aSpanishTests
[
i
].
mpOutput
),
aString
);
}
}
}
CPPUNIT_TEST_SUITE_REGISTRATION
(
Test
);
...
...
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