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
12e30adf
Kaydet (Commit)
12e30adf
authored
Haz 01, 2015
tarafından
Markus Mohrhard
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
add initial IsNumberFormat test
Change-Id: Idfd51360bfe8d857838ee522b8a9d3d3de06952b
üst
278e2b36
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
32 additions
and
0 deletions
+32
-0
svl.cxx
svl/qa/unit/svl.cxx
+32
-0
No files found.
svl/qa/unit/svl.cxx
Dosyayı görüntüle @
12e30adf
...
...
@@ -60,6 +60,7 @@ public:
void
testFdo60915
();
void
testI116701
();
void
testDateInput
();
void
testIsNumberFormat
();
CPPUNIT_TEST_SUITE
(
Test
);
CPPUNIT_TEST
(
testNumberFormat
);
...
...
@@ -69,6 +70,7 @@ public:
CPPUNIT_TEST
(
testFdo60915
);
CPPUNIT_TEST
(
testI116701
);
CPPUNIT_TEST
(
testDateInput
);
CPPUNIT_TEST
(
testIsNumberFormat
);
CPPUNIT_TEST_SUITE_END
();
private
:
...
...
@@ -1018,6 +1020,36 @@ void Test::checkDateInput( SvNumberFormatter& rFormatter, const char* pTimezone,
CPPUNIT_ASSERT_EQUAL
(
aDate
,
aOutString
);
}
void
Test
::
testIsNumberFormat
()
{
LanguageType
eLang
=
LANGUAGE_THAI
;
SvNumberFormatter
aFormatter
(
m_xContext
,
eLang
);
struct
NumberFormatData
{
const
char
*
pFormat
;
bool
bIsNumber
;
}
aTests
[]
=
{
{
"20.3"
,
true
},
{
"2"
,
true
},
{
"test"
,
false
},
{
"Jan1"
,
false
}
// { "Jan1 2000", true },
// { "Jan 1", true },
// { "Jan 1 2000", true}
};
for
(
size_t
i
=
0
;
i
<
SAL_N_ELEMENTS
(
aTests
);
++
i
)
{
sal_uInt32
nIndex
;
double
nNumber
;
OUString
aString
=
OUString
::
createFromAscii
(
aTests
[
i
].
pFormat
);
bool
bIsNumber
=
aFormatter
.
IsNumberFormat
(
aString
,
nIndex
,
nNumber
);
CPPUNIT_ASSERT_EQUAL
(
aTests
[
i
].
bIsNumber
,
bIsNumber
);
}
}
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