upload tizen1.0 source
[framework/system/sync-agent.git] / framework / test / src / suites / unit_test_fw_log_suite.c
1 /*
2  * unit_test_fw_log_suite.c
3  *
4  *  Created on: 2011. 9. 25.
5  *      Author: yangjoo.suh
6  */
7
8 #include "unit_test_common.h"
9 #include "suites/unit_test_fw_log_suite.h"
10 #include "Utility/fw_log.h"
11
12 /* test external interfaces */
13
14 #define LOG_TAG "UNIT_TEST_FW_LOG"
15
16 START_TEST(_color_logging_test)
17 {
18         /* first example : logging with default option */
19         FW_LOGV("print with default option !");
20
21         /* second example : logging with background color & word color */
22         /* note that in below code, FW_TM_OPT_RED_WORD & FW_TM_OPT_WHITE_BACKGROUND is separated by space operator */
23         /* and the order is not important */
24         FW_LOGV_WITH_TERMINAL_OPTION(FW_TM_OPT_RED_WORD FW_TM_OPT_WHITE_BACKGROUND, "print red word in white background !");
25
26         /* third example : setting only word color */
27         FW_LOGV_WITH_TERMINAL_OPTION(FW_TM_OPT_GREEN_WORD, "print green word in default background !");
28
29         /* second example : setting only background color */
30         FW_LOGV_WITH_TERMINAL_OPTION(FW_TM_OPT_BLUE_BACKGROUND, "print default color word in blue background !");
31 }
32
33 END_TEST Suite *fw_log_suite(void)
34 {
35         /* create test suite */
36         Suite *s = suite_create("fw_logging");
37
38         /* test case create and add in suite */
39         {
40                 TCase *tcase = tcase_create("color logging test");
41
42                 tcase_add_test(tcase, _color_logging_test);
43                 tcase_set_timeout(tcase, 1);
44
45                 suite_add_tcase(s, tcase);
46         }
47
48         return s;
49 }