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
e3cc0eba
Kaydet (Commit)
e3cc0eba
authored
7 years ago
tarafından
Eike Rathke
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Unit test testUserDefinedNumberFormats()
Change-Id: Ic908af0bf5cbd83fab7bbf2d2f37a1b51bc5e32a
üst
99cc3e51
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
37 additions
and
0 deletions
+37
-0
svl.cxx
svl/qa/unit/svl.cxx
+37
-0
No files found.
svl/qa/unit/svl.cxx
Dosyayı görüntüle @
e3cc0eba
...
...
@@ -67,6 +67,7 @@ public:
void
testUserDefinedNumberFormats
();
void
testNfEnglishKeywordsIntegrity
();
void
testStandardColorIntegrity
();
void
testColorNamesConversion
();
CPPUNIT_TEST_SUITE
(
Test
);
CPPUNIT_TEST
(
testNumberFormat
);
...
...
@@ -81,6 +82,7 @@ public:
CPPUNIT_TEST
(
testUserDefinedNumberFormats
);
CPPUNIT_TEST
(
testNfEnglishKeywordsIntegrity
);
CPPUNIT_TEST
(
testStandardColorIntegrity
);
CPPUNIT_TEST
(
testColorNamesConversion
);
CPPUNIT_TEST_SUITE_END
();
private
:
...
...
@@ -1475,6 +1477,41 @@ void Test::testStandardColorIntegrity()
CPPUNIT_ASSERT_EQUAL
(
aStandardColors
[
9
].
GetColor
(),
COL_WHITE
);
}
void
Test
::
testColorNamesConversion
()
{
SvNumberFormatter
aFormatter
(
m_xContext
,
LANGUAGE_GERMAN
);
const
SvNumberformat
*
pNumberFormat
=
aFormatter
.
GetEntry
(
0
);
const
::
std
::
vector
<
OUString
>
&
rEnglishKeywords
=
pNumberFormat
->
GetEnglishKeywords
();
const
NfKeywordTable
&
rKeywords
=
pNumberFormat
->
GetKeywords
();
// Holding a reference to the NfKeywordTable doesn't help if we switch
// locales internally, so copy the relevant parts in advance.
std
::
vector
<
OUString
>
aGermanKeywords
(
NF_KEYWORD_ENTRIES_COUNT
);
for
(
size_t
i
=
NF_KEY_COLOR
;
i
<=
NF_KEY_WHITE
;
++
i
)
aGermanKeywords
[
i
]
=
rKeywords
[
i
];
// Check that we actually have German and English keywords.
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"FARBE"
),
aGermanKeywords
[
NF_KEY_COLOR
]);
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"COLOR"
),
rEnglishKeywords
[
NF_KEY_COLOR
]);
// Test each color conversion.
// [FARBE1] -> [COLOR1] can't be tested because we have no color table link
// set, so the scanner returns nCheckPos error.
sal_Int32
nCheckPos
;
short
nType
;
sal_uInt32
nKey
;
OUString
aFormatCode
;
for
(
size_t
i
=
NF_KEY_BLACK
;
i
<=
NF_KEY_WHITE
;
++
i
)
{
aFormatCode
=
"["
+
aGermanKeywords
[
i
]
+
"]0"
;
aFormatter
.
PutandConvertEntry
(
aFormatCode
,
nCheckPos
,
nType
,
nKey
,
LANGUAGE_GERMAN
,
LANGUAGE_ENGLISH_US
);
CPPUNIT_ASSERT_EQUAL_MESSAGE
(
"CheckPos should be 0."
,
0
,
nCheckPos
);
CPPUNIT_ASSERT_EQUAL_MESSAGE
(
"Type should be NUMBER."
,
css
::
util
::
NumberFormat
::
NUMBER
,
nType
);
CPPUNIT_ASSERT_EQUAL
(
OUString
(
"["
+
rEnglishKeywords
[
i
]
+
"]0"
),
aFormatCode
);
}
}
CPPUNIT_TEST_SUITE_REGISTRATION
(
Test
);
}
...
...
This diff is collapsed.
Click to expand it.
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