summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Balland-Poirier <laurent.balland-poirier@laposte.net>2016-06-21 00:46:51 +0200
committerLaurent BP <laurent.balland-poirier@laposte.net>2016-06-26 07:04:37 +0000
commitff25ea3d5ccf3a990767cbb1ef99037d3f84b072 (patch)
tree281f4e5830e48d62edf223d93f2c93f6883d2bfc
parentfeb6a07259c57ab00118f197ef2b3e1d5575c48e (diff)
Restore qa unit test of number formats from zforlist.hxx
Date formats, DateTime formats and Currency formats did not follow NfIndexTableOffset order. Add extended Fraction formats Change-Id: I584c080ec29d81e4c2b76ffa4a6422dfb736992e Reviewed-on: https://gerrit.libreoffice.org/26530 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Laurent BP <laurent.balland-poirier@laposte.net>
-rw-r--r--svl/qa/unit/svl.cxx40
1 files changed, 15 insertions, 25 deletions
diff --git a/svl/qa/unit/svl.cxx b/svl/qa/unit/svl.cxx
index ece214b3eb55..d54fda3936f2 100644
--- a/svl/qa/unit/svl.cxx
+++ b/svl/qa/unit/svl.cxx
@@ -140,29 +140,30 @@ void Test::testNumberFormat()
const char* pFraction[] = {
"# \?/\?",
"# \?\?/\?\?",
-#if 0
-// TODO: Followings aren't in range of NF_FRACTION_START and NF_FRACTION_END
+ nullptr
+ };
+
+// Followings aren't in range of NF_FRACTION_START and NF_FRACTION_END
// see enum NfIndexTableOffset in svl/inc/svl/zforlist.hxx
+ const char* pFractionExt[] = {
"# \?/4",
"# \?\?/100",
-#endif
nullptr
};
-#if 0 // TODO: Find out why on some systems the last two currency format codes differ.
const char* pCurrency[] = {
+ "$#,##0;-$#,##0",
+ "$#,##0.00;-$#,##0.00",
"$#,##0;[RED]-$#,##0",
"$#,##0.00;[RED]-$#,##0.00",
"#,##0.00 CCC",
"$#,##0.--;[RED]-$#,##0.--",
- "$#,##0;-$#,##0",
- "$#,##0;-$#,##0",
- 0
+ nullptr
};
-#endif
-#if 0 // TODO: This currently fails
const char* pDate[] = {
+ "M/D/YY",
+ "NNNNMMMM DD, YYYY",
"MM/DD/YY",
"MM/DD/YYYY",
"MMM D, YY",
@@ -182,11 +183,8 @@ void Test::testNumberFormat()
"MMMM",
"QQ YY",
"WW",
- "MM/DD/YY",
- "WW",
- 0
+ nullptr
};
-#endif
const char* pTime[] = {
"HH:MM",
@@ -199,13 +197,11 @@ void Test::testNumberFormat()
nullptr
};
-#if 0 // TODO: This currently fails
const char* pDateTime[] = {
"MM/DD/YY HH:MM AM/PM",
- "MM/DD/YY HH:MM AM/PM",
- 0
+ "MM/DD/YYYY HH:MM:SS",
+ nullptr
};
-#endif
const char* pBoolean[] = {
"BOOLEAN",
@@ -227,16 +223,11 @@ void Test::testNumberFormat()
{ NF_SCIENTIFIC_START, NF_SCIENTIFIC_END, 2, pScientific },
{ NF_PERCENT_START, NF_PERCENT_END, 2, pPercent },
{ NF_FRACTION_START, NF_FRACTION_END, 2, pFraction },
-#if 0 // TODO: Find out why on some systems the last two currency format codes differ.
+ { NF_FRACTION_3, NF_FRACTION_4, 2, pFractionExt },
{ NF_CURRENCY_START, NF_CURRENCY_END, 6, pCurrency },
-#endif
-#if 0 // TODO: This currently fails
{ NF_DATE_START, NF_DATE_END, 21, pDate },
-#endif
{ NF_TIME_START, NF_TIME_END, 7, pTime },
-#if 0 // TODO: This currently fails
{ NF_DATETIME_START, NF_DATETIME_END, 2, pDateTime },
-#endif
{ NF_BOOLEAN, NF_BOOLEAN, 1, pBoolean },
{ NF_TEXT, NF_TEXT, 1, pText }
};
@@ -259,8 +250,7 @@ void Test::testNumberFormat()
CPPUNIT_ASSERT_MESSAGE("Number format entry is expected, but doesn't exist.", p);
OUString aCode = p->GetFormatstring();
- bool bEqual = aCode.equalsAscii(aTests[i].pCodes[j-nStart]);
- CPPUNIT_ASSERT_MESSAGE("Unexpected number format code.", bEqual);
+ CPPUNIT_ASSERT_EQUAL( aCode.toUtf8() , OString( aTests[i].pCodes[j-nStart] ) );
}
}