bug-fmtmsg1.c 601 B

12345678910111213141516171819202122232425262728
  1. #include <fmtmsg.h>
  2. #include <stdio.h>
  3. static int
  4. do_test (void)
  5. {
  6. /* Ugly, but fmtmsg would otherwise print to stderr which we do not
  7. want. */
  8. fclose (stderr);
  9. stderr = stdout;
  10. int e1;
  11. e1 = fmtmsg (MM_PRINT, "label:part", MM_WARNING, "text", "action", "tag");
  12. int e2;
  13. e2 = fmtmsg (MM_PRINT, "label2:part2", 11, "text2", "action2", "tag2");
  14. addseverity (10, "additional severity");
  15. int e3;
  16. e3 = fmtmsg (MM_PRINT, "label3:part3", 10, "text3", "action3", "tag3");
  17. return e1 != 0 || e2 != 0 || e3 != 0;
  18. }
  19. #define TEST_FUNCTION do_test ()
  20. #include "../test-skeleton.c"