aboutsummaryrefslogtreecommitdiff
path: root/tests/test_locale.c
blob: 4aba30db5af7c46ddd84599c33b3b581b438f8dd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <locale.h>
#include <stdio.h>

int main()
{
    // Test basic functions from classic locale.
    struct lconv* locale = localeconv();

    printf("Testing locale information.\n");
    printf("Decimal point: %s\n", locale->decimal_point);
    printf("Thousands separator: %s\n", locale->thousands_sep);
    printf("Grouping: %s\n", locale->grouping);
    printf("International currency symbol: %s\n", locale->int_curr_symbol);
    printf("Currency symbol: %s\n", locale->currency_symbol);
    printf("Money decimal point: %s\n", locale->mon_decimal_point);
    printf("Money thousands separator: %s\n", locale->mon_thousands_sep);
    printf("Money Grouping: %s\n", locale->mon_grouping);
    printf("Positive sign: %s\n", locale->positive_sign);
    printf("Negative sign: %s\n", locale->negative_sign);
    
    // If no runtime errors, assume the test passed.
    printf("Locale tests passed.\n");
    return 0;
}