| 332 | */ |
| 333 | |
| 334 | static int /* O - 1 on failure, 0 on success */ |
| 335 | test_string(cups_lang_t *language, /* I - Language */ |
| 336 | const char *msgid) /* I - Message */ |
| 337 | { |
| 338 | const char *msgstr; /* Localized string */ |
| 339 | |
| 340 | |
| 341 | /* |
| 342 | * Get the localized string and then see if we got what we expected. |
| 343 | * |
| 344 | * For the POSIX locale, the string pointers should be the same. |
| 345 | * For any other locale, the string pointers should be different. |
| 346 | */ |
| 347 | |
| 348 | printf("_cupsLangString(\"%s\"): ", msgid); |
| 349 | msgstr = _cupsLangString(language, msgid); |
| 350 | if (strcmp(language->language, "C") && msgid == msgstr) |
| 351 | { |
| 352 | puts("FAIL (no message catalog loaded)"); |
| 353 | return (1); |
| 354 | } |
| 355 | else if (!strcmp(language->language, "C") && msgid != msgstr) |
| 356 | { |
| 357 | puts("FAIL (POSIX locale is localized)"); |
| 358 | return (1); |
| 359 | } |
| 360 | |
| 361 | printf("PASS (\"%s\")\n", msgstr); |
| 362 | |
| 363 | return (0); |
| 364 | } |
| 365 | |
| 366 | |
| 367 | /* |
no test coverage detected