glibc/tests/Regression/bz710216-Wrong-decimal-point-symbol-in-Portuguese-currency/mf.c
Sergey Kolosov ab4bc8a24e Extend the test coverage
Move some of the RHEL QE testcases upstream to Fedora.
2022-05-31 09:29:27 +02:00

21 lines
453 B
C

#include "stdio.h"
#include <locale.h>
#include <monetary.h>
#define MAX_OUT 10
int main (){
ssize_t out_size;
char out[MAX_OUT];
if(setlocale(LC_ALL, "pt_PT.utf8") == NULL ) {
puts("Cannot set locale");
return 1;
} else {
out_size = strfmon(out,MAX_OUT, "%n", 5.95);
if (out_size == -1 ) return 2;
printf("%s\n",out);
out_size = strfmon(out,MAX_OUT, "%!n", 5.95);
if (out_size == -1 ) return 2;
printf("%s\n",out);
return 0;
}
}