MCPcopy Create free account
hub / github.com/OpenPrinting/cups / test_string

Function test_string

cups/testlang.c:334–364  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

332 */
333
334static int /* O - 1 on failure, 0 on success */
335test_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/*

Callers 2

mainFunction · 0.85
test_languageFunction · 0.85

Calls 1

_cupsLangStringFunction · 0.85

Tested by

no test coverage detected