summaryrefslogtreecommitdiffstats
path: root/debian/opensync/opensync-0.22/tests/check_group.c
diff options
context:
space:
mode:
authorMichele Calgaro <michele.calgaro@yahoo.it>2020-09-11 14:38:47 +0900
committerMichele Calgaro <michele.calgaro@yahoo.it>2020-09-11 14:38:47 +0900
commit884c8093d63402a1ad0b502244b791e3c6782be3 (patch)
treea600d4ab0d431a2bdfe4c15b70df43c14fbd8dd0 /debian/opensync/opensync-0.22/tests/check_group.c
parent14e1aa2006796f147f3f4811fb908a6b01e79253 (diff)
downloadextra-dependencies-884c8093d63402a1ad0b502244b791e3c6782be3.tar.gz
extra-dependencies-884c8093d63402a1ad0b502244b791e3c6782be3.zip
Added debian extra dependency packages.
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'debian/opensync/opensync-0.22/tests/check_group.c')
-rw-r--r--debian/opensync/opensync-0.22/tests/check_group.c62
1 files changed, 62 insertions, 0 deletions
diff --git a/debian/opensync/opensync-0.22/tests/check_group.c b/debian/opensync/opensync-0.22/tests/check_group.c
new file mode 100644
index 00000000..91d84773
--- /dev/null
+++ b/debian/opensync/opensync-0.22/tests/check_group.c
@@ -0,0 +1,62 @@
+#include "support.h"
+
+START_TEST (group_last_sync)
+{
+ char *testbed = setup_testbed("filter_save_and_load");
+
+ OSyncEnv *env = init_env();
+ OSyncGroup *group = osync_group_load(env, "configs/group", NULL);
+ fail_unless(group != NULL, NULL);
+ fail_unless(osync_env_num_groups(env) == 1, NULL);
+ mark_point();
+
+ osync_group_set_last_synchronization(group, (time_t)1000);
+
+ fail_unless((int)osync_group_get_last_synchronization(group) == 1000, NULL);
+
+ OSyncError *error = NULL;
+ fail_unless(osync_group_save(group, &error), NULL);
+
+ fail_unless(osync_env_finalize(env, NULL), NULL);
+ osync_env_free(env);
+
+ env = init_env();
+ group = osync_group_load(env, "configs/group", NULL);
+ fail_unless(group != NULL, NULL);
+ fail_unless(osync_env_num_groups(env) == 1, NULL);
+ mark_point();
+
+ fail_unless((int)osync_group_get_last_synchronization(group) == 1000, NULL);
+
+ fail_unless(osync_env_finalize(env, NULL), NULL);
+ osync_env_free(env);
+ destroy_testbed(testbed);
+}
+END_TEST
+
+Suite *group_suite(void)
+{
+ Suite *s = suite_create("Group");
+ TCase *tc_core = tcase_create("Core");
+
+ suite_add_tcase (s, tc_core);
+ tcase_add_test(tc_core, group_last_sync);
+
+ return s;
+}
+
+int main(void)
+{
+ int nf;
+
+ Suite *s = group_suite();
+
+ SRunner *sr;
+ sr = srunner_create(s);
+
+// srunner_set_fork_status (sr, CK_NOFORK);
+ srunner_run_all(sr, CK_NORMAL);
+ nf = srunner_ntests_failed(sr);
+ srunner_free(sr);
+ return (nf == 0) ? EXIT_SUCCESS : EXIT_FAILURE;
+}