FreeBSD Bugzilla – Attachment 237701 Details for
Bug 267410
[PATCH] strfmon_l: Fix strfmon_l(3)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
MWE
strfmon_l_mwe.c (text/plain), 888 bytes, created by
Jose Luis Duran
on 2022-10-29 02:24:30 UTC
(
hide
)
Description:
MWE
Filename:
MIME Type:
Creator:
Jose Luis Duran
Created:
2022-10-29 02:24:30 UTC
Size:
888 bytes
patch
obsolete
>/* > * Obtained from NetBSD: > * https://github.com/NetBSD/src/blob/trunk/tests/lib/libc/locale/t_strfmon.c > */ >#include <stdio.h> >#include <stdlib.h> >#include <locale.h> >#include <monetary.h> > >#define nitems(x) (sizeof((x)) / sizeof((x)[0])) > >int >main() >{ > const struct { > const char *locale; > const char *expected; > } tests[] = { > { "de_DE.UTF-8", "[ **1234,57 â¬] [ **1.234,57 EUR]" }, > { "en_GB.UTF-8", "[ £**1234.57] [ GBP**1,234.57]" }, > }; > locale_t loc; > size_t i; > char buf[80]; > > for (i = 0; i < nitems(tests); ++i) { > loc = newlocale(LC_MONETARY_MASK, tests[i].locale, 0); > > if (loc == NULL) { > fprintf(stderr, "Unable to newlocale().\n"); > exit(1); > } > > strfmon_l(buf, sizeof(buf) - 1, loc, "[%^=*#6n] [%=*#6i]", > 1234.567, 1234.567); > printf("Expected: %s\n", tests[i].expected); > printf(" Actual: %s\n\n", buf); > > freelocale(loc); > } > > exit(0); >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 267410
: 237701