edit
[c11tester.git] / bugmessage.h
1 #ifndef __BUGMESSAGE_H__
2 #define __BUGMESSAGE_H__
3
4 #include "common.h"
5 #include "mymemory.h"
6
7 struct bug_message {
8         bug_message(const char *str) {
9                 const char *fmt = "  [BUG] %s\n";
10                 msg = (char *)snapshot_malloc(strlen(fmt) + strlen(str));
11                 sprintf(msg, fmt, str);
12         }
13         ~bug_message() { if (msg) snapshot_free(msg);}
14
15         char *msg;
16         void print() { model_print("%s", msg); }
17
18         SNAPSHOTALLOC
19 };
20
21 #endif  /* __BUGMESSAGE_H__ */