Tizen 2.0 Release
[pkgs/o/oma-ds-service.git] / test / src / suites / unit_test_sample_suite.c
1 /*
2  * oma-ds-agent
3  * Copyright (c) 2012 Samsung Electronics Co., Ltd.
4  *
5  * Licensed under the Apache License, Version 2.0 (the License);
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  *     http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  */
17
18 #include "unit_test_common.h"
19 #include "suites/unit_test_sample_suite.h"
20
21 START_TEST(sample_test1)
22 {
23         fail_unless(2 != 1, "2 != 1 failed");
24         fail_unless(3 != 1, "3 != 1 failed");
25 }
26
27 END_TEST START_TEST(sample_test2)
28 {
29         /* unit test code */
30         fail_unless(10 != 5, "10 != 5 failed");
31 }
32
33 END_TEST Suite *sample_suite(void)
34 {
35         /* create test suite */
36         Suite *s = suite_create("Sample");
37
38         /* test case create and add in suite */
39         {
40                 TCase *tcase = tcase_create("SampleTestCase");
41                 /* TODO : explain following lines */
42                 /*  tcase_add_unchecked_fixture (tcase, setup, teardown); */
43                 /*  tcase_add_checked_fixture (tcase, setup, teardown); */
44
45                 tcase_add_test(tcase, sample_test1);
46                 tcase_add_test(tcase, sample_test2);
47                 /* TODO : explain following lines */
48                 tcase_set_timeout(tcase, 1);
49
50                 suite_add_tcase(s, tcase);
51         }
52
53         /* create another test case and add to test suite just like above code */
54         {
55                 TCase *tc_core2 = tcase_create("Sample2");
56                 tcase_add_test(tc_core2, sample_test1);
57                 tcase_add_test(tc_core2, sample_test2);
58                 tcase_set_timeout(tc_core2, 1);
59                 suite_add_tcase(s, tc_core2);
60         }
61
62         return s;
63 }