source: svn/newcon3bcm2_21bu/dst/dhl/src/test/DebugPrintTest.c

Last change on this file was 76, checked in by megakiss, 10 years ago

1W 대기전력을 만족시키기 위하여 POWEROFF시 튜너를 Standby 상태로 함

  • Property svn:executable set to *
File size: 4.8 KB
Line 
1/**
2        @file
3                DebugPrintTest.c
4
5        @brief
6                DHL_MODULE ¹× ModulePrint °ü·Ã API Å×½ºÆ®.
7*/
8
9
10#include "DHL_OSAL.h"
11#include "DHL_DBG.h"
12
13
14
15
16//DHL_MODULE("DbgTest", 0);
17
18
19void DebugPrint_Test(void)
20{
21        int mlevel, plevel;
22       
23        DHL_OS_Printf("This is DbgPrint test. file %s, line %d\n", __FILE__, __LINE__);
24
25
26        // default level test..
27        //   ÀÌ Å×½ºÆ® ÇÔ¼ö Àü¿¡ ¾î¶² »óȲÀ̳Ŀ¡ µû¶ó Ãâ·Â °á°ú´Â ´Þ¶óÁú ¼öÀÖ´Ù.
28        //   ¸¸¾à ÃÖÃÊ ½ÇÇàÇÏ´Â °æ¿ì¶ó¸é print level 0 ¸¸ º¸¿©¾ß ÇÑ´Ù.
29        //
30        DHL_OS_Printf("=== initless print test\n");
31        for (plevel=0; plevel<6; plevel++) {
32                dprint(plevel, "print without init, in print level %d\n", plevel); 
33        }
34
35        // °¢ ¸ðµâ º° Ãâ·Â Å×½ºÆ®..
36        for (mlevel=-1; mlevel<=6; mlevel++)
37        {
38                DHL_OS_Printf("=== changing module level to %d\n", mlevel);
39                DHL_DBG_SetModuleLevel("DbgTest", mlevel);
40
41                for (plevel=0; plevel<=6; plevel++) {
42                        dprint(plevel, " print level %d. %s\n",
43                                plevel,
44                                plevel <= mlevel ? "it should be seen" : "MUST NOT BE SEEN!");
45                }
46        }
47
48        DHL_OS_Printf("=== register many modules..\n");
49       
50        DHL_DBG_SetModuleLevel("DbgTest1", 1);
51        DHL_DBG_SetModuleLevel("DbgTest2", 2);
52        DHL_DBG_SetModuleLevel("Another1", 3);
53        DHL_DBG_SetModuleLevel("Another2", 4);
54
55        DHL_OS_Printf("=== all module list \n");
56        DHL_DBG_PrintModuleLevel("");
57
58        DHL_OS_Printf("=== module list containing 'Dbg'\n");
59        DHL_DBG_PrintModuleLevel("Dbg");
60
61        DHL_OS_Printf("test end. Press any key to continue..\n");
62        DHL_OS_GetChar();
63       
64}
65
66/*
67        Å×½ºÆ® °á°ú:
68
69This is DbgPrint test. file ../dhl/api/test/DebugPrintTest.c, line 21
70=== initless print test
71[DbgTest ?? 0x20] 6965 print without init, in print level 0
72[DbgTest ?? 0x20] 6971 print without init, in print level 1
73[DbgTest ?? 0x20] 6976 print without init, in print level 2
74[DbgTest ?? 0x20] 6982 print without init, in print level 3
75[DbgTest ?? 0x20] 6988 print without init, in print level 4
76[DbgTest ?? 0x20] 6994 print without init, in print level 5
77=== changing module level to -1
78dbg module 'DbgTest' level changed to -1
79=== changing module level to 0
80dbg module 'DbgTest' level changed to 0
81[DbgTest ?? 0x20] 7014  print level 0. it should be seen
82=== changing module level to 1
83dbg module 'DbgTest' level changed to 1
84[DbgTest ?? 0x20] 7027  print level 0. it should be seen
85[DbgTest ?? 0x20] 7032  print level 1. it should be seen
86=== changing module level to 2
87dbg module 'DbgTest' level changed to 2
88[DbgTest ?? 0x20] 7045  print level 0. it should be seen
89[DbgTest ?? 0x20] 7050  print level 1. it should be seen
90[DbgTest ?? 0x20] 7056  print level 2. it should be seen
91=== changing module level to 3
92dbg module 'DbgTest' level changed to 3
93[DbgTest ?? 0x20] 7068  print level 0. it should be seen
94[DbgTest ?? 0x20] 7074  print level 1. it should be seen
95[DbgTest ?? 0x20] 7080  print level 2. it should be seen
96[DbgTest ?? 0x20] 7085  print level 3. it should be seen
97=== changing module level to 4
98dbg module 'DbgTest' level changed to 4
99[DbgTest ?? 0x20] 7098  print level 0. it should be seen
100[DbgTest ?? 0x20] 7103  print level 1. it should be seen
101[DbgTest ?? 0x20] 7109  print level 2. it should be seen
102[DbgTest ?? 0x20] 7114  print level 3. it should be seen
103[DbgTest ?? 0x20] 7120  print level 4. it should be seen
104=== changing module level to 5
105dbg module 'DbgTest' level changed to 5
106[DbgTest ?? 0x20] 7132  print level 0. it should be seen
107[DbgTest ?? 0x20] 7138  print level 1. it should be seen
108[DbgTest ?? 0x20] 7144  print level 2. it should be seen
109[DbgTest ?? 0x20] 7149  print level 3. it should be seen
110[DbgTest ?? 0x20] 7155  print level 4. it should be seen
111[DbgTest ?? 0x20] 7160  print level 5. it should be seen
112=== changing module level to 6
113dbg module 'DbgTest' level changed to 6
114[DbgTest ?? 0x20] 7173  print level 0. it should be seen
115[DbgTest ?? 0x20] 7178  print level 1. it should be seen
116[DbgTest ?? 0x20] 7184  print level 2. it should be seen
117[DbgTest ?? 0x20] 7190  print level 3. it should be seen
118[DbgTest ?? 0x20] 7195  print level 4. it should be seen
119[DbgTest ?? 0x20] 7201  print level 5. it should be seen
120[DbgTest ?? 0x20] 7206  print level 6. it should be seen
121=== register many modules..
122dbg module 'DbgTest1' level changed to 1
123dbg module 'DbgTest2' level changed to 2
124dbg module 'Another1' level changed to 3
125dbg module 'Another2' level changed to 4
126=== all module list
127===================================
128 ( 0) *fe        : 0
129 ( 1) DbgTest    : 6
130 ( 2) DbgTest1   : 1
131 ( 3) DbgTest2   : 2
132 ( 4) Another1   : 3
133 ( 5) Another2   : 4
134===================================
135 6 modules
136=== module list containing 'Dbg'
137modules that contains 'Dbg'
138===================================
139 ( 1) DbgTest    : 6
140 ( 2) DbgTest1   : 1
141 ( 3) DbgTest2   : 2
142===================================
143 3 modules
144test end. Press any key to continue..
145
146
147*/
148
149void DHL_DebugPrintTest(void)
150{
151        // blank. only for linking.
152}
153
Note: See TracBrowser for help on using the repository browser.