source: libcf/trunk/test/debug.c@ 135

Last change on this file since 135 was 135, checked in by cheese, 11 years ago

#1 fix test code of debugging util

File size: 1.0 KB
Line 
1/**
2 * @file debug.c
3 * @author myusgun <myusgun@gmail.com>
4 */
5#include "cf_file.h"
6#include "cf_debug.h"
7
8#include <string.h>
9
10void callee3 (void) {
11 CF_DEBUG_BEGIN_FUNCTION;
12
13 // ...
14 CF_DEBUG_PRINT_CALLSTACK (stdout);
15 // ...
16
17 CF_DEBUG_END_FUNCTION;
18}
19
20void callee2 (void) {
21 CF_DEBUG_BEGIN_FUNCTION;
22
23 // ...
24 callee3 ();
25 // ...
26
27 CF_DEBUG_END_FUNCTION;
28}
29
30void callee1 (void) {
31 CF_DEBUG_BEGIN_FUNCTION;
32
33 // ...
34 callee2 ();
35 // ...
36
37 CF_DEBUG_END_FUNCTION;
38}
39
40int main (void) {
41 char data[] =
42 "【 曲名 : 사랑하고 있는데 】\n"
43 "《 歌 : Kylee 》\n"
44 "『 절원의 템페스트 OP2 Theme 』\n";
45
46 /* init. once */
47 CF_DEBUG_INITIALIZE;
48
49 /* at begin function */
50 CF_DEBUG_BEGIN_FUNCTION;
51
52 /* print */
53 CF_DEBUG_PRINT (stderr, "print message with context to stderr\n");
54
55 CF_DEBUG_PRINT_BIN (stdout, (unsigned char *) data, (int) sizeof (data), "data : \n%s", data);
56
57 /* step into other function with cf debugging util */
58 callee1 ();
59
60 /* at leave function */
61 CF_DEBUG_END_FUNCTION;
62
63 CF_DEBUG_FINALIZE;
64
65 return 0;
66}
Note: See TracBrowser for help on using the repository browser.