From 9307d96277eec9ef099e2f76c9470604ca88f561 Mon Sep 17 00:00:00 2001 From: Travis Keep Date: Wed, 14 Nov 2012 21:49:39 +0000 Subject: [PATCH] ICU-9543 Use scientific notation in tests for constants >= 1E9 X-SVN-Rev: 32829 --- .../intltest/compactdecimalformattest.cpp | 114 +++++++++--------- 1 file changed, 57 insertions(+), 57 deletions(-) diff --git a/icu4c/source/test/intltest/compactdecimalformattest.cpp b/icu4c/source/test/intltest/compactdecimalformattest.cpp index 2c1ea7aa8e..9a065da045 100644 --- a/icu4c/source/test/intltest/compactdecimalformattest.cpp +++ b/icu4c/source/test/intltest/compactdecimalformattest.cpp @@ -35,13 +35,13 @@ static ExpectedResult kEnglishShort[] = { {1234567.0, "1.2M"}, {12345678.0, "12M"}, {123456789.0, "120M"}, - {1234567890.0, "1.2B"}, - {12345678901.0, "12B"}, - {123456789012.0, "120B"}, - {1234567890123.0, "1.2T"}, - {12345678901234.0, "12T"}, - {123456789012345.0, "120T"}, - {1234567890123456.0, "1200T"}}; + {1.23456789E9, "1.2B"}, + {1.23456789E10, "12B"}, + {1.23456789E11, "120B"}, + {1.23456789E12, "1.2T"}, + {1.23456789E13, "12T"}, + {1.23456789E14, "120T"}, + {1.23456789E15, "1200T"}}; static ExpectedResult kSerbianShort[] = { {1234.0, "1200"}, @@ -51,13 +51,13 @@ static ExpectedResult kSerbianShort[] = { {1234567.0, "1,2\\u00A0\\u043C\\u0438\\u043B"}, {12345678.0, "12\\u00A0\\u043C\\u0438\\u043B"}, {123456789.0, "120\\u00A0\\u043C\\u0438\\u043B"}, - {1234567890.0, "1,2\\u00A0\\u043C\\u043B\\u0440\\u0434"}, - {12345678901.0, "12\\u00A0\\u043C\\u043B\\u0440\\u0434"}, - {123456789012.0, "120\\u00A0\\u043C\\u043B\\u0440\\u0434"}, - {1234567890123.0, "1,2\\u00A0\\u0431\\u0438\\u043B"}, - {12345678901234.0, "12\\u00A0\\u0431\\u0438\\u043B"}, - {123456789012345.0, "120\\u00A0\\u0431\\u0438\\u043B"}, - {1234567890123456.0, "1200\\u00A0\\u0431\\u0438\\u043B"}}; + {1.23456789E9, "1,2\\u00A0\\u043C\\u043B\\u0440\\u0434"}, + {1.23456789E10, "12\\u00A0\\u043C\\u043B\\u0440\\u0434"}, + {1.23456789E11, "120\\u00A0\\u043C\\u043B\\u0440\\u0434"}, + {1.23456789E12, "1,2\\u00A0\\u0431\\u0438\\u043B"}, + {1.23456789E13, "12\\u00A0\\u0431\\u0438\\u043B"}, + {1.23456789E14, "120\\u00A0\\u0431\\u0438\\u043B"}, + {1.23456789E15, "1200\\u00A0\\u0431\\u0438\\u043B"}}; static ExpectedResult kSerbianLong[] = { {1234.0, "1,2 \\u0445\\u0438\\u0459\\u0430\\u0434\\u0430"}, @@ -68,15 +68,15 @@ static ExpectedResult kSerbianLong[] = { {1234567.0, "1,2 \\u043C\\u0438\\u043B\\u0438\\u043E\\u043D\\u0430"}, {12345678.0, "12 \\u043C\\u0438\\u043B\\u0438\\u043E\\u043D\\u0430"}, {123456789.0, "120 \\u043C\\u0438\\u043B\\u0438\\u043E\\u043D\\u0430"}, - {1234567890.0, "1,2 \\u043C\\u0438\\u043B\\u0438\\u0458\\u0430\\u0440\\u0434\\u0438"}, - {12345678901.0, "12 \\u043C\\u0438\\u043B\\u0438\\u0458\\u0430\\u0440\\u0434\\u0438"}, - {20890123456.0, "21 \\u043C\\u0438\\u043B\\u0438\\u0458\\u0430\\u0440\\u0434\\u0430"}, - {21890123456.0, "22 \\u043C\\u0438\\u043B\\u0438\\u0458\\u0430\\u0440\\u0434\\u0435"}, - {123456789012.0, "120 \\u043C\\u0438\\u043B\\u0438\\u0458\\u0430\\u0440\\u0434\\u0438"}, - {1234567890123.0, "1,2 \\u0442\\u0440\\u0438\\u043B\\u0438\\u043E\\u043D\\u0430"}, - {12345678901234.0, "12 \\u0442\\u0440\\u0438\\u043B\\u0438\\u043E\\u043D\\u0430"}, - {123456789012345.0, "120 \\u0442\\u0440\\u0438\\u043B\\u0438\\u043E\\u043D\\u0430"}, - {1234567890123456.0, "1200 \\u0442\\u0440\\u0438\\u043B\\u0438\\u043E\\u043D\\u0430"}}; + {1.23456789E9, "1,2 \\u043C\\u0438\\u043B\\u0438\\u0458\\u0430\\u0440\\u0434\\u0438"}, + {1.23456789E10, "12 \\u043C\\u0438\\u043B\\u0438\\u0458\\u0430\\u0440\\u0434\\u0438"}, + {2.08901234E10, "21 \\u043C\\u0438\\u043B\\u0438\\u0458\\u0430\\u0440\\u0434\\u0430"}, + {2.18901234E10, "22 \\u043C\\u0438\\u043B\\u0438\\u0458\\u0430\\u0440\\u0434\\u0435"}, + {1.23456789E11, "120 \\u043C\\u0438\\u043B\\u0438\\u0458\\u0430\\u0440\\u0434\\u0438"}, + {1.23456789E12, "1,2 \\u0442\\u0440\\u0438\\u043B\\u0438\\u043E\\u043D\\u0430"}, + {1.23456789E13, "12 \\u0442\\u0440\\u0438\\u043B\\u0438\\u043E\\u043D\\u0430"}, + {1.23456789E14, "120 \\u0442\\u0440\\u0438\\u043B\\u0438\\u043E\\u043D\\u0430"}, + {1.23456789E15, "1200 \\u0442\\u0440\\u0438\\u043B\\u0438\\u043E\\u043D\\u0430"}}; static ExpectedResult kSerbianLongNegative[] = { {-1234.0, "-1,2 \\u0445\\u0438\\u0459\\u0430\\u0434\\u0430"}, @@ -87,15 +87,15 @@ static ExpectedResult kSerbianLongNegative[] = { {-1234567.0, "-1,2 \\u043C\\u0438\\u043B\\u0438\\u043E\\u043D\\u0430"}, {-12345678.0, "-12 \\u043C\\u0438\\u043B\\u0438\\u043E\\u043D\\u0430"}, {-123456789.0, "-120 \\u043C\\u0438\\u043B\\u0438\\u043E\\u043D\\u0430"}, - {-1234567890.0, "-1,2 \\u043C\\u0438\\u043B\\u0438\\u0458\\u0430\\u0440\\u0434\\u0438"}, - {-12345678901.0, "-12 \\u043C\\u0438\\u043B\\u0438\\u0458\\u0430\\u0440\\u0434\\u0438"}, - {-20890123456.0, "-21 \\u043C\\u0438\\u043B\\u0438\\u0458\\u0430\\u0440\\u0434\\u0430"}, - {-21890123456.0, "-22 \\u043C\\u0438\\u043B\\u0438\\u0458\\u0430\\u0440\\u0434\\u0435"}, - {-123456789012.0, "-120 \\u043C\\u0438\\u043B\\u0438\\u0458\\u0430\\u0440\\u0434\\u0438"}, - {-1234567890123.0, "-1,2 \\u0442\\u0440\\u0438\\u043B\\u0438\\u043E\\u043D\\u0430"}, - {-12345678901234.0, "-12 \\u0442\\u0440\\u0438\\u043B\\u0438\\u043E\\u043D\\u0430"}, - {-123456789012345.0, "-120 \\u0442\\u0440\\u0438\\u043B\\u0438\\u043E\\u043D\\u0430"}, - {-1234567890123456.0, "-1200 \\u0442\\u0440\\u0438\\u043B\\u0438\\u043E\\u043D\\u0430"}}; + {-1.23456789E9, "-1,2 \\u043C\\u0438\\u043B\\u0438\\u0458\\u0430\\u0440\\u0434\\u0438"}, + {-1.23456789E10, "-12 \\u043C\\u0438\\u043B\\u0438\\u0458\\u0430\\u0440\\u0434\\u0438"}, + {-2.08901234E10, "-21 \\u043C\\u0438\\u043B\\u0438\\u0458\\u0430\\u0440\\u0434\\u0430"}, + {-2.18901234E10, "-22 \\u043C\\u0438\\u043B\\u0438\\u0458\\u0430\\u0440\\u0434\\u0435"}, + {-1.23456789E11, "-120 \\u043C\\u0438\\u043B\\u0438\\u0458\\u0430\\u0440\\u0434\\u0438"}, + {-1.23456789E12, "-1,2 \\u0442\\u0440\\u0438\\u043B\\u0438\\u043E\\u043D\\u0430"}, + {-1.23456789E13, "-12 \\u0442\\u0440\\u0438\\u043B\\u0438\\u043E\\u043D\\u0430"}, + {-1.23456789E14, "-120 \\u0442\\u0440\\u0438\\u043B\\u0438\\u043E\\u043D\\u0430"}, + {-1.23456789E15, "-1200 \\u0442\\u0440\\u0438\\u043B\\u0438\\u043E\\u043D\\u0430"}}; static ExpectedResult kJapaneseShort[] = { {1234.0, "1.2\\u5343"}, @@ -104,12 +104,12 @@ static ExpectedResult kJapaneseShort[] = { {1234567.0, "120\\u4E07"}, {12345678.0, "1200\\u4E07"}, {123456789.0, "1.2\\u5104"}, - {1234567890.0, "12\\u5104"}, - {12345678901.0, "120\\u5104"}, - {123456789012.0, "1200\\u5104"}, - {1234567890123.0, "1.2\\u5146"}, - {12345678901234.0, "12\\u5146"}, - {123456789012345.0, "120\\u5146"}}; + {1.23456789E9, "12\\u5104"}, + {1.23456789E10, "120\\u5104"}, + {1.23456789E11, "1200\\u5104"}, + {1.23456789E12, "1.2\\u5146"}, + {1.23456789E13, "12\\u5146"}, + {1.23456789E14, "120\\u5146"}}; static ExpectedResult kSwahiliShort[] = { {1234.0, "elfu\\u00a01.2"}, @@ -118,12 +118,12 @@ static ExpectedResult kSwahiliShort[] = { {1234567.0, "M1.2"}, {12345678.0, "M12"}, {123456789.0, "M120"}, - {1234567890.0, "B1.2"}, - {12345678901.0, "B12"}, - {123456789012.0, "B120"}, - {1234567890123.0, "T1.2"}, - {12345678901234.0, "T12"}, - {1234567890123456.0, "T1200"}}; + {1.23456789E9, "B1.2"}, + {1.23456789E10, "B12"}, + {1.23456789E11, "B120"}, + {1.23456789E12, "T1.2"}, + {1.23456789E13, "T12"}, + {1.23456789E15, "T1200"}}; static ExpectedResult kCsShort[] = { {1000.0, "1\\u00a0tis."}, @@ -134,12 +134,12 @@ static ExpectedResult kCsShort[] = { {1271234.0, "1,3\\u00a0mil."}, {12712345.0, "13\\u00a0mil."}, {127123456.0, "130\\u00a0mil."}, - {1271234567.0, "1,3\\u00a0mld."}, - {12712345678.0, "13\\u00a0mld."}, - {127123456789.0, "130\\u00a0mld."}, - {1271234567890.0, "1,3\\u00a0bil."}, - {12712345678901.0, "13\\u00a0bil."}, - {127123456789012.0, "130\\u00a0bil."}}; + {1.27123456E9, "1,3\\u00a0mld."}, + {1.27123456E10, "13\\u00a0mld."}, + {1.27123456E11, "130\\u00a0mld."}, + {1.27123456E12, "1,3\\u00a0bil."}, + {1.27123456E13, "13\\u00a0bil."}, + {1.27123456E14, "130\\u00a0bil."}}; static ExpectedResult kSkLong[] = { {1000.0, "1 tis\\u00edc"}, @@ -153,15 +153,15 @@ static ExpectedResult kSwahiliShortNegative[] = { {-1234567.0, "M-1.2"}, {-12345678.0, "M-12"}, {-123456789.0, "M-120"}, - {-1234567890.0, "B-1.2"}, - {-12345678901.0, "B-12"}, - {-123456789012.0, "B-120"}, - {-1234567890123.0, "T-1.2"}, - {-12345678901234.0, "T-12"}, - {-1234567890123456.0, "T-1200"}}; + {-1.23456789E9, "B-1.2"}, + {-1.23456789E10, "B-12"}, + {-1.23456789E11, "B-120"}, + {-1.23456789E12, "T-1.2"}, + {-1.23456789E13, "T-12"}, + {-1.23456789E15, "T-1200"}}; static ExpectedResult kArabicLong[] = { - {-5300, "\\u0665\\u066B\\u0663- \\u0623\\u0644\\u0641"}}; + {-5300.0, "\\u0665\\u066B\\u0663- \\u0623\\u0644\\u0641"}}; class CompactDecimalFormatTest : public IntlTest {