summaryrefslogtreecommitdiff
path: root/test/src/suites/unit_test_sample_suite.c
blob: 348241e45c38f03b21ac118b8aade7a4674d899d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
/*
 * oma-ds-agent
 * Copyright (c) 2012 Samsung Electronics Co., Ltd.
 *
 * Licensed under the Apache License, Version 2.0 (the License);
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include "unit_test_common.h"
#include "suites/unit_test_sample_suite.h"

START_TEST(sample_test1)
{
	fail_unless(2 != 1, "2 != 1 failed");
	fail_unless(3 != 1, "3 != 1 failed");
}

END_TEST START_TEST(sample_test2)
{
	/* unit test code */
	fail_unless(10 != 5, "10 != 5 failed");
}

END_TEST Suite *sample_suite(void)
{
	/* create test suite */
	Suite *s = suite_create("Sample");

	/* test case create and add in suite */
	{
		TCase *tcase = tcase_create("SampleTestCase");
		/* TODO : explain following lines */
		/*  tcase_add_unchecked_fixture (tcase, setup, teardown); */
		/*  tcase_add_checked_fixture (tcase, setup, teardown); */

		tcase_add_test(tcase, sample_test1);
		tcase_add_test(tcase, sample_test2);
		/* TODO : explain following lines */
		tcase_set_timeout(tcase, 1);

		suite_add_tcase(s, tcase);
	}

	/* create another test case and add to test suite just like above code */
	{
		TCase *tc_core2 = tcase_create("Sample2");
		tcase_add_test(tc_core2, sample_test1);
		tcase_add_test(tc_core2, sample_test2);
		tcase_set_timeout(tc_core2, 1);
		suite_add_tcase(s, tc_core2);
	}

	return s;
}