summaryrefslogtreecommitdiff
path: root/test/src/suites/unit_test_sample_suite.c
diff options
context:
space:
mode:
Diffstat (limited to 'test/src/suites/unit_test_sample_suite.c')
-rwxr-xr-xtest/src/suites/unit_test_sample_suite.c63
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;
+}