Update.
[glibc.git] / stdlib / tst-fmtmsg.c
blobd5369bda621503fd7654262d39c17cb2a39cada7
1 #include <fmtmsg.h>
2 #include <mcheck.h>
3 #include <stdio.h>
6 #define MM_TEST 10
8 int
9 main (void)
11 int result = 0;
13 mtrace ();
15 if (addseverity (MM_TEST, "TEST") != MM_OK)
17 puts ("addseverity failed");
18 result = 1;
21 if (fmtmsg (MM_PRINT, "GLIBC:tst-fmtmsg", MM_HALT, "halt",
22 "should print message for MM_HALT", "GLIBC:tst-fmtmsg:1")
23 != MM_OK)
24 result = 1;
26 if (fmtmsg (MM_PRINT, "GLIBC:tst-fmtmsg", MM_ERROR, "halt",
27 "should print message for MM_ERROR", "GLIBC:tst-fmtmsg:2")
28 != MM_OK)
29 result = 1;
31 if (fmtmsg (MM_PRINT, "GLIBC:tst-fmtmsg", MM_WARNING, "halt",
32 "should print message for MM_WARNING", "GLIBC:tst-fmtmsg:3")
33 != MM_OK)
34 result = 1;
36 if (fmtmsg (MM_PRINT, "GLIBC:tst-fmtmsg", MM_INFO, "halt",
37 "should print message for MM_INFO", "GLIBC:tst-fmtmsg:4")
38 != MM_OK)
39 result = 1;
41 if (fmtmsg (MM_PRINT, "GLIBC:tst-fmtmsg", MM_NOSEV, "halt",
42 "should print message for MM_NOSEV", "GLIBC:tst-fmtmsg:5")
43 != MM_OK)
44 result = 1;
46 if (fmtmsg (MM_PRINT, "GLIBC:tst-fmtmsg", MM_TEST, "halt",
47 "should print message for MM_TEST", "GLIBC:tst-fmtmsg:6")
48 != MM_OK)
49 result = 1;
51 return result;