You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
(56) |
Apr
(109) |
May
(15) |
Jun
(3) |
Jul
(37) |
Aug
(96) |
Sep
(40) |
Oct
(4) |
Nov
(54) |
Dec
|
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(47) |
Feb
(30) |
Mar
(102) |
Apr
(120) |
May
(68) |
Jun
(54) |
Jul
(53) |
Aug
(122) |
Sep
(190) |
Oct
(71) |
Nov
(85) |
Dec
(108) |
2007 |
Jan
(72) |
Feb
(190) |
Mar
(53) |
Apr
(101) |
May
(145) |
Jun
(148) |
Jul
(167) |
Aug
(143) |
Sep
(23) |
Oct
(198) |
Nov
(223) |
Dec
(195) |
2008 |
Jan
(100) |
Feb
(129) |
Mar
(79) |
Apr
(77) |
May
(34) |
Jun
(95) |
Jul
(112) |
Aug
(160) |
Sep
(82) |
Oct
(124) |
Nov
(199) |
Dec
(355) |
2009 |
Jan
(436) |
Feb
(89) |
Mar
(298) |
Apr
(189) |
May
(33) |
Jun
(88) |
Jul
(105) |
Aug
(44) |
Sep
(181) |
Oct
(87) |
Nov
(75) |
Dec
(1) |
2010 |
Jan
(63) |
Feb
(21) |
Mar
(3) |
Apr
(1) |
May
(1) |
Jun
(3) |
Jul
(26) |
Aug
(37) |
Sep
(26) |
Oct
(15) |
Nov
(13) |
Dec
|
From: <svn...@op...> - 2009-04-22 11:51:26
|
Author: bellmich Date: Wed Apr 22 13:51:14 2009 New Revision: 205 URL: http://libwbxml.opensync.org/changeset/205 Log: committed patch from Ossi Jormakka (Ixonos Plc) (extended tables for AIRSYNC (Microsoft)) Modified: wbxml2/trunk/src/wbxml_tables.c Modified: wbxml2/trunk/src/wbxml_tables.c ============================================================================== --- wbxml2/trunk/src/wbxml_tables.c Tue Mar 31 18:13:45 2009 (r204) +++ wbxml2/trunk/src/wbxml_tables.c Wed Apr 22 13:51:14 2009 (r205) @@ -2583,6 +2583,9 @@ { "SoftDelete", 0x00, 0x21 }, { "MIMESupport", 0x00, 0x22 }, { "MIMETruncation", 0x00, 0x23 }, + { "Wait", 0x00, 0x24 }, + { "Limit", 0x00, 0x25 }, + { "Partial", 0x00, 0x26 }, /* Code Page: "POOMCONTACTS" */ { "Anniversary", 0x01, 0x05 }, @@ -2696,6 +2699,11 @@ { "MIMETruncated", 0x02, 0x37 }, { "MIMESize", 0x02, 0x38 }, { "InternetCPID", 0x02, 0x39 }, + { "Flag", 0x02, 0x3a }, + { "FlagStatus", 0x02, 0x3b }, + { "ContentClass", 0x02, 0x3c }, + { "FlagType", 0x02, 0x3d }, + { "CompleteTime", 0x02, 0x3e }, /* Code Page: "AirNotify" */ { "Notify", 0x03, 0x05 }, @@ -2717,6 +2725,7 @@ { "Id", 0x03, 0x14 }, { "Expiry", 0x03, 0x15 }, { "NotifyGUID", 0x03, 0x16 }, + { "DeviceFriendlyName", 0x03, 0x17 }, /* Code Page: "POOMCAL" */ { "Timezone", 0x04, 0x05 }, @@ -2755,6 +2764,8 @@ { "Subject", 0x04, 0x26 }, { "StartTime", 0x04, 0x27 }, { "UID", 0x04, 0x28 }, + { "AttendeeStatus", 0x04, 0x29 }, + { "AttendeeType", 0x04, 0x2a }, /* Code Page: "Move" */ { "Moves", 0x05, 0x05 }, @@ -2841,6 +2852,8 @@ { "UtcStartDate", 0x09, 0x1f }, { "Subject", 0x09, 0x20 }, { "Rtf", 0x09, 0x21 }, + { "OrdinalDate", 0x09, 0x22 }, + { "SubOrdinalDate", 0x09, 0x23 }, /* Code Page: "ResolveRecipients" */ { "ResolveRecipients", 0x0a, 0x05 }, @@ -2881,7 +2894,187 @@ { "NickName", 0x0c, 0x0d }, { "MMS", 0x0c, 0x0e }, - { NULL, 0x00, 0x00 } + /* Code Page: "Ping" */ + { "Ping", 0x0d, 0x05 }, + { "AutdState", 0x0d, 0x06 }, + { "Status", 0x0d, 0x07 }, + { "HeartbeatInterval", 0x0d, 0x08 }, + { "Folders", 0x0d, 0x09 }, + { "Folder", 0x0d, 0x0a }, + { "Id", 0x0d, 0x0b }, + { "Class", 0x0d, 0x0c }, + { "MaxFolders", 0x0d, 0x0d }, + + /* Code Page: "Provision" */ + { "Provision", 0x0e, 0x05 }, + { "Policies", 0x0e, 0x06 }, + { "Policy", 0x0e, 0x07 }, + { "PolicyType", 0x0e, 0x08 }, + { "PolicyKey", 0x0e, 0x09 }, + { "Data", 0x0e, 0x0a }, + { "Status", 0x0e, 0x0b }, + { "RemoteWipe", 0x0e, 0x0c }, + { "EASProvisionDoc", 0x0e, 0x0d }, + { "DevicePasswordEnabled", 0x0e, 0x0e }, + { "AlphanumericDevicePasswordRequired", 0x0e, 0x0f }, + { "DeviceEncryptionEnabled", 0x0e, 0x10 }, + { "PasswordRecoveryEnabled", 0x0e, 0x11 }, + { "DocumentBrowseEnabled", 0x0e, 0x12 }, + { "AttachmentsEnabled", 0x0e, 0x13 }, + { "MinDevicePasswordLength", 0x0e, 0x14 }, + { "MaxInactivityTimeDeviceLock", 0x0e, 0x15 }, + { "MaxDevicePasswordFailedAttempts", 0x0e, 0x16 }, + { "MaxAttachmentSize", 0x0e, 0x17 }, + { "AllowSimpleDevicePassword", 0x0e, 0x18 }, + { "DevicePasswordExpiration", 0x0e, 0x19 }, + { "DevicePasswordHistory", 0x0e, 0x1a }, + { "AllowStorageCard", 0x0e, 0x1b }, + { "AllowCamera", 0x0e, 0x1c }, + { "RequireDeviceEncryption", 0x0e, 0x1d }, + { "AllowUnsignedApplications", 0x0e, 0x1e }, + { "AllowUnsignedInstallationPackages", 0x0e, 0x1f }, + { "MinDevicePasswordComplexCharacters", 0x0e, 0x20 }, + { "AllowWiFi", 0x0e, 0x21 }, + { "AllowTextMessaging", 0x0e, 0x22 }, + { "AllowPOPIMAPEmail", 0x0e, 0x23 }, + { "AllowBluetooth", 0x0e, 0x24 }, + { "AllowIrDA", 0x0e, 0x25 }, + { "RequireManualSyncWhenRoaming", 0x0e, 0x26 }, + { "AllowDesktopSync", 0x0e, 0x27 }, + { "MaxCalendarAgeFilter", 0x0e, 0x28 }, + { "AllowHTMLEmail", 0x0e, 0x29 }, + { "MaxEmailAgeFilter", 0x0e, 0x2a }, + { "MaxEmailBodyTruncationSize", 0x0e, 0x2b }, + { "MaxEmailHTMLBodyTruncationSize", 0x0e, 0x2c }, + { "RequireSignedSMIMEMessages", 0x0e, 0x2d }, + { "RequireEncryptedSMIMEMessages", 0x0e, 0x2e }, + { "RequireSignedSMIMEAlgorithm", 0x0e, 0x2f }, + { "RequireEncryptionSMIMEAlgorithm", 0x0e, 0x30 }, + { "AllowSMIMEEncryptionAlgorithmNegotiation", 0x0e, 0x31 }, + { "AllowSMIMESoftCerts", 0x0e, 0x32 }, + { "AllowBrowser", 0x0e, 0x33 }, + { "AllowConsumerEmail", 0x0e, 0x34 }, + { "AllowRemoteDesktop", 0x0e, 0x35 }, + { "AllowInternetSharing", 0x0e, 0x36 }, + { "UnapprovedInROMApplicationList", 0x0e, 0x37 }, + { "ApplicationName", 0x0e, 0x38 }, + { "ApprovedApplicationList", 0x0e, 0x39 }, + { "Hash", 0x0e, 0x3a }, + + /* Code Page: "Search" */ + { "Search", 0x0f, 0x05 }, + { "Store", 0x0f, 0x07 }, + { "Name", 0x0f, 0x08 }, + { "Query", 0x0f, 0x09 }, + { "Options", 0x0f, 0x0a }, + { "Range", 0x0f, 0x0b }, + { "Status", 0x0f, 0x0c }, + { "Response", 0x0f, 0x0d }, + { "Result", 0x0f, 0x0e }, + { "Properties", 0x0f, 0x0f }, + { "Total", 0x0f, 0x10 }, + { "EqualTo", 0x0f, 0x11 }, + { "Value", 0x0f, 0x12 }, + { "And", 0x0f, 0x13 }, + { "Or", 0x0f, 0x14 }, + { "FreeText", 0x0f, 0x15 }, + { "DeepTraversal", 0x0f, 0x17 }, + { "LongId", 0x0f, 0x18 }, + { "RebuildResults", 0x0f, 0x19 }, + { "LessThan", 0x0f, 0x1a }, + { "GreaterThan", 0x0f, 0x1b }, + { "Schema", 0x0f, 0x1c }, + { "Supported", 0x0f, 0x1d }, + + /* Code Page: "GAL" */ + { "DisplayName", 0x10, 0x05 }, + { "Phone", 0x10, 0x06 }, + { "Office", 0x10, 0x07 }, + { "Title", 0x10, 0x08 }, + { "Company", 0x10, 0x09 }, + { "Alias", 0x10, 0x0a }, + { "FirstName", 0x10, 0x0b }, + { "LastName", 0x10, 0x0c }, + { "HomePhone", 0x10, 0x0d }, + { "MobilePhone", 0x10, 0x0e }, + { "EmailAddress", 0x10, 0x0f }, + + /* Code Page: "AirSyncBase" */ + { "BodyPreference", 0x11, 0x05 }, + { "Type", 0x11, 0x06 }, + { "TruncationSize", 0x11, 0x07 }, + { "AllOrNone", 0x11, 0x08 }, + { "Body", 0x11, 0x0a }, + { "Data", 0x11, 0x0b }, + { "EstimatedDataSize", 0x11, 0x0c }, + { "Truncated", 0x11, 0x0d }, + { "Attachments", 0x11, 0x0e }, + { "Attachment", 0x11, 0x0f }, + { "DisplayName", 0x11, 0x10 }, + { "FileReference", 0x11, 0x11 }, + { "Method", 0x11, 0x12 }, + { "ContentId", 0x11, 0x13 }, + { "ContentLocation", 0x11, 0x14 }, + { "IsInline", 0x11, 0x15 }, + { "NativeBodyType", 0x11, 0x16 }, + { "ContentType", 0x11, 0x17 }, + + /* Code Page: "Settings" */ + { "Settings", 0x12, 0x05 }, + { "Status", 0x12, 0x06 }, + { "Get", 0x12, 0x07 }, + { "Set", 0x12, 0x08 }, + { "Oof", 0x12, 0x09 }, + { "OofState", 0x12, 0x0a }, + { "StartTime", 0x12, 0x0b }, + { "EndTime", 0x12, 0x0c }, + { "OofMessage", 0x12, 0x0d }, + { "AppliesToInternal", 0x12, 0x0e }, + { "AppliesToExternalKnown", 0x12, 0x0f }, + { "AppliesToExternalUnknown", 0x12, 0x10 }, + { "Enabled", 0x12, 0x11 }, + { "ReplyMessage", 0x12, 0x12 }, + { "BodyType", 0x12, 0x13 }, + { "DevicePassword", 0x12, 0x14 }, + { "Password", 0x12, 0x15 }, + { "DeviceInformaton", 0x12, 0x16 }, + { "Model", 0x12, 0x17 }, + { "IMEI", 0x12, 0x18 }, + { "FriendlyName", 0x12, 0x19 }, + { "OS", 0x12, 0x1a }, + { "OSLanguage", 0x12, 0x1b }, + { "PhoneNumber", 0x12, 0x1c }, + { "UserInformation", 0x12, 0x1d }, + { "EmailAddresses", 0x12, 0x1e }, + { "SmtpAddress", 0x12, 0x1f }, + + /* Code Page: "DocumentLibrary" */ + { "LinkId", 0x13, 0x05 }, + { "DisplayName", 0x13, 0x06 }, + { "IsFolder", 0x13, 0x07 }, + { "CreationDate", 0x13, 0x08 }, + { "LastModifiedDate", 0x13, 0x09 }, + { "IsHidden", 0x13, 0x0a }, + { "ContentLength", 0x13, 0x0b }, + { "ContentType", 0x13, 0x0c }, + + /* Code Page: "ItemOperations" */ + { "ItemOperations", 0x14, 0x05 }, + { "Fetch", 0x14, 0x06 }, + { "Store", 0x14, 0x07 }, + { "Options", 0x14, 0x08 }, + { "Range", 0x14, 0x09 }, + { "Total", 0x14, 0x0a }, + { "Properties", 0x14, 0x0b }, + { "Data", 0x14, 0x0c }, + { "Status", 0x14, 0x0d }, + { "Response", 0x14, 0x0e }, + { "Version", 0x14, 0x0f }, + { "Schema", 0x14, 0x10 }, + { "Part", 0x14, 0x11 }, + { "EmptyFolderContents", 0x14, 0x12 }, + { "DeleteSubFolders", 0x14, 0x13 }, + { NULL, 0x00, 0x00 } }; /* NOTE: @@ -2905,6 +3098,14 @@ * ResolveRecipients: http://synce.org/formats/airsync_wm5/resolverecipients * ValidateCert: http://synce.org/formats/airsync_wm5/validatecert * POOMCONTACTS2: http://synce.org/formats/airsync_wm5/contacts2 + * Ping: http://synce.org/formats/airsync_wm5/ping + * Provision: http://synce.org/formats/airsync_wm5/provision + * Search: http://synce.org/formats/airsync_wm5/search + * GAL: http://synce.org/formats/airsync_wm5/gal + * AirSyncBase: http://synce.org/formats/airsync_wm5/airsyncbase + * Settings: http://synce.org/formats/airsync_wm5/settings + * DocumentLibrary: http://synce.org/formats/airsync_wm5/documentlibrary + * ItemOperations: http://synce.org/formats/airsync_wm5/itemoperations * */ const WBXMLNameSpaceEntry sv_airsync_ns_table[] = { @@ -2921,6 +3122,14 @@ { "http://synce.org/formats/airsync_wm5/resolverecipients", 0x0a }, /**< Code Page 10 */ { "http://synce.org/formats/airsync_wm5/validatecert", 0x0b }, /**< Code Page 11 */ { "http://synce.org/formats/airsync_wm5/contacts2", 0x0c }, /**< Code Page 12 */ + { "http://synce.org/formats/airsync_wm5/ping", 0x0d }, /**< Code Page 13 */ + { "http://synce.org/formats/airsync_wm5/provision", 0x0e }, /**< Code Page 14 */ + { "http://synce.org/formats/airsync_wm5/search", 0x0f }, /**< Code Page 15 */ + { "http://synce.org/formats/airsync_wm5/gal", 0x10 }, /**< Code Page 16 */ + { "http://synce.org/formats/airsync_wm5/airsyncbase", 0x11 }, /**< Code Page 17 */ + { "http://synce.org/formats/airsync_wm5/settings", 0x12 }, /**< Code Page 18 */ + { "http://synce.org/formats/airsync_wm5/documentlibrary", 0x13 }, /**< Code Page 19 */ + { "http://synce.org/formats/airsync_wm5/itemoperations", 0x14 }, /**< Code Page 20 */ { NULL, 0x00 } }; |
From: <svn...@op...> - 2009-04-20 17:11:14
|
Author: ianmartin Date: Mon Apr 20 19:11:01 2009 New Revision: 5624 URL: http://www.opensync.org/changeset/5624 Log: Test multisync_conflict_dual_delete added. Isolates a problem found whilst porting multisync_delayed_conflict_handler test. Test fails due to propogation of delete change type to a member that also reported change type delted. Modified: trunk/tests/support.c trunk/tests/support.h trunk/tests/sync-tests/check_multisync.c Modified: trunk/tests/support.c ============================================================================== --- trunk/tests/support.c Sun Apr 19 17:09:32 2009 (r5623) +++ trunk/tests/support.c Mon Apr 20 19:11:01 2009 (r5624) @@ -275,6 +275,27 @@ osync_trace(TRACE_EXIT, "%s", __func__); } +void validate_mapping_table(const char *testbed, unsigned int num_members, const char *uids[], unsigned int num_uids) +{ + unsigned int member; + unsigned int uid; + osync_trace(TRACE_ENTRY, "%s(%s, %i, %p, %i)", __func__, testbed, num_members, uids, num_uids); + + char *path = g_strdup_printf("%s/configs/group/archive.db", testbed); + OSyncMappingTable *maptable = mappingtable_load(path, "mockobjtype1", num_uids); + g_free(path); + + /* check we have num_members mapping entries for each uid */ + for (uid = 0; uid < num_uids; uid++) { + for (member = 1; member <= num_members; member++) { + check_mapping(maptable, member, -1, num_members, uids[uid]); + } + } + osync_mapping_table_close(maptable); + osync_mapping_table_unref(maptable); + osync_trace(TRACE_EXIT, "%s", __func__); +} + OSyncHashTable *hashtable_load(const char *path, const char *objtype, unsigned int entries) { OSyncError *error = NULL; Modified: trunk/tests/support.h ============================================================================== --- trunk/tests/support.h Sun Apr 19 17:09:32 2009 (r5623) +++ trunk/tests/support.h Mon Apr 20 19:11:01 2009 (r5624) @@ -100,6 +100,15 @@ OSyncHashTable *hashtable_load(const char *path, const char *objtype, unsigned int entries); void check_hash(OSyncHashTable *table, const char *cmpuid); void check_mapping(OSyncMappingTable *table, int memberid, int mappingid, unsigned int numentries, const char *uid); +/** @brief Confirms a mapping table is complete after a sync + Does not work if conflicts have been ignored + + @param testbed path to the testbed + @param num_members number of members the sync was performed between + @param uids array of uids that should be in the mapping table + @param num_uids number of uids in the uids array +*/ +void validate_mapping_table(const char *testbed, unsigned int num_members, const char *uids[], unsigned int num_uids); void create_random_file(const char *path); Modified: trunk/tests/sync-tests/check_multisync.c ============================================================================== --- trunk/tests/sync-tests/check_multisync.c Sun Apr 19 17:09:32 2009 (r5623) +++ trunk/tests/sync-tests/check_multisync.c Mon Apr 20 19:11:01 2009 (r5624) @@ -988,6 +988,53 @@ } END_TEST +/* Delete twice and make a change forcing a conflict */ +START_TEST (multisync_conflict_dual_delete) +{ + char *testbed = setup_testbed("multisync_easy_new"); + OSyncError *error = NULL; + OSyncEngine *engine = setup_engine(testbed); + osync_engine_set_conflict_callback(engine, conflict_handler_choose_first, GINT_TO_POINTER(3)); + fail_unless(osync_engine_initialize(engine, &error), NULL); + fail_unless(error == NULL, NULL); + + mark_point(); + + synchronize_once(engine, NULL); + + hashtable_simple_load_and_check(testbed, 1); + hashtable_simple_load_and_check(testbed, 2); + hashtable_simple_load_and_check(testbed, 3); + const char *uids[] = {"testdata"}; + unsigned int num_uids = 1; + validate_mapping_table(testbed, 3, uids, num_uids); + + fail_unless(osync_testing_diff("data1", "data2")); + fail_unless(osync_testing_diff("data1", "data3")); + + + g_usleep(2*G_USEC_PER_SEC); + osync_testing_system_abort("rm -f data1/testdata"); + osync_testing_system_abort("cp newdata data2/testdata"); + osync_testing_system_abort("rm -f data3/testdata"); + + synchronize_once(engine, NULL); + destroy_engine(engine); + + fail_unless(num_engine_connected == 1, NULL); + fail_unless(num_engine_read == 1, NULL); + fail_unless(num_engine_written == 1, NULL); + fail_unless(num_engine_disconnected == 1, NULL); + fail_unless(num_change_read == 3, NULL); + fail_unless(num_mapping_conflicts == 1, NULL); + fail_unless(num_change_written == 1, NULL); + + check_empty(testbed); + + destroy_testbed(testbed); +} +END_TEST + /* Sync from data1/testdata to all * remove data1 and change data2 to newdata2 and data3 to newdata * conflict_handler_choose_modified picks the first modified so should get newdata2 @@ -1187,29 +1234,6 @@ } END_TEST -/* Given a number of members and a set of uids we check - * the number of mappings == num_uids - * there are num_member connections in each map for all the given uids - */ -void validate_mapping_table(const char *testbed, unsigned int num_members, const char *uids[], unsigned int num_uids) -{ - unsigned int member; - unsigned int uid; - - char *path = g_strdup_printf("%s/configs/group/archive.db", testbed); - OSyncMappingTable *maptable = mappingtable_load(path, "mockobjtype1", num_uids); - g_free(path); - - /* check we have num_members mapping entries for each uid */ - for (uid = 0; uid < num_uids; uid++) { - for (member = 1; member <= num_members; member++) { - check_mapping(maptable, member, -1, num_members, uids[uid]); - } - } - osync_mapping_table_close(maptable); - osync_mapping_table_unref(maptable); -} - /* As above but with 3 conflicts, one from each data member * should get 3+3+2 writes */ @@ -1591,8 +1615,6 @@ fail_unless(osync_engine_initialize(engine, &error), NULL); fail_unless(error == NULL, NULL); - mark_point(); - osync_testing_system_abort("cp newdata data3/testdata1"); osync_testing_system_abort("cp newdata1 data2/testdata2"); @@ -1617,9 +1639,9 @@ fail_unless(num_mapping_conflicts == 0, NULL); fail_unless(num_change_written == 6, NULL); fail_unless(num_engine_end_conflicts == 1, NULL); - + g_usleep(2*G_USEC_PER_SEC); - + osync_testing_system_abort("rm -f data2/testdata"); osync_testing_system_abort("cp newdata data3/testdata"); @@ -1960,6 +1982,8 @@ OSYNC_TESTCASE_ADD(multisync_conflict_changetype_choose) OSYNC_TESTCASE_ADD(multisync_conflict_changetype_choose2) +OSYNC_TESTCASE_ADD(multisync_conflict_dual_delete) + OSYNC_TESTCASE_ADD(multisync_conflict_hybrid_choose) OSYNC_TESTCASE_ADD(multisync_conflict_hybrid_choose2) |
From: <svn...@op...> - 2009-04-20 15:14:30
|
Author: bellmich Date: Mon Apr 20 17:14:23 2009 New Revision: 1067 URL: http://libsyncml.opensync.org/changeset/1067 Log: fixed race condition on Solaris Modified: trunk/tests/check_http.c Modified: trunk/tests/check_http.c ============================================================================== --- trunk/tests/check_http.c Mon Apr 20 17:00:04 2009 (r1066) +++ trunk/tests/check_http.c Mon Apr 20 17:14:23 2009 (r1067) @@ -686,6 +686,14 @@ sml_fail_unless(error == NULL, NULL); smlTransportDataDeref(data); + /* It is necessary to perform the first request alone + * because otherwise the test can fail on Solaris + * because Solaris uses an outdated libsoup 2.2. + */ + while (client_receives != 1) { + usleep(100); + } + data = smlTransportDataNew((char *)"test", 5, SML_MIMETYPE_XML, FALSE, &error); sml_fail_unless(data != NULL, NULL); sml_fail_unless(error == NULL, NULL); |
From: <svn...@op...> - 2009-04-20 15:00:10
|
Author: bellmich Date: Mon Apr 20 17:00:04 2009 New Revision: 1066 URL: http://libsyncml.opensync.org/changeset/1066 Log: ensure that the device information is always at the end of the message Modified: trunk/libsyncml/data_sync_api/data_sync_callbacks.c trunk/libsyncml/data_sync_api/data_sync_common.c trunk/libsyncml/data_sync_api/data_sync_devinf.c trunk/libsyncml/data_sync_api/data_sync_devinf.h trunk/libsyncml/data_sync_api/transport_http_client.c Modified: trunk/libsyncml/data_sync_api/data_sync_callbacks.c ============================================================================== --- trunk/libsyncml/data_sync_api/data_sync_callbacks.c Mon Apr 20 16:59:13 2009 (r1065) +++ trunk/libsyncml/data_sync_api/data_sync_callbacks.c Mon Apr 20 17:00:04 2009 (r1066) @@ -235,7 +235,7 @@ * the own device information is send and * the remote ones is requested. */ - if (!smlDataSyncManageDevInf(dsObject, &error)) + if (!smlDataSyncManageDevInf(dsObject, TRUE, &error)) goto error; if (!smlSessionFlush(dsObject->session, TRUE, &error)) goto error; @@ -247,7 +247,7 @@ * the own device information is send and * the remote ones is requested. */ - if (!smlDataSyncManageDevInf(dsObject, &error)) + if (!smlDataSyncManageDevInf(dsObject, TRUE, &error)) goto error; if (!smlSessionFlush(dsObject->session, TRUE, &error)) @@ -461,7 +461,7 @@ * can be received together with the sync command(s). * This can happen with OMA DS clients and servers. */ - if (!smlDataSyncManageDevInf(datastore->dsObject, &error)) + if (!smlDataSyncManageDevInf(datastore->dsObject, FALSE, &error)) goto error; smlTrace(TRACE_EXIT, "%s", __func__); Modified: trunk/libsyncml/data_sync_api/data_sync_common.c ============================================================================== --- trunk/libsyncml/data_sync_api/data_sync_common.c Mon Apr 20 16:59:13 2009 (r1065) +++ trunk/libsyncml/data_sync_api/data_sync_common.c Mon Apr 20 17:00:04 2009 (r1066) @@ -72,7 +72,7 @@ if (datastore->dsObject->session && !datastore->dsObject->onlyLocaltime && !datastore->dsObject->remoteDevInf && - !smlDataSyncManageDevInf(datastore->dsObject, error)) + !smlDataSyncManageDevInf(datastore->dsObject, FALSE, error)) { goto error; } Modified: trunk/libsyncml/data_sync_api/data_sync_devinf.c ============================================================================== --- trunk/libsyncml/data_sync_api/data_sync_devinf.c Mon Apr 20 16:59:13 2009 (r1065) +++ trunk/libsyncml/data_sync_api/data_sync_devinf.c Mon Apr 20 17:00:04 2009 (r1066) @@ -563,9 +563,10 @@ SmlBool smlDataSyncDevInfLoadRemote( SmlDataSyncObject *dsObject, + SmlBool sendGet, SmlError **error) { - smlTrace(TRACE_ENTRY, "%s(%p,%p)", __func__, dsObject, error); + smlTrace(TRACE_ENTRY, "%s(%p, %i, %p)", __func__, dsObject, sendGet, error); CHECK_ERROR_REF smlAssert(dsObject); smlAssertMsg(dsObject->session, "an active session is needed to have a remote device"); @@ -627,15 +628,18 @@ return TRUE; } } - /* the local device information is only send for fairness ;) */ - smlDevInfAgentSendDevInf( - dsObject->agent, - dsObject->session, - error); - smlDevInfAgentRequestDevInf( + if (sendGet) + { + /* the local device information is only send for fairness ;) */ + smlDevInfAgentSendDevInf( dsObject->agent, dsObject->session, error); + smlDevInfAgentRequestDevInf( + dsObject->agent, + dsObject->session, + error); + } smlTrace(TRACE_EXIT, "%s - no remote DevInf available at all", __func__); return FALSE; } @@ -720,9 +724,10 @@ SmlBool smlDataSyncManageDevInf( SmlDataSyncObject *dsObject, + SmlBool sendGet, SmlError **error) { - smlTrace(TRACE_ENTRY, "%s(%p, %p)", __func__, dsObject, error); + smlTrace(TRACE_ENTRY, "%s(%p, %i, %p)", __func__, dsObject, sendGet, error); CHECK_ERROR_REF smlAssertMsg(dsObject->session, "an active session is needed to manage device informations"); @@ -740,7 +745,7 @@ } /* handle remote device information */ - if (smlDataSyncDevInfLoadRemote(dsObject, error) && + if (smlDataSyncDevInfLoadRemote(dsObject, sendGet, error) && dsObject->remoteDevInf && dsObject->handleRemoteDevInfCallback && !dsObject->handleRemoteDevInfCallback( Modified: trunk/libsyncml/data_sync_api/data_sync_devinf.h ============================================================================== --- trunk/libsyncml/data_sync_api/data_sync_devinf.h Mon Apr 20 16:59:13 2009 (r1065) +++ trunk/libsyncml/data_sync_api/data_sync_devinf.h Mon Apr 20 17:00:04 2009 (r1066) @@ -35,6 +35,7 @@ SmlBool smlDataSyncDevInfLoadRemote( SmlDataSyncObject *dsObject, + SmlBool sendGet, SmlError **error); char *smlDataSyncDevInfGetIdentifier(); @@ -46,6 +47,7 @@ SmlBool smlDataSyncManageDevInf( SmlDataSyncObject *dsObject, + SmlBool sendGet, SmlError **error); #endif //_SML_DATA_SYNC_DEVINF_H Modified: trunk/libsyncml/data_sync_api/transport_http_client.c ============================================================================== --- trunk/libsyncml/data_sync_api/transport_http_client.c Mon Apr 20 16:59:13 2009 (r1065) +++ trunk/libsyncml/data_sync_api/transport_http_client.c Mon Apr 20 17:00:04 2009 (r1066) @@ -137,7 +137,7 @@ goto error; /* send the device information */ - if (!smlDataSyncManageDevInf(dsObject, error)) + if (!smlDataSyncManageDevInf(dsObject, TRUE, error)) goto error; smlTrace(TRACE_INTERNAL, "%s: sent devinf", __func__); |
From: <svn...@op...> - 2009-04-20 14:59:24
|
Author: bellmich Date: Mon Apr 20 16:59:13 2009 New Revision: 1065 URL: http://libsyncml.opensync.org/changeset/1065 Log: revert r1063 Modified: trunk/libsyncml/sml_manager.c Modified: trunk/libsyncml/sml_manager.c ============================================================================== --- trunk/libsyncml/sml_manager.c Mon Apr 20 16:22:04 2009 (r1064) +++ trunk/libsyncml/sml_manager.c Mon Apr 20 16:59:13 2009 (r1065) @@ -285,12 +285,6 @@ if (!smlManagerSessionAdd(manager, session, link_, &locerror)) goto error_free_header; smlSessionUnref(session); - /* FIXME: this event must be synchronized - * FIXME: bad design. - */ - while(smlManagerCheck(manager)) { - sleep(1); - } } else { /* SECURITY: let's check ResponseURI if supported * SECURITY: this is important to avoid replay attacks |
From: <svn...@op...> - 2009-04-20 14:22:17
|
Author: bellmich Date: Mon Apr 20 16:22:04 2009 New Revision: 1064 URL: http://libsyncml.opensync.org/changeset/1064 Log: avoid timeouts Modified: trunk/tests/mobiles/libsyncml_ds_server.c Modified: trunk/tests/mobiles/libsyncml_ds_server.c ============================================================================== --- trunk/tests/mobiles/libsyncml_ds_server.c Mon Apr 20 16:05:06 2009 (r1063) +++ trunk/tests/mobiles/libsyncml_ds_server.c Mon Apr 20 16:22:04 2009 (r1064) @@ -51,6 +51,7 @@ switch (type) { case SML_DATA_SYNC_EVENT_ERROR: sml_fail_unless(FALSE, "%s", smlErrorPrint(&error)); + smlAssert(FALSE); break; case SML_DATA_SYNC_EVENT_CONNECT: case SML_DATA_SYNC_EVENT_DISCONNECT: |
From: <svn...@op...> - 2009-04-20 14:05:18
|
Author: bellmich Date: Mon Apr 20 16:05:06 2009 New Revision: 1063 URL: http://libsyncml.opensync.org/changeset/1063 Log: make the behavior of libsyncml deterministic Modified: trunk/libsyncml/sml_manager.c Modified: trunk/libsyncml/sml_manager.c ============================================================================== --- trunk/libsyncml/sml_manager.c Mon Apr 20 16:04:32 2009 (r1062) +++ trunk/libsyncml/sml_manager.c Mon Apr 20 16:05:06 2009 (r1063) @@ -285,6 +285,12 @@ if (!smlManagerSessionAdd(manager, session, link_, &locerror)) goto error_free_header; smlSessionUnref(session); + /* FIXME: this event must be synchronized + * FIXME: bad design. + */ + while(smlManagerCheck(manager)) { + sleep(1); + } } else { /* SECURITY: let's check ResponseURI if supported * SECURITY: this is important to avoid replay attacks |
From: <svn...@op...> - 2009-04-20 14:04:45
|
Author: bellmich Date: Mon Apr 20 16:04:32 2009 New Revision: 1062 URL: http://libsyncml.opensync.org/changeset/1062 Log: better debug messages Modified: trunk/libsyncml/objects/sml_devinf_obj.c Modified: trunk/libsyncml/objects/sml_devinf_obj.c ============================================================================== --- trunk/libsyncml/objects/sml_devinf_obj.c Fri Apr 17 17:21:36 2009 (r1061) +++ trunk/libsyncml/objects/sml_devinf_obj.c Mon Apr 20 16:04:32 2009 (r1062) @@ -51,7 +51,7 @@ SmlSession *session, SmlError **error) { - smlTrace(TRACE_ENTRY, "%s", __func__); + smlTrace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, agent, session, error); CHECK_ERROR_REF smlAssert(agent); @@ -64,7 +64,7 @@ g_hash_table_insert(agent->sessions, session, as); - smlTrace(TRACE_EXIT, "%s", __func__); + smlTrace(TRACE_EXIT, "%s - %p", __func__, as); return as; error: smlSafeFree((gpointer *) &as); @@ -76,14 +76,15 @@ SmlDevInfAgent *agent, SmlSession *session) { - smlTrace(TRACE_ENTRY, "%s", __func__); + smlTrace(TRACE_ENTRY, "%s(%p, %p)", __func__, agent, session); smlAssert(agent); smlAssert(agent->sessions); smlAssert(session); - smlTrace(TRACE_EXIT, "%s", __func__); - return g_hash_table_lookup(agent->sessions, session); + SmlDevInfAgentSession *as = g_hash_table_lookup(agent->sessions, session); + smlTrace(TRACE_EXIT, "%s - %p", __func__, as); + return as; } static void _free_session (gpointer data) |
From: <svn...@op...> - 2009-04-19 15:09:39
|
Author: friedrich.beckmann Date: Sun Apr 19 17:09:32 2009 New Revision: 5623 URL: http://www.opensync.org/changeset/5623 Log: windows port: Test result checking was not working on windows platform Modified: trunk/tests/sync-tests/check_multisync.c Modified: trunk/tests/sync-tests/check_multisync.c ============================================================================== --- trunk/tests/sync-tests/check_multisync.c Sun Apr 19 15:47:28 2009 (r5622) +++ trunk/tests/sync-tests/check_multisync.c Sun Apr 19 17:09:32 2009 (r5623) @@ -458,9 +458,9 @@ } /* make sure the data directories are empty */ - fail_unless(!system("test \"x$(ls data1)\" = \"x\""), NULL); - fail_unless(!system("test \"x$(ls data2)\" = \"x\""), NULL); - fail_unless(!system("test \"x$(ls data3)\" = \"x\""), NULL); + fail_unless(osync_testing_directory_is_empty("data1"), NULL); + fail_unless(osync_testing_directory_is_empty("data2"), NULL); + fail_unless(osync_testing_directory_is_empty("data3"), NULL); } void destroy_engine(OSyncEngine *engine) @@ -1030,7 +1030,7 @@ fail_unless(osync_testing_diff("data1", "data2")); fail_unless(osync_testing_diff("data1", "data3")); - fail_unless(!system("test \"x$(diff newdata2 data2/testdata)\" = \"x\""), NULL); + fail_unless(osync_testing_diff("newdata2", "data2/testdata")); char *path = g_strdup_printf("%s/configs/group/archive.db", testbed); OSyncMappingTable *maptable = mappingtable_load(path, "mockobjtype1", 1); @@ -1315,7 +1315,7 @@ fail_unless(osync_testing_diff("data1", "data2")); fail_unless(osync_testing_diff("data1", "data3")); - fail_unless(!system("test \"x$(diff newdata data1/testdata)\" = \"x\""), NULL); + fail_unless(osync_testing_diff("newdata", "data1/testdata")); const char *uids[] = {"testdata"}; validate_mapping_table(testbed, 3, uids, 1); @@ -1379,8 +1379,7 @@ fail_unless(osync_testing_diff("data1", "data2")); fail_unless(osync_testing_diff("data1", "data3")); - fail_unless(!system("test \"x$(diff newdata2 data1/testdata)\" = \"x\""), NULL); - + fail_unless(osync_testing_diff("newdata2", "data1/testdata")); const char *uids[] = {"testdata"}; validate_mapping_table(testbed, 3, uids, 1); |
From: <svn...@op...> - 2009-04-19 13:47:33
|
Author: friedrich.beckmann Date: Sun Apr 19 15:47:28 2009 New Revision: 5622 URL: http://www.opensync.org/changeset/5622 Log: windows: logfiles are not split per thread Modified: trunk/opensync/debug/opensync_trace.c Modified: trunk/opensync/debug/opensync_trace.c ============================================================================== --- trunk/opensync/debug/opensync_trace.c Sun Apr 19 15:13:10 2009 (r5621) +++ trunk/opensync/debug/opensync_trace.c Sun Apr 19 15:47:28 2009 (r5622) @@ -143,16 +143,13 @@ tabs = GPOINTER_TO_INT(g_private_get(current_tabs)); #ifdef _WIN32 - if (!thread_id) - thread_id = g_private_new (NULL); - id = GPOINTER_TO_INT(thread_id); pid = _getpid(); endline = "\r\n"; #else - id = (unsigned long int)pthread_self(); pid = getpid(); endline = "\n"; #endif + id = (unsigned long int)g_thread_self(); logfile = g_strdup_printf("%s%cThread%lu-%i.log", trace, G_DIR_SEPARATOR, id, pid); va_start(arglist, message); |
From: <svn...@op...> - 2009-04-19 13:13:16
|
Author: friedrich.beckmann Date: Sun Apr 19 15:13:10 2009 New Revision: 5621 URL: http://www.opensync.org/changeset/5621 Log: Test result check was not working on windows platform Modified: trunk/tests/sync-tests/check_sync.c Modified: trunk/tests/sync-tests/check_sync.c ============================================================================== --- trunk/tests/sync-tests/check_sync.c Sun Apr 19 15:12:20 2009 (r5620) +++ trunk/tests/sync-tests/check_sync.c Sun Apr 19 15:13:10 2009 (r5621) @@ -139,7 +139,7 @@ fail_unless(num_mapping_errors == 0, NULL); fail_unless(num_mapping_conflicts == 0, NULL); - fail_unless(!system("test \"x$(diff -x \".*\" data1 data2)\" = \"x\""), NULL); + fail_unless(osync_testing_diff("data1", "data2")); char *path = g_strdup_printf("%s/configs/group/archive.db", testbed); OSyncMappingTable *maptable = mappingtable_load(path, "mockobjtype1", 1); @@ -207,7 +207,7 @@ fail_unless(osync_engine_synchronize_and_block(engine, &error), NULL); fail_unless(error == NULL, NULL); - fail_unless(!system("test \"x$(diff -x \".*\" data1 data2)\" = \"x\""), NULL); + fail_unless(osync_testing_diff("data1", "data2")); char *path = g_strdup_printf("%s/configs/group/archive.db", testbed); OSyncMappingTable *maptable = mappingtable_load(path, "mockobjtype1", 1); @@ -275,7 +275,7 @@ fail_unless(num_mapping_errors == 0, NULL); fail_unless(num_mapping_conflicts == 0, NULL); - fail_unless(!system("test \"x$(diff -x \".*\" data1 data2)\" = \"x\""), NULL); + fail_unless(osync_testing_diff("data1", "data2")); path = g_strdup_printf("%s/configs/group/archive.db", testbed); maptable = mappingtable_load(path, "mockobjtype1", 0); @@ -381,9 +381,9 @@ fail_unless(num_mapping_errors == 0, NULL); fail_unless(num_mapping_conflicts == 1, NULL); - fail_unless(!system("test \"x$(diff -x \".*\" data1 data2)\" = \"x\""), NULL); - fail_unless(!system("test \"x$(diff -x \".*\" data1/testdata comp_data)\" = \"x\""), NULL); - fail_unless(!system("test \"x$(diff -x \".*\" data2/testdata comp_data)\" = \"x\""), NULL); + fail_unless(osync_testing_diff("data1", "data2")); + fail_unless(osync_testing_diff("data1/testdata", "comp_data")); + fail_unless(osync_testing_diff("data2/testdata", "comp_data")); char *path = g_strdup_printf("%s/configs/group/archive.db", testbed); OSyncMappingTable *maptable = mappingtable_load(path, "mockobjtype1", 1); @@ -487,7 +487,7 @@ fail_unless(num_mapping_errors == 0, NULL); fail_unless(num_mapping_conflicts == 0, NULL); - fail_unless(!system("test \"x$(diff -x \".*\" data1 data2)\" = \"x\""), NULL); + fail_unless(osync_testing_diff("data1", "data2")); char *path = g_strdup_printf("%s/configs/group/archive.db", testbed); OSyncMappingTable *maptable = mappingtable_load(path, "mockobjtype1", 1); @@ -555,7 +555,7 @@ fail_unless(num_mapping_errors == 0, NULL); fail_unless(num_mapping_conflicts == 0, NULL); - fail_unless(!system("test \"x$(diff -x \".*\" data1 data2)\" = \"x\""), NULL); + fail_unless(osync_testing_diff("data1", "data2")); path = g_strdup_printf("%s/configs/group/archive.db", testbed); maptable = mappingtable_load(path, "mockobjtype1", 0); @@ -655,7 +655,7 @@ fail_unless(num_mapping_errors == 0, NULL); fail_unless(num_mapping_conflicts == 1, NULL); - fail_unless(!system("test \"x$(diff -x \".*\" data1 data2)\" = \"x\""), NULL); + fail_unless(osync_testing_diff("data1", "data2")); char *path = g_strdup_printf("%s/configs/group/archive.db", testbed); OSyncMappingTable *maptable = mappingtable_load(path, "mockobjtype1", 2); @@ -681,7 +681,7 @@ check_hash(table, "testdata-dupe"); osync_hashtable_unref(table); - fail_unless(!system("test \"x$(diff -x \".*\" data1 data2)\" = \"x\""), NULL); + fail_unless(osync_testing_diff("data1", "data2")); osync_testing_system_abort("rm -f data1/testdata-dupe"); reset_counters(); @@ -728,8 +728,7 @@ fail_unless(num_mapping_errors == 0, NULL); fail_unless(num_mapping_conflicts == 0, NULL); - fail_unless(!system("test \"x$(diff -x \".*\" data1 data2)\" = \"x\""), NULL); - + fail_unless(osync_testing_diff("data1", "data2")); path = g_strdup_printf("%s/configs/group/archive.db", testbed); maptable = mappingtable_load(path, "mockobjtype1", 1); @@ -842,7 +841,7 @@ fail_unless(num_mapping_conflicts == 0, NULL); /* Still conflicts! */ - fail_unless(!system("test \"x$(diff -x \".*\" data1 data2)\" != \"x\""), NULL); + fail_unless(!osync_testing_diff("data1", "data2")); char *path = g_strdup_printf("%s/configs/group/archive.db", testbed); OSyncMappingTable *maptable = mappingtable_load(path, "mockobjtype1", 0); @@ -871,7 +870,7 @@ osync_hashtable_unref(table); */ - fail_unless(!system("test \"x$(diff -x \".*\" data1 data2)\" != \"x\""), NULL); + fail_unless(!osync_testing_diff("data1", "data2")); // osync_testing_system_abort("rm -f data1/testdata-dupe"); fail_unless(!synchronize_once(engine, &error), NULL); @@ -919,8 +918,7 @@ fail_unless(num_mapping_conflicts == 0, NULL); /* Still different */ - fail_unless(!system("test \"x$(diff -x \".*\" data1 data2)\" != \"x\""), NULL); - + fail_unless(!osync_testing_diff("data1", "data2")); path = g_strdup_printf("%s/configs/group/archive.db", testbed); maptable = mappingtable_load(path, "mockobjtype1", 0); @@ -973,7 +971,7 @@ synchronize_once(engine, NULL); osync_testing_system_abort("diff -x \".*\" data1 data2"); - fail_unless(!system("test \"x$(diff -x \".*\" data1 data2)\" = \"x\""), NULL); + fail_unless(osync_testing_diff("data1", "data2")); OSyncMappingTable *maptable = mappingtable_load(group, 3, 0); check_mapping(maptable, 1, -1, 2, "testdata"); @@ -997,11 +995,12 @@ osync_hashtable_close(table); fail_unless(!system("rm -f data1/testdata-dupe data2/testdata-dupe-dupe"), NULL); + synchronize_once(engine, NULL); osengine_finalize(engine); osengine_free(engine); - fail_unless(!system("test \"x$(diff -x \".*\" data1 data2)\" = \"x\""), NULL); + fail_unless(osync_testing_diff("data1", "data2")); fail_unless(num_conflicts == 0, NULL); maptable = mappingtable_load(group, 1, 0); @@ -1101,7 +1100,7 @@ fail_unless(num_mapping_errors == 0, NULL); fail_unless(num_mapping_conflicts == 1, NULL); - fail_unless(!system("test \"x$(diff -x \".*\" data1 data2)\" = \"x\""), NULL); + fail_unless(osync_testing_diff("data1", "data2")); char *path = g_strdup_printf("%s/configs/group/archive.db", testbed); OSyncMappingTable *maptable = mappingtable_load(path, "mockobjtype1", 2); @@ -1178,8 +1177,8 @@ fail_unless(num_mapping_errors == 0, NULL); fail_unless(num_mapping_conflicts == 1, NULL); - fail_unless(!system("test \"x$(diff -x \".*\" data1 data2)\" = \"x\""), NULL); - fail_unless(!system("test \"x$(diff -x \".*\" data1/testdata comp_data)\" = \"x\""), NULL); + fail_unless(osync_testing_diff("data1", "data2")); + fail_unless(osync_testing_diff("data1/testdata", "comp_data")); path = g_strdup_printf("%s/configs/group/archive.db", testbed); maptable = mappingtable_load(path, "mockobjtype1", 1); @@ -1288,7 +1287,7 @@ fail_unless(num_mapping_errors == 0, NULL); fail_unless(num_mapping_conflicts == 3, NULL); - fail_unless(!system("test \"x$(diff -x \".*\" data1 data2)\" = \"x\""), NULL); + fail_unless(osync_testing_diff("data1", "data2")); char *path = g_strdup_printf("%s/configs/group/archive.db", testbed); OSyncMappingTable *maptable = mappingtable_load(path, "mockobjtype1", 3); @@ -1366,7 +1365,7 @@ fail_unless(num_mapping_errors == 0, NULL); fail_unless(num_mapping_conflicts == 0, NULL); - fail_unless(!system("test \"x$(diff -x \".*\" data1 data2)\" = \"x\""), NULL); + fail_unless(osync_testing_diff("data1", "data2")); path = g_strdup_printf("%s/configs/group/archive.db", testbed); maptable = mappingtable_load(path, "mockobjtype1", 0); @@ -1430,7 +1429,7 @@ fail_unless(osync_engine_synchronize_and_block(engine, &error), NULL); fail_unless(error == NULL, NULL); - fail_unless(!system("test \"x$(diff -x \".*\" data1 data2)\" = \"x\""), NULL); + fail_unless(osync_testing_diff("data1", "data2")); reset_counters(); osync_testing_system_abort("rm data1/testdata"); @@ -1478,7 +1477,7 @@ fail_unless(num_mapping_errors == 0, NULL); fail_unless(num_mapping_conflicts == 0, NULL); - fail_unless(!system("test \"x$(diff -x \".*\" data1 data2)\" = \"x\""), NULL); + fail_unless(osync_testing_diff("data1", "data2")); char *path = g_strdup_printf("%s/configs/group/archive.db", testbed); OSyncMappingTable *maptable = mappingtable_load(path, "mockobjtype1", 0); @@ -1542,7 +1541,8 @@ fail_unless(osync_engine_synchronize_and_block(engine, &error), NULL); fail_unless(error == NULL, NULL); - fail_unless(!system("test \"x$(diff -x \".*\" data1 data2)\" = \"x\""), NULL); + fail_unless(osync_testing_diff("data1", "data2")); + fail_unless(num_mapping_conflicts == 0, NULL); reset_counters(); @@ -1587,7 +1587,7 @@ fail_unless(num_mapping_errors == 0, NULL); fail_unless(num_mapping_conflicts == 1, NULL); - fail_unless(!system("test \"x$(diff -x \".*\" data1 data2)\" = \"x\""), NULL); + fail_unless(osync_testing_diff("data1", "data2")); char *path = g_strdup_printf("%s/configs/group/archive.db", testbed); OSyncMappingTable *maptable = mappingtable_load(path, "mockobjtype1", 1); @@ -1655,7 +1655,7 @@ fail_unless(num_mapping_errors == 0, NULL); fail_unless(num_mapping_conflicts == 0, NULL); - fail_unless(!system("test \"x$(diff -x \".*\" data1 data2)\" = \"x\""), NULL); + fail_unless(osync_testing_diff("data1", "data2")); path = g_strdup_printf("%s/configs/group/archive.db", testbed); maptable = mappingtable_load(path, "mockobjtype1", 0); @@ -1719,7 +1719,8 @@ fail_unless(osync_engine_synchronize_and_block(engine, &error), NULL); fail_unless(error == NULL, NULL); - fail_unless(!system("test \"x$(diff -x \".*\" data1 data2)\" = \"x\""), NULL); + fail_unless(osync_testing_diff("data1", "data2")); + fail_unless(num_mapping_conflicts == 0, NULL); reset_counters(); @@ -1769,7 +1770,7 @@ fail_unless(num_mapping_errors == 0, NULL); fail_unless(num_mapping_conflicts == 1, NULL); - fail_unless(!system("test \"x$(diff -x \".*\" data1 data2)\" = \"x\""), NULL); + fail_unless(osync_testing_diff("data1", "data2")); char *path = g_strdup_printf("%s/configs/group/archive.db", testbed); OSyncMappingTable *maptable = mappingtable_load(path, "mockobjtype1", 0); @@ -1787,8 +1788,8 @@ g_free(path); osync_hashtable_unref(table); - fail_unless(!system("test \"x$(ls data1)\" = \"x\""), NULL); - fail_unless(!system("test \"x$(ls data2)\" = \"x\""), NULL); + fail_unless(osync_testing_directory_is_empty("data1")); + fail_unless(osync_testing_directory_is_empty("data2")); g_free(formatdir); g_free(plugindir); @@ -1871,7 +1872,7 @@ fail_unless(num_mapping_errors == 0, NULL); fail_unless(num_mapping_conflicts == 0, NULL); - fail_unless(!system("test \"x$(diff -x \".*\" data1 data2)\" = \"x\""), NULL); + fail_unless(osync_testing_diff("data1", "data2")); char *path = g_strdup_printf("%s/configs/group/archive.db", testbed); OSyncMappingTable *maptable = mappingtable_load(path, "mockobjtype1", 2); @@ -1947,7 +1948,7 @@ fail_unless(num_mapping_errors == 0, NULL); fail_unless(num_mapping_conflicts == 0, NULL); - fail_unless(!system("test \"x$(diff -x \".*\" data1 data2)\" = \"x\""), NULL); + fail_unless(osync_testing_diff("data1", "data2")); path = g_strdup_printf("%s/configs/group/archive.db", testbed); maptable = mappingtable_load(path, "mockobjtype1", 0); @@ -1965,8 +1966,8 @@ g_free(path); osync_hashtable_unref(table); - fail_unless(!system("test \"x$(ls data1)\" = \"x\""), NULL); - fail_unless(!system("test \"x$(ls data2)\" = \"x\""), NULL); + fail_unless(osync_testing_directory_is_empty("data1")); + fail_unless(osync_testing_directory_is_empty("data2")); g_free(formatdir); g_free(plugindir); @@ -2062,7 +2063,7 @@ fail_unless(num_mapping_errors == 0, NULL); fail_unless(num_mapping_conflicts == 2, NULL); - fail_unless(!system("test \"x$(diff -x \".*\" data1 data2)\" = \"x\""), NULL); + fail_unless(osync_testing_diff("data1", "data2")); char *path = g_strdup_printf("%s/configs/group/archive.db", testbed); OSyncMappingTable *maptable = mappingtable_load(path, "mockobjtype1", 10); @@ -2195,7 +2196,7 @@ fail_unless(num_mapping_errors == 0, NULL); fail_unless(num_mapping_conflicts == 4, NULL); - fail_unless(!system("test \"x$(diff -x \".*\" data1 data2)\" = \"x\""), NULL); + fail_unless(osync_testing_diff("data1", "data2")); path = g_strdup_printf("%s/configs/group/archive.db", testbed); maptable = mappingtable_load(path, "mockobjtype1", 10); @@ -2314,9 +2315,8 @@ fail_unless(num_mapping_solved == 10, NULL); fail_unless(num_mapping_errors == 0, NULL); fail_unless(num_mapping_conflicts == 0, NULL); - - fail_unless(!system("test \"x$(diff -x \".*\" data1 data2)\" = \"x\""), NULL); + fail_unless(osync_testing_diff("data1", "data2")); path = g_strdup_printf("%s/configs/group/archive.db", testbed); maptable = mappingtable_load(path, "mockobjtype1", 0); @@ -2334,8 +2334,8 @@ g_free(path); osync_hashtable_unref(table); - fail_unless(!system("test \"x$(ls data1)\" = \"x\""), NULL); - fail_unless(!system("test \"x$(ls data2)\" = \"x\""), NULL); + fail_unless(osync_testing_directory_is_empty("data1")); + fail_unless(osync_testing_directory_is_empty("data2")); g_free(formatdir); g_free(plugindir); @@ -2534,7 +2534,7 @@ fail_unless(num_mapping_errors == 0, NULL); fail_unless(num_mapping_conflicts == 0, NULL); - fail_unless(!system("test \"x$(diff -x \".*\" file-1 file-2)\" = \"x\""), NULL); + fail_unless(osync_testing_diff("file-1", "file-2")); char *path = g_strdup_printf("%s/configs/group/archive.db", testbed); OSyncMappingTable *maptable = mappingtable_load(path, "mockobjtype1", 1); @@ -2764,7 +2764,7 @@ fail_unless(num_mapping_errors == 0, NULL); fail_unless(num_mapping_conflicts == 0, NULL); - fail_unless(!system("test \"x$(diff -x \".*\" file-1 file-2)\" = \"x\""), NULL); + fail_unless(osync_testing_diff("file-1", "file-2")); char *path = g_strdup_printf("%s/configs/group/archive.db", testbed); OSyncMappingTable *maptable = mappingtable_load(path, "mockobjtype1", 1); @@ -2875,7 +2875,7 @@ fail_unless(num_mapping_errors == 0, NULL); fail_unless(num_mapping_conflicts == 0, NULL); - fail_unless(!system("test \"x$(diff -x \".*\" data1 data2)\" = \"x\""), NULL); + fail_unless(osync_testing_diff("data1", "data2")); char *path = g_strdup_printf("%s/configs/group/archive.db", testbed); OSyncMappingTable *maptable = mappingtable_load(path, "mockobjtype1", 1); @@ -2973,7 +2973,7 @@ fail_unless(num_mapping_errors == 0, NULL); fail_unless(num_mapping_conflicts == 0, NULL); - fail_unless(!system("test \"x$(diff -x \".*\" data3 data2)\" = \"x\""), NULL); + fail_unless(osync_testing_diff("data3", "data2")); path = g_strdup_printf("%s/configs/group/archive.db", testbed); maptable = mappingtable_load(path, "mockobjtype1", 1); @@ -3087,7 +3087,7 @@ fail_unless(num_mapping_errors == 0, NULL); fail_unless(num_mapping_conflicts == 0, NULL); - fail_unless(!system("test \"x$(diff -x \".*\" data1 data2)\" = \"x\""), NULL); + fail_unless(osync_testing_diff("data1", "data2")); char *path = g_strdup_printf("%s/configs/group/archive.db", testbed); OSyncMappingTable *maptable = mappingtable_load(path, "mockobjtype1", 1); @@ -3184,7 +3184,7 @@ fail_unless(num_mapping_errors == 0, NULL); fail_unless(num_mapping_conflicts == 0, NULL); - fail_unless(!system("test \"x$(diff -x \".*\" data1 data2)\" = \"x\""), NULL); + fail_unless(osync_testing_diff("data1", "data2")); path = g_strdup_printf("%s/configs/group/archive.db", testbed); maptable = mappingtable_load(path, "mockobjtype1", 1); @@ -3337,7 +3337,7 @@ fail_unless(num_mapping_errors == 0, NULL); fail_unless(num_mapping_conflicts == 0, NULL); - fail_unless(!system("test \"x$(diff -x \".*\" data1 data2)\" = \"x\""), NULL); + fail_unless(osync_testing_diff("data1", "data2")); char *path = g_strdup_printf("%s/configs/group/archive.db", testbed); OSyncMappingTable *maptable = mappingtable_load(path, "mockobjtype1", 1); @@ -3449,7 +3449,7 @@ fail_unless(num_mapping_errors == 0, NULL); fail_unless(num_mapping_conflicts == 0, NULL); - fail_unless(!system("test \"x$(diff -x \".*\" data1 data2)\" = \"x\""), NULL); + fail_unless(osync_testing_diff("data1", "data2")); char *path = g_strdup_printf("%s/configs/group/archive.db", testbed); OSyncMappingTable *maptable = mappingtable_load(path, "mockobjtype1", 1); |
From: <svn...@op...> - 2009-04-19 13:12:25
|
Author: friedrich.beckmann Date: Sun Apr 19 15:12:20 2009 New Revision: 5620 URL: http://www.opensync.org/changeset/5620 Log: Tests did not compile on windows platform Modified: trunk/tests/sync-tests/check_multisync.c Modified: trunk/tests/sync-tests/check_multisync.c ============================================================================== --- trunk/tests/sync-tests/check_multisync.c Sun Apr 19 13:53:18 2009 (r5619) +++ trunk/tests/sync-tests/check_multisync.c Sun Apr 19 15:12:20 2009 (r5620) @@ -427,12 +427,12 @@ osync_hashtable_unref(table); } -void hashtable_load_and_check(const char *testbed, int group, const char *uids[], uint num_uids) +void hashtable_load_and_check(const char *testbed, int group, const char *uids[], unsigned int num_uids) { char *path = g_strdup_printf("%s/configs/group/%d/hashtable.db", testbed, group); OSyncHashTable *table = hashtable_load(path, "mockobjtype1", num_uids); g_free(path); - uint i; + unsigned int i; for (i = 0; i < num_uids; i++) { check_hash(table, uids[i]); } @@ -492,7 +492,7 @@ fail_unless(num_change_read == 1, NULL); fail_unless(num_engine_end_conflicts = 1, NULL); - sleep(2); + g_usleep(2*G_USEC_PER_SEC); osync_testing_system_abort("cp newdata data3/testdata"); synchronize_once(engine, NULL); @@ -549,7 +549,7 @@ fail_unless(num_change_read == 1, NULL); fail_unless(num_engine_end_conflicts == 1, NULL); - sleep(2); + g_usleep(2*G_USEC_PER_SEC); osync_testing_system_abort("cp newdata data1/testdata"); osync_testing_system_abort("cp newdata data3/testdata"); @@ -611,7 +611,7 @@ fail_unless(num_change_read == 1, NULL); fail_unless(num_engine_end_conflicts == 1, NULL); - sleep(2); + g_usleep(2*G_USEC_PER_SEC); osync_testing_system_abort("cp newdata data1/testdata"); osync_testing_system_abort("cp newdata data2/testdata"); osync_testing_system_abort("cp newdata data3/testdata"); @@ -898,7 +898,7 @@ fail_unless(osync_testing_diff("data1", "data2")); fail_unless(osync_testing_diff("data1", "data3")); - sleep(2); + g_usleep(2*G_USEC_PER_SEC); osync_testing_system_abort("rm -f data1/testdata"); osync_testing_system_abort("cp newdata data3/testdata"); @@ -965,7 +965,7 @@ fail_unless(osync_testing_diff("data1", "data2")); fail_unless(osync_testing_diff("data1", "data3")); - sleep(2); + g_usleep(2*G_USEC_PER_SEC); osync_testing_system_abort("rm -f data1/testdata"); osync_testing_system_abort("cp newdata data3/testdata"); @@ -1010,9 +1010,9 @@ fail_unless(osync_testing_diff("data1", "data2")); fail_unless(osync_testing_diff("data1", "data3")); - sleep(2); + g_usleep(2*G_USEC_PER_SEC); - sleep(2); + g_usleep(2*G_USEC_PER_SEC); osync_testing_system_abort("rm -f data1/testdata"); osync_testing_system_abort("cp newdata data3/testdata"); @@ -1078,7 +1078,7 @@ fail_unless(osync_testing_diff("data1", "data2")); fail_unless(osync_testing_diff("data1", "data3")); - sleep(2); + g_usleep(2*G_USEC_PER_SEC); osync_testing_system_abort("rm -f data1/testdata"); osync_testing_system_abort("cp newdata data3/testdata"); @@ -1298,7 +1298,7 @@ fail_unless(osync_testing_diff("data1", "data2")); fail_unless(osync_testing_diff("data1", "data3")); - sleep(2); + g_usleep(2*G_USEC_PER_SEC); osync_testing_system_abort("rm -f data1/testdata"); osync_testing_system_abort("cp newdata data3/testdata"); @@ -1361,7 +1361,7 @@ fail_unless(osync_testing_diff("data1", "data2")); fail_unless(osync_testing_diff("data1", "data3")); - sleep(2); + g_usleep(2*G_USEC_PER_SEC); osync_testing_system_abort("rm -f data2/testdata"); osync_testing_system_abort("rm -f data3/testdata"); @@ -1419,7 +1419,7 @@ fail_unless(osync_testing_diff("data1", "data2")); fail_unless(osync_testing_diff("data1", "data3")); - sleep(2); + g_usleep(2*G_USEC_PER_SEC); osync_testing_system_abort("rm -f data2/testdata"); osync_testing_system_abort("cp newdata data3/testdata"); @@ -1521,7 +1521,7 @@ - sleep(2); + g_usleep(2*G_USEC_PER_SEC); /* Should end up with testdata(newdata) - 2 writes @@ -1619,7 +1619,7 @@ fail_unless(num_change_written == 6, NULL); fail_unless(num_engine_end_conflicts == 1, NULL); - sleep(2); + g_usleep(2*G_USEC_PER_SEC); osync_testing_system_abort("rm -f data2/testdata"); osync_testing_system_abort("cp newdata data3/testdata"); @@ -1673,7 +1673,7 @@ fail_unless(error == NULL, NULL); osync_testing_system_abort("cp newdata data3/testdata1"); - setenv("SLOW_REPORT", "2", TRUE); + g_setenv("SLOW_REPORT", "2", TRUE); synchronize_once(engine, NULL); @@ -1694,7 +1694,7 @@ fail_unless(num_change_written == 4, NULL); fail_unless(num_engine_end_conflicts == 1, NULL); - sleep(2); + g_usleep(2*G_USEC_PER_SEC); osync_testing_system_abort("cp newdata data3/testdata"); @@ -1730,7 +1730,7 @@ check_empty(testbed); - unsetenv("SLOW_REPORT"); + g_unsetenv("SLOW_REPORT"); } START_TEST (multisync_delayed_slow) @@ -1777,7 +1777,7 @@ fail_unless(osync_testing_diff("data1", "data2")); fail_unless(osync_testing_diff("data1", "data3")); - sleep(2); + g_usleep(2*G_USEC_PER_SEC); /* create some conflicts and ignore them twice */ |
From: <svn...@op...> - 2009-04-19 11:53:27
|
Author: bricks Date: Sun Apr 19 13:53:18 2009 New Revision: 5619 URL: http://www.opensync.org/changeset/5619 Log: moved doxygen annotation from c file to internal header Modified: trunk/opensync/common/opensync_memory.c trunk/opensync/common/opensync_memory_internals.h Modified: trunk/opensync/common/opensync_memory.c ============================================================================== --- trunk/opensync/common/opensync_memory.c Sat Apr 18 00:26:25 2009 (r5618) +++ trunk/opensync/common/opensync_memory.c Sun Apr 19 13:53:18 2009 (r5619) @@ -50,15 +50,6 @@ g_free(ptr); } -/*! @brief Bit counting - * - * MIT HAKMEM Count, Bit counting in constant time and memory. - * - * result can't be greater than 32 on 32 Bit systems or 64 on 64 Bit systems - * @param u unsigned integer value to count bits - * @returns The bit counting result - * - */ unsigned char osync_bitcount(unsigned int u) { unsigned int uCount = u - ((u >> 1) & 033333333333) - ((u >> 2) & 011111111111); Modified: trunk/opensync/common/opensync_memory_internals.h ============================================================================== --- trunk/opensync/common/opensync_memory_internals.h Sat Apr 18 00:26:25 2009 (r5618) +++ trunk/opensync/common/opensync_memory_internals.h Sun Apr 19 13:53:18 2009 (r5619) @@ -21,6 +21,15 @@ #ifndef _OPENSYNC_MEMORY_INTERNALS_H #define _OPENSYNC_MEMORY_INTERNALS_H +/** @brief Bit counting + * + * MIT HAKMEM Count, Bit counting in constant time and memory. + * + * result can't be greater than 32 on 32 Bit systems or 64 on 64 Bit systems + * @param u unsigned integer value to count bits + * @returns The bit counting result + * + */ unsigned char osync_bitcount(unsigned int u); #endif /* _OPENSYNC_MEMORY_INTERNALS_H */ |
From: <svn...@op...> - 2009-04-17 22:26:47
|
Author: henrik Date: Sat Apr 18 00:26:25 2009 New Revision: 5618 URL: http://www.opensync.org/changeset/5618 Log: Port to Windows/MinGW Modified: plugins/mozilla-sync/trunk/src/mozilla-calendar.cpp plugins/mozilla-sync/trunk/src/mozilla-config.cpp plugins/mozilla-sync/trunk/src/mozilla-headers.h plugins/mozilla-sync/trunk/src/mozilla-sync-utils.h plugins/mozilla-sync/trunk/src/mozilla-sync.cpp plugins/mozilla-sync/trunk/src/mozilla-xpcom.cpp plugins/mozilla-sync/trunk/src/thunderbird-addressbook.cpp plugins/mozilla-sync/trunk/src/thunderbird-card.cpp Modified: plugins/mozilla-sync/trunk/src/mozilla-calendar.cpp ============================================================================== --- plugins/mozilla-sync/trunk/src/mozilla-calendar.cpp Sat Apr 18 00:25:03 2009 (r5617) +++ plugins/mozilla-sync/trunk/src/mozilla-calendar.cpp Sat Apr 18 00:26:25 2009 (r5618) @@ -174,7 +174,7 @@ rv=mss->OpenSpecialDatabase("profile", getter_AddRefs(myConn)); - if (!myConn) ERROR("No connection"); + if (!myConn) ERROR_MSG("No connection"); LOG(10, "Got storage service"); nsCOMPtr<mozIStorageStatement> statement; @@ -213,11 +213,11 @@ #if CALENDAR_VERSION==9 if (strcmp("0.14", szSchemaVersion)!=0 ) - ERROR("Compiled for Mozilla Calendar version 0.9, which expects calendar schema [0.14] but found calendar schema [%s]", + ERROR_MSG("Compiled for Mozilla Calendar version 0.9, which expects calendar schema [0.14] but found calendar schema [%s]", szSchemaVersion); #else if (strcmp(szCompiledCalendarVersion, szSchemaVersion)!=0 ) - ERROR("Compiled for Mozilla Calendar version [%s] but found calendar schema for version [%s]", + ERROR_MSG("Compiled for Mozilla Calendar version [%s] but found calendar schema for version [%s]", szCompiledCalendarVersion, szSchemaVersion); #endif @@ -273,7 +273,7 @@ MOZ_ERROR_CHECK_FALSE(rv, "ExecuteStep"); if (myStatement->IsNull(0)) - ERROR("SELECT FROM cal_events returned a NULL id"); + ERROR_MSG("SELECT FROM cal_events returned a NULL id"); return TRUE; } @@ -295,7 +295,7 @@ MOZ_ERROR_CHECK_FALSE(rv, "ExecuteStep"); if (myStatement->IsNull(0)) - ERROR("SELECT FROM cal_events returned a NULL id"); + ERROR_MSG("SELECT FROM cal_events returned a NULL id"); return TRUE; } Modified: plugins/mozilla-sync/trunk/src/mozilla-config.cpp ============================================================================== --- plugins/mozilla-sync/trunk/src/mozilla-config.cpp Sat Apr 18 00:25:03 2009 (r5617) +++ plugins/mozilla-sync/trunk/src/mozilla-config.cpp Sat Apr 18 00:26:25 2009 (r5618) @@ -144,7 +144,7 @@ if (!fProfileDir) fProfileDir=find_default_profile_directory(&szProfileDir, pSzError, pLogFunction); if (!fProfileDir) - ERROR("Advanced option profile-directory was not set, and could not be determined automatically"); + ERROR_MSG("Advanced option profile-directory was not set, and could not be determined automatically"); pMozillaConfig->szProfileDirectory=strdup(szProfileDir); pMozillaConfig->thunderbirdAddressbook=FALSE; @@ -164,7 +164,7 @@ // Do not do osync_plugin_resource_unref(pOSyncPluginResource) - it will be accessed later. But why? if ( (pMozillaConfig->szAddressbookFile==NULL) && (pMozillaConfig->szCalendarId==NULL) ) - ERROR("At least one resource must be set: contact or event"); + ERROR_MSG("At least one resource must be set: contact or event"); return TRUE; } @@ -188,12 +188,12 @@ LOG(10, "Checking configuration file"); if (! g_file_test(pMozillaConfig->szProfileDirectory, G_FILE_TEST_EXISTS) ) - ERROR("profile-directory [%s] does not exist", pMozillaConfig->szProfileDirectory); + ERROR_MSG("profile-directory [%s] does not exist", pMozillaConfig->szProfileDirectory); if (! g_file_test(pMozillaConfig->szProfileDirectory, G_FILE_TEST_IS_DIR) ) - ERROR("profile-directory [%s] is not a directory", pMozillaConfig->szProfileDirectory); + ERROR_MSG("profile-directory [%s] is not a directory", pMozillaConfig->szProfileDirectory); gchar *szABF=g_strjoin(G_DIR_SEPARATOR_S, pMozillaConfig->szProfileDirectory, pMozillaConfig->szAddressbookFile, NULL); if (! g_file_test(szABF, G_FILE_TEST_EXISTS) ) - ERROR("addressbook-file [%s] does not exist", szABF); + ERROR_MSG("addressbook-file [%s] does not exist", szABF); GFREE(szABF); LOG(1, "Warning: Cannot check calendar id"); Modified: plugins/mozilla-sync/trunk/src/mozilla-headers.h ============================================================================== --- plugins/mozilla-sync/trunk/src/mozilla-headers.h Sat Apr 18 00:25:03 2009 (r5617) +++ plugins/mozilla-sync/trunk/src/mozilla-headers.h Sat Apr 18 00:26:25 2009 (r5618) @@ -27,7 +27,7 @@ ================================================================ */ - +#include <mozilla-config.h> #ifdef XPCOM_GLUE #include <nsXPCOMGlue.h> Modified: plugins/mozilla-sync/trunk/src/mozilla-sync-utils.h ============================================================================== --- plugins/mozilla-sync/trunk/src/mozilla-sync-utils.h Sat Apr 18 00:25:03 2009 (r5617) +++ plugins/mozilla-sync/trunk/src/mozilla-sync-utils.h Sat Apr 18 00:26:25 2009 (r5618) @@ -28,9 +28,9 @@ ================================================================ */ -// On FreeBSD we need libgen to define "basename" which is used in LOG +// On FreeBSD and Windows/MinGW we need libgen to define "basename" which is used in LOG -#if defined(__FreeBSD__) +#if defined(__FreeBSD__) || defined(WIN32) #include <libgen.h> #endif @@ -42,7 +42,7 @@ #define LOG_SENSITIVE(level, message ...) pLogFunction(level, true, basename(__FILE__), __LINE__, __func__, message); /** Create error message in the @c pSzError passed, and return **/ -#define ERROR(message ...) { \ +#define ERROR_MSG(message ...) { \ char *__szMsg=g_strdup_printf(message); \ *pSzError=g_strdup_printf("%s(%d)%s: %s", basename(__FILE__), __LINE__, __func__, __szMsg); return FALSE; } Modified: plugins/mozilla-sync/trunk/src/mozilla-sync.cpp ============================================================================== --- plugins/mozilla-sync/trunk/src/mozilla-sync.cpp Sat Apr 18 00:25:03 2009 (r5617) +++ plugins/mozilla-sync/trunk/src/mozilla-sync.cpp Sat Apr 18 00:26:25 2009 (r5618) @@ -64,6 +64,7 @@ #include <stdio.h> #include <string.h> +#include "mozilla-headers.h" #include <opensync/opensync.h> #include <opensync/opensync-format.h> @@ -74,17 +75,16 @@ #include <opensync/opensync-capabilities.h> #include <opensync/opensync-xmlformat.h> -#include "mozilla-xpcom.h" -#include "thunderbird-addressbook.h" -#include "mozilla-calendar.h" - #include "thunderbird-card.h" #include "calendar-event.h" - +#include "thunderbird-addressbook.h" +#include "mozilla-calendar.h" +#include "mozilla-xpcom.h" #include "mozilla-sync.h" -// On FreeBSD we need libgen to define "basename" which is used in LOG -#if defined(__FreeBSD__) + +// On FreeBSD and Windows/MinGW we need libgen to define "basename" which is used in LOG +#if defined(__FreeBSD__) || defined(WIN32) #include <libgen.h> #endif @@ -182,7 +182,15 @@ char *__szMsg=g_strdup_vprintf(szFormat, ap); OSyncTraceType t=TRACE_INTERNAL; if (sensitive) t=TRACE_SENSITIVE; + +#ifdef WIN32 + char *_szFile=g_strdup(szFile); + osync_trace(TRACE_INTERNAL, "%s(%d)%s: %s", basename(_szFile), iLine, szFunc, __szMsg); + g_free(_szFile); +#else osync_trace(TRACE_INTERNAL, "%s(%d)%s: %s", basename(szFile), iLine, szFunc, __szMsg); +#endif + g_free(__szMsg); va_end(ap); } Modified: plugins/mozilla-sync/trunk/src/mozilla-xpcom.cpp ============================================================================== --- plugins/mozilla-sync/trunk/src/mozilla-xpcom.cpp Sat Apr 18 00:25:03 2009 (r5617) +++ plugins/mozilla-sync/trunk/src/mozilla-xpcom.cpp Sat Apr 18 00:26:25 2009 (r5618) @@ -31,8 +31,11 @@ #include <string.h> #include <stdio.h> #include <limits.h> + +#ifndef WIN32 #include <dlfcn.h> #include <link.h> +#endif #include "mozilla-headers.h" @@ -171,15 +174,20 @@ LOG(10, "Getting GRE path"); + char szGreDirectory[PATH_MAX]; +#ifdef WIN32 + szGreDirectory=""; + // TODO TODO TODO +#else void* mod=dlopen("libxpcom.so", RTLD_LAZY); if (mod==NULL) { *pSzError=g_strdup_printf("%s(%d): dlopen was not able to load libxpcom.so", __func__, __LINE__); return FALSE; } - char szGreDirectory[PATH_MAX]; int ret=dlinfo(mod, RTLD_DI_ORIGIN, szGreDirectory); if (ret<0) { *pSzError=g_strdup_printf("%s(%d): dlinfo was not able retrieve origin of libxpcom.so [%d]", __func__, __LINE__, ret); return FALSE; } +#endif nsCString csGre; rv = NS_CStringSetData(csGre, szGreDirectory); Modified: plugins/mozilla-sync/trunk/src/thunderbird-addressbook.cpp ============================================================================== --- plugins/mozilla-sync/trunk/src/thunderbird-addressbook.cpp Sat Apr 18 00:25:03 2009 (r5617) +++ plugins/mozilla-sync/trunk/src/thunderbird-addressbook.cpp Sat Apr 18 00:26:25 2009 (r5618) @@ -411,7 +411,7 @@ rv=myAddrDatabase->GetCardFromAttribute(myAbDirectory, OPEN_SYNC_KEY, szKey, PR_FALSE, getter_AddRefs(theCard)); #endif MOZ_ERROR_CHECK_FALSE(rv, "GetCardFromAttribute"); - if (!theCard) ERROR("Could not find card with key [%s] in Thunderbird Address-book", szKey); + if (!theCard) ERROR_MSG("Could not find card with key [%s] in Thunderbird Address-book", szKey); #ifdef TBIRD_3 rv=myAddrDatabase->DeleteCard(theCard, PR_FALSE, myAbDirectory); @@ -469,7 +469,7 @@ MOZ_ERROR_CHECK_FALSE(rv, "GetCardFromAttribute"); - if (!theCard) ERROR("Could not find card with key [%s] in Thunderbird Address-book", szKey); + if (!theCard) ERROR_MSG("Could not find card with key [%s] in Thunderbird Address-book", szKey); /* PRUnichar *ln16; Modified: plugins/mozilla-sync/trunk/src/thunderbird-card.cpp ============================================================================== --- plugins/mozilla-sync/trunk/src/thunderbird-card.cpp Sat Apr 18 00:25:03 2009 (r5617) +++ plugins/mozilla-sync/trunk/src/thunderbird-card.cpp Sat Apr 18 00:26:25 2009 (r5618) @@ -343,12 +343,12 @@ // -------------------- // Parse the XML data pParserCtxt = xmlNewParserCtxt(); - if (!pParserCtxt) ERROR("Unable to create XML parser context"); + if (!pParserCtxt) ERROR_MSG("Unable to create XML parser context"); pDoc=xmlCtxtReadMemory(pParserCtxt, szXML, strlen(szXML)+1, "", NULL, XML_PARSE_NOBLANKS+XML_PARSE_NOCDATA); if (!pDoc) { pXmlError=&(pParserCtxt->lastError); - ERROR("xmlCtxtReadMemory: %s", pXmlError->message); } + ERROR_MSG("xmlCtxtReadMemory: %s", pXmlError->message); } xmlFreeParserCtxt(pParserCtxt); // -------------------- @@ -356,10 +356,10 @@ pNode=xmlDocGetRootElement(pDoc); if (!pNode) { pXmlError=xmlGetLastError(); - ERROR("xmlDocGetRootElement unable to get root node: %s", pXmlError->message); } + ERROR_MSG("xmlDocGetRootElement unable to get root node: %s", pXmlError->message); } if ( xmlStrcmp(pNode->name, (const xmlChar*)"contact") != 0 ) - ERROR("Expected <contact> root node"); + ERROR_MSG("Expected <contact> root node"); // -------------------- // First we go though the pXmlGroupDef to find exact matches @@ -367,15 +367,15 @@ // Hash tables to remember nodes we have processed (first level nodes only, eg. <contact><address>) GHashTable *pHashTableNodes=g_hash_table_new(NULL, NULL); - if (!pHashTableNodes) ERROR("Unable to create hash table for nodes"); + if (!pHashTableNodes) ERROR_MSG("Unable to create hash table for nodes"); // Hash tables to remember Thunderbird properties we have filled out GHashTable *pHashTableProperties=g_hash_table_new(NULL, NULL); - if (!pHashTableProperties) ERROR("Unable to create hash table for properties"); + if (!pHashTableProperties) ERROR_MSG("Unable to create hash table for properties"); /* Create xpath evaluation context */ xpathCtx = xmlXPathNewContext(pDoc); - if (!xpathCtx) ERROR("Unable to create XPath context"); + if (!xpathCtx) ERROR_MSG("Unable to create XPath context"); XMLGroupDef *pXmlGroupDef; for (pXmlGroupDef=&(xmlContactDef.xmlGroupDef[0]); pXmlGroupDef->szGroup; pXmlGroupDef++) { @@ -403,7 +403,7 @@ LOG(1000, "Path %s", szXPathGroup); xpathObj = xmlXPathEvalExpression((const xmlChar*)szXPathGroup, xpathCtx); - if (!xpathObj) ERROR("Unable to evaluate XPath expression [%s]", szXPathGroup); + if (!xpathObj) ERROR_MSG("Unable to evaluate XPath expression [%s]", szXPathGroup); if (!xpathObj->nodesetval) continue; if (xpathObj->nodesetval->nodeNr<1) continue; |
From: <svn...@op...> - 2009-04-17 22:25:10
|
Author: henrik Date: Sat Apr 18 00:25:03 2009 New Revision: 5617 URL: http://www.opensync.org/changeset/5617 Log: Port to Windows/MinGW Modified: branches/3rd-party-cmake-modules/modules/FindThunderbirdXpcom.cmake (contents, props changed) Modified: branches/3rd-party-cmake-modules/modules/FindThunderbirdXpcom.cmake ============================================================================== --- branches/3rd-party-cmake-modules/modules/FindThunderbirdXpcom.cmake Sat Apr 18 00:21:25 2009 (r5616) +++ branches/3rd-party-cmake-modules/modules/FindThunderbirdXpcom.cmake Sat Apr 18 00:25:03 2009 (r5617) @@ -4,12 +4,8 @@ # $Id$ # ====================================================== -# The purpose of this CMake file is to find Thunderbird and Sunbird files. -# At the end, we whould have the following variables set: -# XPCOM_INCLUDE_DIRS -# XPCOM_LIBRARY_DIRS -# XPCOM_LIBRARIES -# SUNBIRD_VERSION +# The purpose of this CMake file is to find Thunderbird and Sunbird files and versions. +# It should work with Icedove and Iceowl as well # First we look for a Thunderbird package PKG_SEARCH_MODULE ( THUNDERBIRD_XPCOM thunderbird-xpcom icedove-xpcom ) @@ -68,6 +64,14 @@ /usr/local/lib64 /opt/lib64 ) + + IF ( WIN32 AND NOT _xpcom_lib ) + GET_FILENAME_COMPONENT ( _tbdir "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\thunderbird.exe]" PATH CACHE) + FIND_LIBRARY ( _xpcom_lib NAMES xpcom libxpcom + PATHS "${_tbdir}" + ) + ENDIF ( WIN32 AND NOT _xpcom_lib ) + IF ( NOT _xpcom_lib ) MESSAGE ( FATAL_ERROR "*** *** Found Thunderbird, but not the xpcom library" ) ENDIF ( NOT _xpcom_lib ) @@ -76,34 +80,55 @@ # Usually the only library we need is the xpcom SET ( THUNDERBIRD_XPCOM_LIBRARIES "xpcom" ) + IF ( WIN32 ) + SET ( THUNDERBIRD_XPCOM_LIBRARIES "xpcom;xpcom_compat;xpcom_core;xpistub" ) + ENDIF ( WIN32 ) # For Thunderbird 3.0 we need to link the glue library EXEC_PROGRAM ( thunderbird ARGS "--version" - OUTPUT_VARIABLE _THUNDERBIRD_XPCOM_VERSION + OUTPUT_VARIABLE THUNDERBIRD_XPCOM_VERSION RETURN_VALUE _THUNDERBIRD_XPCOM_VERSION_RET ) IF ( _THUNDERBIRD_XPCOM_VERSION_RET ) EXEC_PROGRAM ( icedove ARGS "--version" - OUTPUT_VARIABLE _THUNDERBIRD_XPCOM_VERSION + OUTPUT_VARIABLE THUNDERBIRD_XPCOM_VERSION RETURN_VALUE _THUNDERBIRD_XPCOM_VERSION_RET ) ENDIF ( _THUNDERBIRD_XPCOM_VERSION_RET ) - IF ( NOT _THUNDERBIRD_XPCOM_VERSION_RET ) + IF ( WIN32 AND _THUNDERBIRD_XPCOM_VERSION_RET ) + GET_FILENAME_COMPONENT ( _tb_exe "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\thunderbird.exe]" ABSOLUTE CACHE) + EXEC_PROGRAM ( "${_tb_exe}" ARGS "--version" + OUTPUT_VARIABLE THUNDERBIRD_XPCOM_VERSION + RETURN_VALUE _THUNDERBIRD_XPCOM_VERSION_RET ) + ENDIF ( WIN32 AND _THUNDERBIRD_XPCOM_VERSION_RET ) + + IF (_THUNDERBIRD_XPCOM_VERSION_RET ) + MESSAGE ( FATAL_ERROR "*** *** Unable execute Thunderbird/Icedove to get its version" ) + ENDIF ( _THUNDERBIRD_XPCOM_VERSION_RET ) - STRING ( REGEX MATCH ".*([0-9]\\.[0-9]).*" _THUNDERBIRD_XPCOM_VERSION_OK "${_THUNDERBIRD_XPCOM_VERSION}" ) - IF ( _THUNDERBIRD_XPCOM_VERSION_OK ) - STRING ( REGEX REPLACE ".*([0-9]\\.[0-9]).*" "\\1" THUNDERBIRD_XPCOM_VERSION "${_THUNDERBIRD_XPCOM_VERSION}" ) - MESSAGE ( STATUS "THUNDERBIRD_XPCOM_VERSION [${THUNDERBIRD_XPCOM_VERSION}]" ) - IF ( THUNDERBIRD_XPCOM_VERSION STREQUAL "3.0" ) - SET ( THUNDERBIRD_XPCOM_LIBRARIES "xpcomglue_s;xpcom" ) - ENDIF ( THUNDERBIRD_XPCOM_VERSION STREQUAL "3.0" ) - ENDIF ( _THUNDERBIRD_XPCOM_VERSION_OK ) - ENDIF ( NOT _THUNDERBIRD_XPCOM_VERSION_RET ) + STRING ( REGEX MATCH ".* ([0-9]\\.[0-9]).*" _THUNDERBIRD_XPCOM_VERSION_OK "${THUNDERBIRD_XPCOM_VERSION}" ) + IF ( _THUNDERBIRD_XPCOM_VERSION_OK ) + STRING (REGEX REPLACE ".* ([0-9]\\.[0-9]).*" "\\1" THUNDERBIRD_XPCOM_VERSION "${THUNDERBIRD_XPCOM_VERSION}" ) + ENDIF ( _THUNDERBIRD_XPCOM_VERSION_OK ) ENDIF( THUNDERBIRD_XPCOM_FOUND ) +STRING ( REGEX MATCH ".*([0-9]\\.[0-9]).*" _THUNDERBIRD_XPCOM_VERSION_OK "${THUNDERBIRD_XPCOM_VERSION}" ) +IF ( _THUNDERBIRD_XPCOM_VERSION_OK ) + # Thunderbird main version + STRING (REGEX REPLACE "^([0-9]+)\\..*$" "\\1" THUNDERBIRD_VERSION_MAIN "${THUNDERBIRD_XPCOM_VERSION}" ) +ELSE ( _THUNDERBIRD_XPCOM_VERSION_OK ) + MESSAGE ( STATUS "Unable to interpret Thunderbird version [${THUNDERBIRD_XPCOM_VERSION}]; continuing anyway" ) +ENDIF ( _THUNDERBIRD_XPCOM_VERSION_OK ) + +# Thunderbird 3 +IF ( THUNDERBIRD_VERSION_MAIN STREQUAL "3" ) + SET ( THUNDERBIRD_XPCOM_LIBRARIES "xpcomglue_s;xpcom" ) +ENDIF ( THUNDERBIRD_VERSION_MAIN STREQUAL "3" ) + # So, by now we should have the following variables set: MESSAGE ( STATUS " THUNDERBIRD_XPCOM_VERSION ${THUNDERBIRD_XPCOM_VERSION}" ) +MESSAGE ( STATUS " THUNDERBIRD_VERSION_MAIN ${THUNDERBIRD_VERSION_MAIN}" ) MESSAGE ( STATUS " THUNDERBIRD_XPCOM_MAIN_INCLUDE_DIR ${THUNDERBIRD_XPCOM_MAIN_INCLUDE_DIR}" ) MESSAGE ( STATUS " NSPR_MAIN_INCLUDE_DIR ${NSPR_MAIN_INCLUDE_DIR}" ) MESSAGE ( STATUS " THUNDERBIRD_XPCOM_LIBRARY_DIRS ${THUNDERBIRD_XPCOM_LIBRARY_DIRS}" ) @@ -123,10 +148,13 @@ ) +# ---------------------------------------- + # Now look for a Subird package PKG_SEARCH_MODULE ( SUNBIRD sunbird-xpcom iceowl-xpcom ) IF ( SUNBIRD_FOUND ) + # If we found the Thunderbird package, let us try to find the main include dir MESSAGE ( " SUNBIRD_INCLUDE_DIRS ${SUNBIRD_INCLUDE_DIRS}" ) # ---------- We just need the first directory, which should be the main directory @@ -141,6 +169,7 @@ ENDIF ( _SEVERAL_INCLUDE_DIRS ) ELSE( SUNBIRD_FOUND ) + # We did not find a Sunbird package, so let us look for the files manually MESSAGE ( STATUS " did not find sunbird package; now looking for sunbird files" ) FIND_PATH ( SUNBIRD_MAIN_INCLUDE_DIR calbase/calIICSService.h @@ -157,31 +186,44 @@ # We need the Sunbird version number EXEC_PROGRAM ( sunbird ARGS "--version" - OUTPUT_VARIABLE _SUNBIRD_VERSION + OUTPUT_VARIABLE SUNBIRD_VERSION RETURN_VALUE _SUNBIRD_VERSION_RET ) IF ( _SUNBIRD_VERSION_RET ) EXEC_PROGRAM ( iceowl ARGS "--version" - OUTPUT_VARIABLE _SUNBIRD_VERSION - RETURN_VALUE _ICEOWL_VERSION_RET ) - IF ( _ICEOWL_VERSION_RET ) - MESSAGE ( FATAL_ERROR "*** *** Unable execute sunbird/iceowl to get its version" ) - ENDIF ( _ICEOWL_VERSION_RET ) + OUTPUT_VARIABLE SUNBIRD_VERSION + RETURN_VALUE _SUNBIRD_VERSION_RET ) ENDIF ( _SUNBIRD_VERSION_RET ) - STRING ( REGEX MATCH ".*([0-9]\\.[0-9]).*" _SUNBIRD_VERSION_OK "${_SUNBIRD_VERSION}" ) + IF ( WIN32 AND _SUNBIRD_VERSION_RET ) + GET_FILENAME_COMPONENT ( _sb_exe "[HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\App Paths\\sunbird.exe]" ABSOLUTE CACHE) + EXEC_PROGRAM ( "${_sb_exe}" ARGS "--version" + OUTPUT_VARIABLE SUNBIRD_VERSION + RETURN_VALUE _SUNBIRD_VERSION_RET ) + ENDIF ( WIN32 AND _SUNBIRD_VERSION_RET ) + + IF ( _SUNBIRD_VERSION_RET ) + MESSAGE ( FATAL_ERROR "*** *** Unable execute sunbird/iceowl to get its version" ) + ENDIF ( _SUNBIRD_VERSION_RET ) + + STRING ( REGEX MATCH ".* ([0-9]\\.[0-9]).*" _SUNBIRD_VERSION_OK "${SUNBIRD_VERSION}" ) IF ( _SUNBIRD_VERSION_OK ) - STRING ( REGEX REPLACE ".*([0-9]\\.[0-9]).*" "\\1" SUNBIRD_VERSION "${_SUNBIRD_VERSION}" ) - ELSE ( _SUNBIRD_VERSION_OK ) - MESSAGE ( STATUS "sunbird --version returned ${_SUNBIRD_VERSION}" ) - MESSAGE ( FATAL_ERROR "*** *** Unable to interpret sunbird --version" ) + STRING (REGEX REPLACE ".* ([0-9]\\.[0-9]).*" "\\1" SUNBIRD_VERSION "${SUNBIRD_VERSION}" ) ENDIF ( _SUNBIRD_VERSION_OK ) ENDIF ( SUNBIRD_FOUND ) -# Thunderbird and Sunbird main version -STRING (REGEX REPLACE "^([0-9]+)\\..*$" "\\1" THUNDERBIRD_VERSION_MAIN "${THUNDERBIRD_XPCOM_VERSION}" ) -STRING (REGEX REPLACE "^([0-9]+)\\..*$" "\\1" SUNBIRD_VERSION_MAIN "${SUNBIRD_VERSION}" ) +STRING ( REGEX MATCH ".*([0-9]\\.[0-9]).*" _SUNBIRD_VERSION_OK "${SUNBIRD_VERSION}" ) +IF ( _SUNBIRD_VERSION_OK ) + # Sunbird main version + STRING (REGEX REPLACE "^([0-9]+)\\..*$" "\\1" SUNBIRD_VERSION_MAIN "${SUNBIRD_VERSION}" ) +ELSE ( _SUNBIRD_VERSION_OK ) + MESSAGE ( FATAL_ERROR "*** ***Unable to interpret Sunbird version [${_SUNBIRD_VERSION}]" ) +ENDIF ( _SUNBIRD_VERSION_OK ) + + + +# ---------------------------------------- # So, by now we should have the following variables set: MESSAGE ( STATUS " SUNBIRD_MAIN_INCLUDE_DIR ${SUNBIRD_MAIN_INCLUDE_DIR}" ) |
From: <svn...@op...> - 2009-04-17 22:21:38
|
Author: henrik Date: Sat Apr 18 00:21:25 2009 New Revision: 5616 URL: http://www.opensync.org/changeset/5616 Log: Remember OPENSYNC_INCLUDE_DIRS Modified: plugins/mozilla-sync/trunk/tests/CMakeLists.txt Modified: plugins/mozilla-sync/trunk/tests/CMakeLists.txt ============================================================================== --- plugins/mozilla-sync/trunk/tests/CMakeLists.txt Fri Apr 17 10:02:28 2009 (r5615) +++ plugins/mozilla-sync/trunk/tests/CMakeLists.txt Sat Apr 18 00:21:25 2009 (r5616) @@ -5,7 +5,7 @@ # ====================================================== INCLUDE_DIRECTORIES( ${CMAKE_CURRENT_SOURCE_DIR}/../src ${CHECK_INCLUDE_DIR} ${XPCOM_INCLUDE_DIRS} ${GLIB2_INCLUDE_DIRS} -${LIBXML2_INCLUDE_DIRS} ) +${LIBXML2_INCLUDE_DIRS} ${OPENSYNC_INCLUDE_DIRS} ) LINK_DIRECTORIES( ${OPENSYNC_LIBRARY_DIRS} |
From: <svn...@op...> - 2009-04-17 15:21:53
|
Author: bellmich Date: Fri Apr 17 17:21:36 2009 New Revision: 1061 URL: http://libsyncml.opensync.org/changeset/1061 Log: There is only one while loop in this source code. So let's "protect" it with traces. Modified: trunk/tests/mobiles/obex_mobile_ds_client.c Modified: trunk/tests/mobiles/obex_mobile_ds_client.c ============================================================================== --- trunk/tests/mobiles/obex_mobile_ds_client.c Fri Apr 17 16:43:19 2009 (r1060) +++ trunk/tests/mobiles/obex_mobile_ds_client.c Fri Apr 17 17:21:36 2009 (r1061) @@ -420,6 +420,7 @@ void obex_mobile_disconnect() { + smlTrace(TRACE_ENTRY, "%s", __func__); SmlError *error = NULL; while (mobile_state != TEST_MOBILE_STATE_DISCONNECTED) { @@ -437,6 +438,6 @@ smlSafeCFree(&mobile_msg_map_data); smlSafeCFree(&libsyncml_msg_end_data); - /* init the mobiles SyncML stack */ + smlTrace(TRACE_EXIT, "%s", __func__); } |
From: <svn...@op...> - 2009-04-17 14:43:39
|
Author: bellmich Date: Fri Apr 17 16:43:19 2009 New Revision: 1060 URL: http://libsyncml.opensync.org/changeset/1060 Log: try to compensate problems with glib type system on Solaris because of libsoup 2.2 Modified: trunk/tests/check_http.c Modified: trunk/tests/check_http.c ============================================================================== --- trunk/tests/check_http.c Fri Apr 17 16:28:34 2009 (r1059) +++ trunk/tests/check_http.c Fri Apr 17 16:43:19 2009 (r1060) @@ -882,6 +882,14 @@ sml_fail_unless(smlTransportSend(client1, NULL, data, &error), NULL); sml_fail_unless(error == NULL, NULL); smlTransportDataDeref(data); + + /* It is necessary to perform the first request alone + * because otherwise the test can fail on Solaris + * because Solaris uses an outdated libsoup 2.2. + */ + while (client_receives < 1) { + usleep(10); + } data = smlTransportDataNew((char *)"test", 5, SML_MIMETYPE_XML, FALSE, &error); sml_fail_unless(data != NULL, NULL); |
Author: bellmich Date: Fri Apr 17 16:28:34 2009 New Revision: 1059 URL: http://libsyncml.opensync.org/changeset/1059 Log: made the used port static to avoid conflicts Modified: trunk/tests/mobiles/libsyncml_ds_server.c trunk/tests/mobiles/nokia_6230_vcal/test.c trunk/tests/mobiles/nokia_6230_vcard/test.c trunk/tests/mobiles/nokia_9500_vcal/test.c trunk/tests/mobiles/nokia_9500_vcard/test.c trunk/tests/mobiles/nokia_9500_vcard_vcal/test.c trunk/tests/mobiles/nokia_e65_vcard/test.c trunk/tests/mobiles/nokia_e65_vcard_vcal/test.c trunk/tests/mobiles/obex_mobile_ds_client.c Modified: trunk/tests/mobiles/libsyncml_ds_server.c ============================================================================== --- trunk/tests/mobiles/libsyncml_ds_server.c Fri Apr 17 16:18:17 2009 (r1058) +++ trunk/tests/mobiles/libsyncml_ds_server.c Fri Apr 17 16:28:34 2009 (r1059) @@ -28,6 +28,7 @@ */ extern SmlTransportType tspType; +extern const char *obex_port; extern const char *maxObjSize; extern const char *maxMsgSize; extern const char *enableWbxml; @@ -98,7 +99,6 @@ &error); sml_fail_unless(dsObject != NULL, "%s", smlErrorPrint(&error)); - extern char *obex_port; switch(tspType) { case SML_TRANSPORT_OBEX_CLIENT: Modified: trunk/tests/mobiles/nokia_6230_vcal/test.c ============================================================================== --- trunk/tests/mobiles/nokia_6230_vcal/test.c Fri Apr 17 16:18:17 2009 (r1058) +++ trunk/tests/mobiles/nokia_6230_vcal/test.c Fri Apr 17 16:28:34 2009 (r1059) @@ -57,6 +57,7 @@ #include "../test_mobile.c" SmlTransportType tspType = SML_TRANSPORT_OBEX_CLIENT; +const char *obex_port = "10201"; const char *enableWbxml = "1"; const char *useTimestamp = "1"; Modified: trunk/tests/mobiles/nokia_6230_vcard/test.c ============================================================================== --- trunk/tests/mobiles/nokia_6230_vcard/test.c Fri Apr 17 16:18:17 2009 (r1058) +++ trunk/tests/mobiles/nokia_6230_vcard/test.c Fri Apr 17 16:28:34 2009 (r1059) @@ -57,6 +57,7 @@ #include "../test_mobile.c" SmlTransportType tspType = SML_TRANSPORT_OBEX_CLIENT; +const char *obex_port = "10202"; const char *enableWbxml = "1"; const char *useTimestamp = "1"; Modified: trunk/tests/mobiles/nokia_9500_vcal/test.c ============================================================================== --- trunk/tests/mobiles/nokia_9500_vcal/test.c Fri Apr 17 16:18:17 2009 (r1058) +++ trunk/tests/mobiles/nokia_9500_vcal/test.c Fri Apr 17 16:28:34 2009 (r1059) @@ -45,6 +45,7 @@ #include "../test_mobile.c" SmlTransportType tspType = SML_TRANSPORT_OBEX_CLIENT; +const char *obex_port = "10203"; const char *enableWbxml = "1"; const char *useTimestamp = "1"; Modified: trunk/tests/mobiles/nokia_9500_vcard/test.c ============================================================================== --- trunk/tests/mobiles/nokia_9500_vcard/test.c Fri Apr 17 16:18:17 2009 (r1058) +++ trunk/tests/mobiles/nokia_9500_vcard/test.c Fri Apr 17 16:28:34 2009 (r1059) @@ -45,6 +45,7 @@ #include "../test_mobile.c" SmlTransportType tspType = SML_TRANSPORT_OBEX_CLIENT; +const char *obex_port = "10204"; const char *enableWbxml = "1"; const char *useTimestamp = "1"; Modified: trunk/tests/mobiles/nokia_9500_vcard_vcal/test.c ============================================================================== --- trunk/tests/mobiles/nokia_9500_vcard_vcal/test.c Fri Apr 17 16:18:17 2009 (r1058) +++ trunk/tests/mobiles/nokia_9500_vcard_vcal/test.c Fri Apr 17 16:28:34 2009 (r1059) @@ -46,6 +46,7 @@ #include "../test_mobile.c" SmlTransportType tspType = SML_TRANSPORT_OBEX_CLIENT; +const char *obex_port = "10205"; const char *enableWbxml = "1"; const char *useTimestamp = "1"; Modified: trunk/tests/mobiles/nokia_e65_vcard/test.c ============================================================================== --- trunk/tests/mobiles/nokia_e65_vcard/test.c Fri Apr 17 16:18:17 2009 (r1058) +++ trunk/tests/mobiles/nokia_e65_vcard/test.c Fri Apr 17 16:28:34 2009 (r1059) @@ -45,6 +45,7 @@ #include "../test_mobile.c" SmlTransportType tspType = SML_TRANSPORT_OBEX_CLIENT; +const char *obex_port = "10206"; const char *enableWbxml = "1"; const char *useTimestamp = "1"; Modified: trunk/tests/mobiles/nokia_e65_vcard_vcal/test.c ============================================================================== --- trunk/tests/mobiles/nokia_e65_vcard_vcal/test.c Fri Apr 17 16:18:17 2009 (r1058) +++ trunk/tests/mobiles/nokia_e65_vcard_vcal/test.c Fri Apr 17 16:28:34 2009 (r1059) @@ -46,6 +46,7 @@ #include "../test_mobile.c" SmlTransportType tspType = SML_TRANSPORT_OBEX_CLIENT; +const char *obex_port = "10207"; const char *enableWbxml = "1"; const char *useTimestamp = "1"; Modified: trunk/tests/mobiles/obex_mobile_ds_client.c ============================================================================== --- trunk/tests/mobiles/obex_mobile_ds_client.c Fri Apr 17 16:18:17 2009 (r1058) +++ trunk/tests/mobiles/obex_mobile_ds_client.c Fri Apr 17 16:28:34 2009 (r1059) @@ -32,6 +32,7 @@ /* external configuration */ +extern const char *obex_port; extern const char *enableWbxml; extern char *testDirectory; @@ -327,8 +328,6 @@ return TRUE; } -char *obex_port; - void obex_mobile_connect() { char *filename = NULL; @@ -430,7 +429,6 @@ smlTransportFree(mobile_tsp); /* free configuration */ - smlSafeCFree(&obex_port); smlSafeCFree(&libsyncml_msg_notification_data); smlSafeCFree(&mobile_msg_alert_data); smlSafeCFree(&libsyncml_msg_alert_data); |
From: <svn...@op...> - 2009-04-17 14:18:23
|
Author: bellmich Date: Fri Apr 17 16:18:17 2009 New Revision: 1058 URL: http://libsyncml.opensync.org/changeset/1058 Log: try to compensate problems with glib type system on Solaris because of libsoup 2.2 Modified: trunk/tests/check_http.c Modified: trunk/tests/check_http.c ============================================================================== --- trunk/tests/check_http.c Fri Apr 17 16:15:29 2009 (r1057) +++ trunk/tests/check_http.c Fri Apr 17 16:18:17 2009 (r1058) @@ -778,6 +778,14 @@ sml_fail_unless(error == NULL, NULL); smlTransportDataDeref(data); + /* It is necessary to perform the working request first + * because otherwise the test can fail on Solaris + * because Solaris uses an outdated libsoup 2.2. + */ + while (client_receives != 1) { + usleep(100); + } + data = smlTransportDataNew((char *)"error", 6, SML_MIMETYPE_XML, FALSE, &error); sml_fail_unless(data != NULL, NULL); sml_fail_unless(error == NULL, NULL); |
From: <svn...@op...> - 2009-04-17 14:15:35
|
Author: bellmich Date: Fri Apr 17 16:15:29 2009 New Revision: 1057 URL: http://libsyncml.opensync.org/changeset/1057 Log: revert patch r1056 Modified: trunk/libsyncml/transports/http_client.c Modified: trunk/libsyncml/transports/http_client.c ============================================================================== --- trunk/libsyncml/transports/http_client.c Fri Apr 17 15:39:51 2009 (r1056) +++ trunk/libsyncml/transports/http_client.c Fri Apr 17 16:15:29 2009 (r1057) @@ -547,9 +547,6 @@ #ifdef HAVE_LIBSOUP22_SOLARIS smlTrace(TRACE_INTERNAL, "%s: Enabled libsoup 2.2 Solaris workarounds", __func__); - SoupSession *session = soup_session_sync_new(); - g_object_unref(session); - session = NULL; #endif tsp->functions.set_config_option = smlTransportHttpClientSetConfigOption; |
From: <svn...@op...> - 2009-04-17 13:41:29
|
Author: bellmich Date: Fri Apr 17 15:39:51 2009 New Revision: 1056 URL: http://libsyncml.opensync.org/changeset/1056 Log: initialize glib type system for outdated libsoup 2.2 on Solaris Modified: trunk/libsyncml/transports/http_client.c Modified: trunk/libsyncml/transports/http_client.c ============================================================================== --- trunk/libsyncml/transports/http_client.c Fri Apr 17 13:24:35 2009 (r1055) +++ trunk/libsyncml/transports/http_client.c Fri Apr 17 15:39:51 2009 (r1056) @@ -547,6 +547,9 @@ #ifdef HAVE_LIBSOUP22_SOLARIS smlTrace(TRACE_INTERNAL, "%s: Enabled libsoup 2.2 Solaris workarounds", __func__); + SoupSession *session = soup_session_sync_new(); + g_object_unref(session); + session = NULL; #endif tsp->functions.set_config_option = smlTransportHttpClientSetConfigOption; |
From: <svn...@op...> - 2009-04-17 11:24:51
|
Author: bellmich Date: Fri Apr 17 13:24:35 2009 New Revision: 1055 URL: http://libsyncml.opensync.org/changeset/1055 Log: Google has a wrong implementation of Alert Status. <Status> <CmdID>5</CmdID> <MsgRef>2</MsgRef> <CmdRef>3</CmdRef> <Cmd>Alert</Cmd> <SourceRef>contacts</SourceRef> <TargetRef>contacts</TargetRef> <Data>200</Data> <Item> <Data><![CDATA[20090417T112101Z]]></Data> </Item> </Status> The Item Data is the Next Anchor. Please see ticket #230 for more details. Modified: trunk/libsyncml/parser/sml_xml_parse.c Modified: trunk/libsyncml/parser/sml_xml_parse.c ============================================================================== --- trunk/libsyncml/parser/sml_xml_parse.c Fri Apr 17 13:23:50 2009 (r1054) +++ trunk/libsyncml/parser/sml_xml_parse.c Fri Apr 17 13:24:35 2009 (r1055) @@ -743,9 +743,19 @@ } SmlAnchor *anchor = NULL; - if (!_smlAnchorParse(&anchor, parser, error)) - goto error_free_item; - + if (xmlTextReaderNodeType(parser->reader) == XML_NODE_TEXT) { + /* Google just copies the element Next from the Anchor + * Please see ticket #230 for more details. + */ + anchor = smlTryMalloc0(sizeof(SmlAnchor), error); + if (!anchor) + goto error_free_item; + anchor->next = g_strdup((char *)xmlTextReaderConstValue(parser->reader)); + } else { + /* normal behaviour with anchor copy */ + if (!_smlAnchorParse(&anchor, parser, error)) + goto error_free_item; + } item->anchor = anchor; if (!_smlXmlParserStep(parser)) { |
From: <svn...@op...> - 2009-04-17 11:23:57
|
Author: bellmich Date: Fri Apr 17 13:23:50 2009 New Revision: 1054 URL: http://libsyncml.opensync.org/changeset/1054 Log: Google has a wrong implementation of Alert Status. <Status> <CmdID>5</CmdID> <MsgRef>2</MsgRef> <CmdRef>3</CmdRef> <Cmd>Alert</Cmd> <SourceRef>contacts</SourceRef> <TargetRef>contacts</TargetRef> <Data>200</Data> <Item> <Data><![CDATA[20090417T112101Z]]></Data> </Item> </Status> The Item Data is the Next Anchor. Please see ticket #230 for more details. Modified: trunk/tests/CMakeLists.txt trunk/tests/check_xml_parser.c Modified: trunk/tests/CMakeLists.txt ============================================================================== --- trunk/tests/CMakeLists.txt Fri Apr 17 11:35:59 2009 (r1053) +++ trunk/tests/CMakeLists.txt Fri Apr 17 13:23:50 2009 (r1054) @@ -119,6 +119,7 @@ SML_ADD_TESTCASE( xml_parser_status ) SML_ADD_TESTCASE( xml_parser_status2 ) SML_ADD_TESTCASE( xml_parser_status3 ) + SML_ADD_TESTCASE( xml_parser_status_google ) SML_ADD_TESTCASE( xml_parser_final ) SML_ADD_TESTCASE( xml_parser_final2 ) SML_ADD_TESTCASE( xml_parser_cmd ) Modified: trunk/tests/check_xml_parser.c ============================================================================== --- trunk/tests/check_xml_parser.c Fri Apr 17 11:35:59 2009 (r1053) +++ trunk/tests/check_xml_parser.c Fri Apr 17 13:23:50 2009 (r1054) @@ -601,6 +601,46 @@ } END_TEST +START_TEST (xml_parser_status_google) +{ + const char *data = "<SyncML><SyncHdr><VerProto>SyncML/1.1</VerProto><VerDTD>1.1</VerDTD><MsgID>1</MsgID><SessionID>1</SessionID><Target><LocURI>test</LocURI></Target><Source><LocURI>test</LocURI></Source></SyncHdr><SyncBody><Status><CmdID>5</CmdID><MsgRef>2</MsgRef><CmdRef>3</CmdRef><Cmd>Alert</Cmd><SourceRef>contacts</SourceRef><TargetRef>contacts</TargetRef><Data>200</Data><Item><Data><![CDATA[20090417T092559Z]]></Data></Item></Status></SyncBody></SyncML>"; + SmlError *error = NULL; + SmlParser *parser = start_parser(data, &error); + sml_fail_unless(parser != NULL, "%s", smlErrorPrint(&error)); + + SmlHeader *header = NULL; + SmlCred *cred = NULL; + + sml_fail_unless(smlParserGetHeader(parser, &header, &cred, &error), NULL); + sml_fail_unless(header != NULL, NULL); + sml_fail_unless(cred == NULL, NULL); + sml_fail_unless(error == NULL, NULL); + + sml_fail_unless(header->messageID == 1, NULL); + smlHeaderFree(header); + + SmlStatus *status = NULL; + sml_fail_unless(smlParserGetStatus(parser, &status, &error), NULL); + sml_fail_unless(status != NULL, NULL); + sml_fail_unless(error == NULL, NULL); + smlStatusUnref(status); + + sml_fail_unless(smlParserGetStatus(parser, &status, &error), NULL); + sml_fail_unless(status == NULL, NULL); + sml_fail_unless(error == NULL, NULL); + + SmlCommand *cmd = NULL; + sml_fail_unless(smlParserGetCommand(parser, &cmd, &error), NULL); + sml_fail_unless(cmd == NULL, NULL); + sml_fail_unless(error == NULL, NULL); + + sml_fail_unless(smlParserEnd(parser, NULL, NULL, &error), NULL); + sml_fail_unless(error == NULL, NULL); + + smlParserFree(parser); +} +END_TEST + START_TEST (xml_parser_final) { const char *data = "<SyncML><SyncHdr><VerProto>SyncML/1.1</VerProto><VerDTD>1.1</VerDTD><MsgID>1</MsgID><SessionID>1</SessionID><Target><LocURI>test</LocURI></Target><Source><LocURI>test</LocURI></Source></SyncHdr><SyncBody><Status><CmdID>1</CmdID><MsgRef>1</MsgRef><CmdRef>0</CmdRef><Cmd>Sync</Cmd></Status><Status><CmdID>1</CmdID><MsgRef>1</MsgRef><CmdRef>0</CmdRef><Cmd>Sync</Cmd></Status><Final></Final></SyncBody></SyncML>"; |
From: <svn...@op...> - 2009-04-17 09:36:03
|
Author: bellmich Date: Fri Apr 17 11:35:59 2009 New Revision: 1053 URL: http://libsyncml.opensync.org/changeset/1053 Log: The HTTP client must support WBXML too. Please see ticket #230. Google only supports WBXML today. (https://m.google.com/syncml is still a beta). Modified: trunk/libsyncml/data_sync_api/transport_http_client.c Modified: trunk/libsyncml/data_sync_api/transport_http_client.c ============================================================================== --- trunk/libsyncml/data_sync_api/transport_http_client.c Thu Apr 16 17:22:51 2009 (r1052) +++ trunk/libsyncml/data_sync_api/transport_http_client.c Fri Apr 17 11:35:59 2009 (r1053) @@ -92,11 +92,11 @@ char *sessionString = smlManagerGetNewSessionID(dsObject->manager); dsObject->session = smlSessionNew(SML_SESSION_TYPE_CLIENT, - SML_MIMETYPE_XML, - dsObject->version, - SML_PROTOCOL_SYNCML, - target, source, - sessionString, 0, error); + dsObject->useWbxml?SML_MIMETYPE_WBXML:SML_MIMETYPE_XML, + dsObject->version, + SML_PROTOCOL_SYNCML, + target, source, + sessionString, 0, error); smlSafeCFree(&sessionString); if (!dsObject->session) goto error; |