23 if (logval == NULL || val == NULL)
24 result = logval == val;
26 result = 0 == strcmp(logval, val);
30 printf(
"Expected: \"%s\"\n", val ? val :
"<null>");
31 printf(
"Got: \"%s\"\n", logval ? logval :
"<null>");
43 for (
int i=0; i<1024; i++)
54 mlog(
"int %d", 1000000);
58 mlog(
"long %ld", 1000000);
62 mlog(
"ptr %p", 0x1234);
68 for (
int i = 0; i < 1000 + 256; i++)
72 for (
int i = 0; i < 1000 + 256; i++)
81 for (
int i=0; i<256; i++) {
83 sprintf(check,
"%d", i+1000);
90 mlog_nice(
"This message won't be logged");
96 for (
int i = 0; i < 1000 + 256; i++)
void mlog_nice(const char *fmt,...)
Log a message, if there is space to do so.
char * mlog_get_line(int n)
Format the Nth line of the log.
bool compare_line(int n, const char *val)
void mlog_clear(void)
Clear all data from the log.
void mlog(const char *fmt,...)
Log a message.