| #include <locale.h> |
| #include <stdio.h> |
| |
| #include "third_party/glibc_locales/tests/tst-indirect-override.h" |
| |
| #ifndef THIRD_PARTY_GLIBC_LOCALES_GLIBC_LOCALES_OVERRIDE_H |
| #error "glibc_locales_override.h not included" |
| #endif |
| |
| #ifndef INDIRECT_OVERRIDE |
| #error "INDIRECT_OVERRIDE not defined" |
| #endif |
| |
| #define FAIL(str, args...) \ |
| { \ |
| printf("FAIL: " str "\n", ##args); \ |
| ++errors; \ |
| } |
| |
| int main(void) { |
| int errors = 0; |
| |
| locale_t locale = newlocale(LC_ALL_MASK, "C", NULL); |
| if (tolower_l('A', locale) != 'a') FAIL("tolower_l('A') wrong") |
| if (toupper_l('a', locale) != 'A') FAIL("toupper_l('a') wrong") |
| freelocale(locale); |
| |
| return errors; |
| } |