annotate src/testdebug.c @ 36:6fe121a971c9 stable-0-5-7

valgrind fixes
author carl
date Thu, 09 Aug 2007 15:46:34 -0700
parents c508ee15dfca
children f66078abed38
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
16
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
1 #include <stdlib.h>
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
2 #include <string.h>
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
3 #include "define.h"
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
4
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
5 #define BUF_SIZE 100000
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
6 int main() {
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
7 char *x = xmalloc(BUF_SIZE); // 10k
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
8 memset(x, '.', BUF_SIZE-1);
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
9 x[BUF_SIZE-2]='P';
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
10 x[BUF_SIZE-1]='\0';
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
11
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
12 DEBUG_INIT("libpst.log");
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
13 DEBUG_REGISTER_CLOSE();
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
14
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
15 DEBUG_ENT("main");
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
16
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
17 DEBUG_FILE(("%s", x));
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
18 DEBUG_FILE(("This is an error %d\n", 4));
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
19
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
20 DEBUG_RET();
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
21 return 0;
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
22 }
c508ee15dfca switch to automake/autoconf
carl
parents:
diff changeset
23