diff options
author | Jinkun Jang <jinkun.jang@samsung.com> | 2013-03-13 01:51:48 +0900 |
---|---|---|
committer | Jinkun Jang <jinkun.jang@samsung.com> | 2013-03-13 01:51:48 +0900 |
commit | d6aa47559c38d7e20d6d6a7a3671fa48ed58b9eb (patch) | |
tree | 5fbc758662a7866e32ec1adcfd9149c71987549e /test/src/suites/unit_test_sample_suite.c | |
parent | 8fe192a924f295972402d46141e39b86241a1441 (diff) | |
download | oma-ds-agent-d6aa47559c38d7e20d6d6a7a3671fa48ed58b9eb.tar.gz oma-ds-agent-d6aa47559c38d7e20d6d6a7a3671fa48ed58b9eb.tar.bz2 oma-ds-agent-d6aa47559c38d7e20d6d6a7a3671fa48ed58b9eb.zip |
Tizen 2.1 base
Diffstat (limited to 'test/src/suites/unit_test_sample_suite.c')
-rwxr-xr-x | test/src/suites/unit_test_sample_suite.c | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/test/src/suites/unit_test_sample_suite.c b/test/src/suites/unit_test_sample_suite.c new file mode 100755 index 0000000..348241e --- /dev/null +++ b/test/src/suites/unit_test_sample_suite.c @@ -0,0 +1,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; +} |