2
A program to test DBUG features. Used by tests-t.pl
7
#include <my_global.h> /* This includes dbug.h */
8
#include <my_pthread.h>
14
DBUG_RETURN(DBUG_EVALUATE("ret3", "ok", "ko"));
22
DBUG_PRINT("info", ("s=%s", s));
33
fprintf(DBUG_FILE, "=> push1\n");
38
int main (int argc, char *argv[])
47
#if defined(HAVE_PTHREAD_INIT) && defined(THREAD)
48
pthread_init(); /* Must be called before DBUG_ENTER */
51
my_thread_global_init();
54
for (i = 1; i < argc; i++)
56
if (strncmp(argv[i], "--push1=", 8) == 0)
63
DBUG_PROCESS ("dbug-tests");
65
DBUG_EXECUTE_IF("dump",
68
DBUG_EXPLAIN(s, sizeof(s)-1);
69
DBUG_DUMP("dump", (uchar*)s, strlen(s));
71
DBUG_EXECUTE_IF("push", DBUG_PUSH("+t"); );
72
DBUG_EXECUTE("execute", fprintf(DBUG_FILE, "=> execute\n"); );
73
DBUG_EXECUTE_IF("set", DBUG_SET("+F"); );
74
fprintf(DBUG_FILE, "=> evaluate: %s\n",
75
DBUG_EVALUATE("evaluate", "ON", "OFF"));
76
fprintf(DBUG_FILE, "=> evaluate_if: %s\n",
77
DBUG_EVALUATE_IF("evaluate_if", "ON", "OFF"));
78
DBUG_EXECUTE_IF("pop", DBUG_POP(); );
80
char s[1000] __attribute__((unused));
81
DBUG_EXPLAIN(s, sizeof(s)-1);
82
DBUG_PRINT("explain", ("dbug explained: %s", s));