Changeset 3292
- Timestamp:
- 04/27/08 14:49:42 (5 months ago)
- Files:
-
- trunk/tests/sync-tests/check_sync.c (modified) (51 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/tests/sync-tests/check_sync.c
r3212 r3292 138 138 g_free(path); 139 139 check_hash(table, "testdata"); 140 osync_hashtable_ free(table);140 osync_hashtable_unref(table); 141 141 142 142 path = g_strdup_printf("%s/configs/group/2/hashtable.db", testbed); … … 144 144 g_free(path); 145 145 check_hash(table, "testdata"); 146 osync_hashtable_ free(table);146 osync_hashtable_unref(table); 147 147 148 148 destroy_testbed(testbed); … … 198 198 g_free(path); 199 199 check_hash(table, "testdata"); 200 osync_hashtable_ free(table);200 osync_hashtable_unref(table); 201 201 202 202 path = g_strdup_printf("%s/configs/group/2/hashtable.db", testbed); … … 204 204 g_free(path); 205 205 check_hash(table, "testdata"); 206 osync_hashtable_ free(table);206 osync_hashtable_unref(table); 207 207 208 208 reset_counters(); … … 263 263 table = hashtable_load(path, "mockobjtype1", 0); 264 264 g_free(path); 265 osync_hashtable_ free(table);265 osync_hashtable_unref(table); 266 266 267 267 path = g_strdup_printf("%s/configs/group/2/hashtable.db", testbed); 268 268 table = hashtable_load(path, "mockobjtype1", 0); 269 269 g_free(path); 270 osync_hashtable_ free(table);270 osync_hashtable_unref(table); 271 271 272 272 destroy_testbed(testbed); … … 366 366 g_free(path); 367 367 check_hash(table, "testdata"); 368 osync_hashtable_ free(table);368 osync_hashtable_unref(table); 369 369 370 370 path = g_strdup_printf("%s/configs/group/2/hashtable.db", testbed); … … 372 372 g_free(path); 373 373 check_hash(table, "testdata"); 374 osync_hashtable_ free(table);374 osync_hashtable_unref(table); 375 375 376 376 destroy_testbed(testbed); … … 462 462 g_free(path); 463 463 check_hash(table, "testdata"); 464 osync_hashtable_ free(table);464 osync_hashtable_unref(table); 465 465 466 466 path = g_strdup_printf("%s/configs/group/2/hashtable.db", testbed); … … 468 468 g_free(path); 469 469 check_hash(table, "testdata"); 470 osync_hashtable_ free(table);470 osync_hashtable_unref(table); 471 471 472 472 reset_counters(); … … 527 527 table = hashtable_load(path, "mockobjtype1", 0); 528 528 g_free(path); 529 osync_hashtable_ free(table);529 osync_hashtable_unref(table); 530 530 531 531 path = g_strdup_printf("%s/configs/group/2/hashtable.db", testbed); 532 532 table = hashtable_load(path, "mockobjtype1", 0); 533 533 g_free(path); 534 osync_hashtable_ free(table);534 osync_hashtable_unref(table); 535 535 536 536 destroy_testbed(testbed); … … 625 625 check_hash(table, "testdata"); 626 626 check_hash(table, "testdata-dupe"); 627 osync_hashtable_ free(table);627 osync_hashtable_unref(table); 628 628 629 629 path = g_strdup_printf("%s/configs/group/2/hashtable.db", testbed); … … 632 632 check_hash(table, "testdata"); 633 633 check_hash(table, "testdata-dupe"); 634 osync_hashtable_ free(table);634 osync_hashtable_unref(table); 635 635 636 636 fail_unless(!system("test \"x$(diff -x \".*\" data1 data2)\" = \"x\""), NULL); … … 696 696 g_free(path); 697 697 check_hash(table, "testdata"); 698 osync_hashtable_ free(table);698 osync_hashtable_unref(table); 699 699 700 700 path = g_strdup_printf("%s/configs/group/2/hashtable.db", testbed); … … 702 702 g_free(path); 703 703 check_hash(table, "testdata"); 704 osync_hashtable_ free(table);704 osync_hashtable_unref(table); 705 705 706 706 destroy_testbed(testbed); … … 793 793 osync_mapping_table_unref(maptable); 794 794 795 796 /* Don't care about the hashtable. The engine got aborted - this MUST and WILL 797 cause a slow-sync next time. A slow-sync ends up in flushing the persistent 798 hashtable. */ 799 800 /* 795 801 path = g_strdup_printf("%s/configs/group/1/hashtable.db", testbed); 796 802 OSyncHashTable *table = hashtable_load(path, "mockobjtype1", 1); … … 798 804 check_hash(table, "testdata"); 799 805 // check_hash(table, "testdata-dupe"); 800 osync_hashtable_ free(table);806 osync_hashtable_unref(table); 801 807 802 808 path = g_strdup_printf("%s/configs/group/2/hashtable.db", testbed); … … 805 811 check_hash(table, "testdata"); 806 812 // check_hash(table, "testdata-dupe"); 807 osync_hashtable_free(table); 813 osync_hashtable_unref(table); 814 */ 808 815 809 816 fail_unless(!system("test \"x$(diff -x \".*\" data1 data2)\" != \"x\""), NULL); … … 867 874 osync_mapping_table_unref(maptable); 868 875 876 /* Don't care about the hashtable. The engine got aborted - this MUST and WILL 877 cause a slow-sync next time. A slow-sync ends up in flushing the persistent 878 hashtable. */ 879 880 /* 869 881 path = g_strdup_printf("%s/configs/group/1/hashtable.db", testbed); 870 882 table = hashtable_load(path, "mockobjtype1", 1); 871 883 g_free(path); 872 884 check_hash(table, "testdata"); 873 osync_hashtable_ free(table);885 osync_hashtable_unref(table); 874 886 875 887 path = g_strdup_printf("%s/configs/group/2/hashtable.db", testbed); … … 877 889 g_free(path); 878 890 check_hash(table, "testdata"); 879 osync_hashtable_free(table); 891 osync_hashtable_unref(table); 892 */ 880 893 881 894 destroy_testbed(testbed); … … 1037 1050 check_hash(table, "testdata"); 1038 1051 check_hash(table, "testdata-dupe"); 1039 osync_hashtable_ free(table);1052 osync_hashtable_unref(table); 1040 1053 1041 1054 path = g_strdup_printf("%s/configs/group/2/hashtable.db", testbed); … … 1044 1057 check_hash(table, "testdata"); 1045 1058 check_hash(table, "testdata-dupe"); 1046 osync_hashtable_ free(table);1059 osync_hashtable_unref(table); 1047 1060 1048 1061 … … 1112 1125 g_free(path); 1113 1126 check_hash(table, "testdata"); 1114 osync_hashtable_ free(table);1127 osync_hashtable_unref(table); 1115 1128 1116 1129 path = g_strdup_printf("%s/configs/group/2/hashtable.db", testbed); … … 1118 1131 g_free(path); 1119 1132 check_hash(table, "testdata"); 1120 osync_hashtable_ free(table);1133 osync_hashtable_unref(table); 1121 1134 1122 1135 destroy_testbed(testbed); … … 1219 1232 check_hash(table, "testdata2"); 1220 1233 check_hash(table, "testdata3"); 1221 osync_hashtable_ free(table);1234 osync_hashtable_unref(table); 1222 1235 1223 1236 path = g_strdup_printf("%s/configs/group/2/hashtable.db", testbed); … … 1227 1240 check_hash(table, "testdata2"); 1228 1241 check_hash(table, "testdata3"); 1229 osync_hashtable_ free(table);1242 osync_hashtable_unref(table); 1230 1243 1231 1244 system("rm -f data1/testdata1"); … … 1288 1301 table = hashtable_load(path, "mockobjtype1", 0); 1289 1302 g_free(path); 1290 osync_hashtable_ free(table);1303 osync_hashtable_unref(table); 1291 1304 1292 1305 path = g_strdup_printf("%s/configs/group/2/hashtable.db", testbed); 1293 1306 table = hashtable_load(path, "mockobjtype1", 0); 1294 1307 g_free(path); 1295 osync_hashtable_ free(table);1308 osync_hashtable_unref(table); 1296 1309 1297 1310 destroy_testbed(testbed); … … 1392 1405 OSyncHashTable *table = hashtable_load(path, "mockobjtype1", 0); 1393 1406 g_free(path); 1394 osync_hashtable_ free(table);1407 osync_hashtable_unref(table); 1395 1408 1396 1409 path = g_strdup_printf("%s/configs/group/2/hashtable.db", testbed); 1397 1410 table = hashtable_load(path, "mockobjtype1", 0); 1398 1411 g_free(path); 1399 osync_hashtable_ free(table);1412 osync_hashtable_unref(table); 1400 1413 1401 1414 destroy_testbed(testbed); … … 1496 1509 g_free(path); 1497 1510 check_hash(table, "testdata"); 1498 osync_hashtable_ free(table);1511 osync_hashtable_unref(table); 1499 1512 1500 1513 path = g_strdup_printf("%s/configs/group/2/hashtable.db", testbed); … … 1502 1515 g_free(path); 1503 1516 check_hash(table, "testdata"); 1504 osync_hashtable_ free(table);1517 osync_hashtable_unref(table); 1505 1518 1506 1519 reset_counters(); … … 1561 1574 table = hashtable_load(path, "mockobjtype1", 0); 1562 1575 g_free(path); 1563 osync_hashtable_ free(table);1576 osync_hashtable_unref(table); 1564 1577 1565 1578 path = g_strdup_printf("%s/configs/group/2/hashtable.db", testbed); 1566 1579 table = hashtable_load(path, "mockobjtype1", 0); 1567 1580 g_free(path); 1568 osync_hashtable_ free(table);1581 osync_hashtable_unref(table); 1569 1582 1570 1583 destroy_testbed(testbed); … … 1667 1680 OSyncHashTable *table = hashtable_load(path, "mockobjtype1", 0); 1668 1681 g_free(path); 1669 osync_hashtable_ free(table);1682 osync_hashtable_unref(table); 1670 1683 1671 1684 path = g_strdup_printf("%s/configs/group/2/hashtable.db", testbed); 1672 1685 table = hashtable_load(path, "mockobjtype1", 0); 1673 1686 g_free(path); 1674 osync_hashtable_ free(table);1687 osync_hashtable_unref(table); 1675 1688 1676 1689 fail_unless(!system("test \"x$(ls data1)\" = \"x\""), NULL); … … 1769 1782 check_hash(table, "testdata"); 1770 1783 check_hash(table, "testdata2"); 1771 osync_hashtable_ free(table);1784 osync_hashtable_unref(table); 1772 1785 1773 1786 path = g_strdup_printf("%s/configs/group/2/hashtable.db", testbed); … … 1776 1789 check_hash(table, "testdata"); 1777 1790 check_hash(table, "testdata2"); 1778 osync_hashtable_ free(table);1791 osync_hashtable_unref(table); 1779 1792 1780 1793 reset_counters(); … … 1837 1850 table = hashtable_load(path, "mockobjtype1", 0); 1838 1851 g_free(path); 1839 osync_hashtable_ free(table);1852 osync_hashtable_unref(table); 1840 1853 1841 1854 path = g_strdup_printf("%s/configs/group/2/hashtable.db", testbed); 1842 1855 table = hashtable_load(path, "mockobjtype1", 0); 1843 1856 g_free(path); 1844 osync_hashtable_ free(table);1857 osync_hashtable_unref(table); 1845 1858 1846 1859 fail_unless(!system("test \"x$(ls data1)\" = \"x\""), NULL); … … 1975 1988 check_hash(table, "file9"); 1976 1989 check_hash(table, "file10"); 1977 osync_hashtable_ free(table);1990 osync_hashtable_unref(table); 1978 1991 1979 1992 path = g_strdup_printf("%s/configs/group/2/hashtable.db", testbed); … … 1990 2003 check_hash(table, "file9"); 1991 2004 check_hash(table, "file10"); 1992 osync_hashtable_ free(table);2005 osync_hashtable_unref(table); 1993 2006 1994 2007 reset_counters(); … … 2108 2121 check_hash(table, "file13"); 2109 2122 check_hash(table, "file14"); 2110 osync_hashtable_ free(table);2123 osync_hashtable_unref(table); 2111 2124 2112 2125 path = g_strdup_printf("%s/configs/group/2/hashtable.db", testbed); … … 2123 2136 check_hash(table, "file13"); 2124 2137 check_hash(table, "file14"); 2125 osync_hashtable_ free(table);2138 osync_hashtable_unref(table); 2126 2139 2127 2140 … … 2199 2212 table = hashtable_load(path, "mockobjtype1", 0); 2200 2213 g_free(path); 2201 osync_hashtable_ free(table);2214 osync_hashtable_unref(table); 2202 2215 2203 2216 path = g_strdup_printf("%s/configs/group/2/hashtable.db", testbed); 2204 2217 table = hashtable_load(path, "mockobjtype1", 0); 2205 2218 g_free(path); 2206 osync_hashtable_ free(table);2219 osync_hashtable_unref(table); 2207 2220 2208 2221 fail_unless(!system("test \"x$(ls data1)\" = \"x\""), NULL); … … 2404 2417 g_free(path); 2405 2418 check_hash(table, "file1"); 2406 osync_hashtable_ free(table);2419 osync_hashtable_unref(table); 2407 2420 2408 2421 path = g_strdup_printf("%s/configs/group/2/hashtable.db", testbed); … … 2410 2423 g_free(path); 2411 2424 check_hash(table, "file1"); 2412 osync_hashtable_ free(table);2425 osync_hashtable_unref(table); 2413 2426 2414 2427 destroy_testbed(testbed); … … 2602 2615 g_free(path); 2603 2616 check_hash(table, "file1"); 2604 osync_hashtable_ free(table);2617 osync_hashtable_unref(table); 2605 2618 2606 2619 path = g_strdup_printf("%s/configs/group/2/hashtable.db", testbed); … … 2608 2621 g_free(path); 2609 2622 check_hash(table, "file1"); 2610 osync_hashtable_ free(table);2623 osync_hashtable_unref(table); 2611 2624 2612 2625 destroy_testbed(testbed); … … 2705 2718 g_free(path); 2706 2719 check_hash(table, "testdata"); 2707 osync_hashtable_ free(table);2720 osync_hashtable_unref(table); 2708 2721 2709 2722 path = g_strdup_printf("%s/configs/group/2/hashtable.db", testbed); … … 2711 2724 g_free(path); 2712 2725 check_hash(table, "testdata"); 2713 osync_hashtable_ free(table);2726 osync_hashtable_unref(table); 2714 2727 2715 2728 /* 2nd Sync with new path config for #1 member - this is needed … … 2801 2814 g_free(path); 2802 2815 check_hash(table, "testdata"); 2803 osync_hashtable_ free(table);2816 osync_hashtable_unref(table); 2804 2817 2805 2818 path = g_strdup_printf("%s/configs/group/2/hashtable.db", testbed); … … 2807 2820 g_free(path); 2808 2821 check_hash(table, "testdata"); 2809 osync_hashtable_ free(table);2822 osync_hashtable_unref(table); 2810 2823 2811 2824 destroy_testbed(testbed); … … 2907 2920 g_free(path); 2908 2921 check_hash(table, "testdata"); 2909 osync_hashtable_ free(table);2922 osync_hashtable_unref(table); 2910 2923 2911 2924 path = g_strdup_printf("%s/configs/group/2/hashtable.db", testbed); … … 2913 2926 g_free(path); 2914 2927 check_hash(table, "testdata"); 2915 osync_hashtable_ free(table);2928 osync_hashtable_unref(table); 2916 2929 2917 2930 /* 2nd Sync trigger a SlowSync within the MAINSINK connect function. */ … … 3002 3015 g_free(path); 3003 3016 check_hash(table, "testdata"); 3004 osync_hashtable_ free(table);3017 osync_hashtable_unref(table); 3005 3018 3006 3019 path = g_strdup_printf("%s/configs/group/2/hashtable.db", testbed); … … 3008 3021 g_free(path); 3009 3022 check_hash(table, "testdata"); 3010 osync_hashtable_ free(table);3023 osync_hashtable_unref(table); 3011 3024 3012 3025 destroy_testbed(testbed);
