Skip to content

Commit 5333732

Browse files
committed
[libcxx] [test] Fix the get/put long_double_ru_RU tests on Apple platforms
This fixes issue #45084 (https://llvm.org/PR45739). Remove unnecessary trailing spaces after the "RUB" international currency symbol (and after the plain number in some parts of the put_long_double test). Both of these test files are `XFAIL: netbsd || linux || LIBCXX-WINDOWS-FIXME`, and then have some of their test cases commented out when `__APPLE__`. This patch comments-in those test cases and adjusts them all to work on Apple, while leaving the test `XFAIL`ed on NetBSD, Linux, and Windows. Differential Revision: https://reviews.llvm.org/D120316
1 parent 7fd60ee commit 5333732

File tree

2 files changed

+46
-100
lines changed

2 files changed

+46
-100
lines changed

libcxx/test/std/localization/locale.categories/category.monetary/locale.money.get/locale.money.get.members/get_long_double_ru_RU.pass.cpp

Lines changed: 18 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,6 @@
3535

3636
#include "platform_support.h" // locale name macros
3737

38-
// TODO:
39-
// Some of the assertions in this test are failing on Apple platforms.
40-
// Until we figure out the problem and fix it, disable these tests on
41-
// Apple platforms. Note that we're not using XFAIL or UNSUPPORTED markup
42-
// here, because this test would otherwise be disabled on all platforms
43-
// we test. To avoid this test becoming entirely stale, we just disable
44-
// the parts that fail.
45-
//
46-
// See https://llvm.org/PR45739 for the bug tracking this.
47-
#if defined(__APPLE__)
48-
# define APPLE_FIXME
49-
#endif
50-
5138
typedef std::money_get<char, cpp17_input_iterator<const char*> > Fn;
5239

5340
class my_facet
@@ -228,7 +215,7 @@ int main(int, char**)
228215
std::noshowbase(ios);
229216
}
230217
{ // negative, showbase
231-
std::string v = "-1 234 567,89 RUB ";
218+
std::string v = "-1 234 567,89 RUB";
232219
std::showbase(ios);
233220
typedef cpp17_input_iterator<const char*> I;
234221
long double ex;
@@ -240,7 +227,7 @@ int main(int, char**)
240227
std::noshowbase(ios);
241228
}
242229
{ // negative, showbase
243-
std::string v = "-1 234 567,89 RUB ";
230+
std::string v = "-1 234 567,89 RUB";
244231
typedef cpp17_input_iterator<const char*> I;
245232
long double ex;
246233
std::ios_base::iostate err = std::ios_base::goodbit;
@@ -310,7 +297,7 @@ int main(int, char**)
310297
assert(ex == -123456789);
311298
}
312299
{ // zero, showbase
313-
std::string v = "0,00 RUB ";
300+
std::string v = "0,00 RUB";
314301
typedef cpp17_input_iterator<const char*> I;
315302
long double ex;
316303
std::ios_base::iostate err = std::ios_base::goodbit;
@@ -320,9 +307,8 @@ int main(int, char**)
320307
assert(err == std::ios_base::goodbit);
321308
assert(ex == 0);
322309
}
323-
#if !defined(APPLE_FIXME)
324310
{ // zero, showbase
325-
std::string v = "0,00 RUB ";
311+
std::string v = "0,00 RUB";
326312
std::showbase(ios);
327313
typedef cpp17_input_iterator<const char*> I;
328314
long double ex;
@@ -334,9 +320,8 @@ int main(int, char**)
334320
assert(ex == 0);
335321
std::noshowbase(ios);
336322
}
337-
#endif
338323
{ // negative one, showbase
339-
std::string v = "-0,01 RUB ";
324+
std::string v = "-0,01 RUB";
340325
typedef cpp17_input_iterator<const char*> I;
341326
long double ex;
342327
std::ios_base::iostate err = std::ios_base::goodbit;
@@ -346,9 +331,8 @@ int main(int, char**)
346331
assert(err == std::ios_base::goodbit);
347332
assert(ex == -1);
348333
}
349-
#if !defined(APPLE_FIXME)
350334
{ // negative one, showbase
351-
std::string v = "-0,01 RUB ";
335+
std::string v = "-0,01 RUB";
352336
std::showbase(ios);
353337
typedef cpp17_input_iterator<const char*> I;
354338
long double ex;
@@ -360,9 +344,8 @@ int main(int, char**)
360344
assert(ex == -1);
361345
std::noshowbase(ios);
362346
}
363-
#endif
364347
{ // positive, showbase
365-
std::string v = "1 234 567,89 RUB ";
348+
std::string v = "1 234 567,89 RUB";
366349
typedef cpp17_input_iterator<const char*> I;
367350
long double ex;
368351
std::ios_base::iostate err = std::ios_base::goodbit;
@@ -372,9 +355,8 @@ int main(int, char**)
372355
assert(err == std::ios_base::goodbit);
373356
assert(ex == 123456789);
374357
}
375-
#if !defined(APPLE_FIXME)
376358
{ // positive, showbase
377-
std::string v = "1 234 567,89 RUB ";
359+
std::string v = "1 234 567,89 RUB";
378360
std::showbase(ios);
379361
typedef cpp17_input_iterator<const char*> I;
380362
long double ex;
@@ -386,10 +368,8 @@ int main(int, char**)
386368
assert(ex == 123456789);
387369
std::noshowbase(ios);
388370
}
389-
#endif
390-
#if !defined(APPLE_FIXME)
391371
{ // negative, showbase
392-
std::string v = "-1 234 567,89 RUB ";
372+
std::string v = "-1 234 567,89 RUB";
393373
std::showbase(ios);
394374
typedef cpp17_input_iterator<const char*> I;
395375
long double ex;
@@ -401,7 +381,6 @@ int main(int, char**)
401381
assert(ex == -123456789);
402382
std::noshowbase(ios);
403383
}
404-
#endif
405384
{ // negative, showbase
406385
std::string v = "-1 234 567,89 \xD1\x80\xD1\x83\xD0\xB1"".";
407386
std::showbase(ios);
@@ -571,7 +550,7 @@ int main(int, char**)
571550
std::noshowbase(ios);
572551
}
573552
{ // negative, showbase
574-
std::wstring v = L"-1 234 567,89 RUB ";
553+
std::wstring v = L"-1 234 567,89 RUB";
575554
std::showbase(ios);
576555
typedef cpp17_input_iterator<const wchar_t*> I;
577556
long double ex;
@@ -583,7 +562,7 @@ int main(int, char**)
583562
std::noshowbase(ios);
584563
}
585564
{ // negative, showbase
586-
std::wstring v = L"-1 234 567,89 RUB ";
565+
std::wstring v = L"-1 234 567,89 RUB";
587566
typedef cpp17_input_iterator<const wchar_t*> I;
588567
long double ex;
589568
std::ios_base::iostate err = std::ios_base::goodbit;
@@ -653,7 +632,7 @@ int main(int, char**)
653632
assert(ex == -123456789);
654633
}
655634
{ // zero, showbase
656-
std::wstring v = L"0,00 RUB ";
635+
std::wstring v = L"0,00 RUB";
657636
typedef cpp17_input_iterator<const wchar_t*> I;
658637
long double ex;
659638
std::ios_base::iostate err = std::ios_base::goodbit;
@@ -663,9 +642,8 @@ int main(int, char**)
663642
assert(err == std::ios_base::goodbit);
664643
assert(ex == 0);
665644
}
666-
#if !defined(APPLE_FIXME)
667645
{ // zero, showbase
668-
std::wstring v = L"0,00 RUB ";
646+
std::wstring v = L"0,00 RUB";
669647
std::showbase(ios);
670648
typedef cpp17_input_iterator<const wchar_t*> I;
671649
long double ex;
@@ -677,9 +655,8 @@ int main(int, char**)
677655
assert(ex == 0);
678656
std::noshowbase(ios);
679657
}
680-
#endif
681658
{ // negative one, showbase
682-
std::wstring v = L"-0,01 RUB ";
659+
std::wstring v = L"-0,01 RUB";
683660
typedef cpp17_input_iterator<const wchar_t*> I;
684661
long double ex;
685662
std::ios_base::iostate err = std::ios_base::goodbit;
@@ -689,9 +666,8 @@ int main(int, char**)
689666
assert(err == std::ios_base::goodbit);
690667
assert(ex == -1);
691668
}
692-
#if !defined(APPLE_FIXME)
693669
{ // negative one, showbase
694-
std::wstring v = L"-0,01 RUB ";
670+
std::wstring v = L"-0,01 RUB";
695671
std::showbase(ios);
696672
typedef cpp17_input_iterator<const wchar_t*> I;
697673
long double ex;
@@ -703,9 +679,8 @@ int main(int, char**)
703679
assert(ex == -1);
704680
std::noshowbase(ios);
705681
}
706-
#endif
707682
{ // positive, showbase
708-
std::wstring v = L"1 234 567,89 RUB ";
683+
std::wstring v = L"1 234 567,89 RUB";
709684
typedef cpp17_input_iterator<const wchar_t*> I;
710685
long double ex;
711686
std::ios_base::iostate err = std::ios_base::goodbit;
@@ -715,9 +690,8 @@ int main(int, char**)
715690
assert(err == std::ios_base::goodbit);
716691
assert(ex == 123456789);
717692
}
718-
#if !defined(APPLE_FIXME)
719693
{ // positive, showbase
720-
std::wstring v = L"1 234 567,89 RUB ";
694+
std::wstring v = L"1 234 567,89 RUB";
721695
std::showbase(ios);
722696
typedef cpp17_input_iterator<const wchar_t*> I;
723697
long double ex;
@@ -729,10 +703,8 @@ int main(int, char**)
729703
assert(ex == 123456789);
730704
std::noshowbase(ios);
731705
}
732-
#endif
733-
#if !defined(APPLE_FIXME)
734706
{ // negative, showbase
735-
std::wstring v = L"-1 234 567,89 RUB ";
707+
std::wstring v = L"-1 234 567,89 RUB";
736708
std::showbase(ios);
737709
typedef cpp17_input_iterator<const wchar_t*> I;
738710
long double ex;
@@ -744,7 +716,6 @@ int main(int, char**)
744716
assert(ex == -123456789);
745717
std::noshowbase(ios);
746718
}
747-
#endif
748719
{ // negative, showbase
749720
std::wstring v = L"-1 234 567,89 \x440\x443\x431"".";
750721
std::showbase(ios);

0 commit comments

Comments
 (0)