2019-12-13 04:29:58 +00:00
|
|
|
#include <hawk-std.h>
|
|
|
|
#include <hawk-utl.h>
|
|
|
|
#include <stdio.h>
|
2022-04-06 02:21:46 +00:00
|
|
|
#include "tap.h"
|
2019-12-13 04:29:58 +00:00
|
|
|
|
|
|
|
int main ()
|
|
|
|
{
|
|
|
|
hawk_t* hawk = HAWK_NULL;
|
|
|
|
hawk_uch_t ufmt1[] = { '%', '0', '5', 'd', ' ', '%', '-', '9', 'h', 's', '\0' };
|
2020-04-17 11:10:47 +00:00
|
|
|
#if 0
|
2019-12-13 04:29:58 +00:00
|
|
|
hawk_uch_t ufmt2[] = { '%', '0', '5', 'd', ' ', '%', '-', '9', 'h', 's', ' ', '%','O','\0' };
|
2020-04-17 11:10:47 +00:00
|
|
|
#endif
|
2022-04-06 02:21:46 +00:00
|
|
|
no_plan ();
|
2019-12-13 04:29:58 +00:00
|
|
|
|
2020-04-17 11:10:47 +00:00
|
|
|
hawk = hawk_openstd(0, HAWK_NULL);
|
2019-12-13 04:29:58 +00:00
|
|
|
if (!hawk)
|
|
|
|
{
|
|
|
|
fprintf (stderr, "Unable to open hawk\n");
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
2020-04-17 11:10:47 +00:00
|
|
|
hawk_seterrbfmt (hawk, HAWK_NULL, HAWK_EINVAL, "%d %ld %s %hs", 10, 20L, "hawk", "hawk");
|
2022-04-06 02:21:46 +00:00
|
|
|
OK (hawk_comp_oocstr_bcstr(hawk_geterrmsg(hawk), "10 20 hawk hawk", 0) == 0, "hawk seterrbfmt #1");
|
2019-12-13 04:29:58 +00:00
|
|
|
hawk_logbfmt (hawk, HAWK_LOG_STDERR, "[%js]\n", hawk_geterrmsg(hawk));
|
|
|
|
|
2020-04-17 11:10:47 +00:00
|
|
|
hawk_seterrufmt (hawk, HAWK_NULL, HAWK_EINVAL, ufmt1, 9923, "hawk");
|
2022-04-06 02:21:46 +00:00
|
|
|
OK (hawk_comp_oocstr_bcstr(hawk_geterrmsg(hawk), "09923 hawk ", 0) == 0, "hawk seterrufmt #1");
|
2019-12-13 04:29:58 +00:00
|
|
|
hawk_logbfmt (hawk, HAWK_LOG_STDERR, "[%js]\n", hawk_geterrmsg(hawk));
|
|
|
|
|
2020-04-17 11:10:47 +00:00
|
|
|
#if 0
|
|
|
|
hawk_seterrufmt (hawk, HAWK_NULL, HAWK_EINVAL, ufmt2, 9923, "hawk", HAWK_SMPTR_TO_OOP(0x12345678));
|
2022-04-06 02:21:46 +00:00
|
|
|
OK (hawk_comp_oocstr_bcstr(hawk_geterrmsg(hawk), "09923 hawk #\\p12345678", 0) == 0, "hawk seterrufmt #1");
|
2019-12-13 04:29:58 +00:00
|
|
|
hawk_logbfmt (hawk, HAWK_LOG_STDERR, "[%js]\n", hawk_geterrmsg(hawk));
|
2020-04-17 11:10:47 +00:00
|
|
|
#endif
|
2019-12-13 04:29:58 +00:00
|
|
|
|
|
|
|
hawk_close (hawk);
|
2022-04-06 02:21:46 +00:00
|
|
|
return exit_status();
|
2019-12-13 04:29:58 +00:00
|
|
|
}
|