Changeset 3407
- Timestamp:
- 07/07/08 11:21:47 (3 months ago)
- Files:
-
- trunk/opensync/group/opensync_group.c (modified) (4 diffs)
- trunk/opensync/group/opensync_group_internals.h (modified) (1 diff)
- trunk/opensync/group/opensync_member.c (modified) (6 diffs)
- trunk/opensync/group/opensync_member_internals.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/opensync/group/opensync_group.c
r3173 r3407 27 27 #include "opensync_group_internals.h" 28 28 #include "opensync-db.h" 29 30 #ifdef OPENSYNC_UNITTESTS 31 #include "opensync_member_internals.h" 32 #endif /* OPENSYNC_UNITTESTS */ 29 33 30 34 #ifndef _WIN32 … … 136 140 if (!member) 137 141 goto error_close; 142 143 #ifdef OPENSYNC_UNITTESTS 144 if (group->schemadir) 145 osync_member_set_schemadir(member, group->schemadir); 146 #endif /* OPENSYNC_UNITTESTS */ 138 147 139 148 member_path = g_strdup_printf ("%s/%s", osync_group_get_configdir(group), de); … … 223 232 } 224 233 234 #ifdef OPENSYNC_UNITTESTS 235 /** @brief Set the schemadir for configuration validation to a custom directory. 236 * This is actually only inteded for UNITTESTS to run tests without 237 * having OpenSync installed. 238 * 239 * @param group Pointer to group 240 * @param schemadir Custom schemadir path 241 * 242 */ 243 void osync_group_set_schemadir(OSyncGroup *group, const char *schemadir) 244 { 245 osync_assert(group); 246 osync_assert(schemadir); 247 248 if (group->schemadir) 249 g_free(group->schemadir); 250 251 group->schemadir = g_strdup(schemadir); 252 } 253 #endif /* OPENSYNC_UNITTESTS */ 254 225 255 /*@}*/ 226 256 … … 301 331 g_free(group->configdir); 302 332 333 #ifdef OPENSYNC_UNITTESTS 334 if (group->schemadir) 335 g_free(group->schemadir); 336 #endif /* OPENSYNC_UNITTESTS */ 337 303 338 g_free(group); 304 339 } trunk/opensync/group/opensync_group_internals.h
r3172 r3407 47 47 osync_bool converter_enabled; 48 48 49 #ifdef OPENSYNC_UNITTESTS 50 char *schemadir; 51 #endif /* OPENSYNC_UNITTESTS*/ 49 52 int ref_count; 50 53 }; 51 54 55 56 #ifdef OPENSYNC_UNITTESTS 57 void osync_group_set_schemadir(OSyncGroup *group, const char *schemadir); 58 #endif /* OPENSYNC_UNITTESTS*/ 59 52 60 #endif /* _OPENSYNC_GROUP_INTERNALS_H_ */ trunk/opensync/group/opensync_member.c
r3350 r3407 147 147 } 148 148 149 #ifdef OPENSYNC_UNITTESTS 150 /** @brief Set the schemadir for configuration validation to a custom directory. 151 * This is actually only inteded for UNITTESTS to run tests without 152 * having OpenSync installed. 153 * 154 * @param member Pointer to member 155 * @param schemadir Custom schemadir path 156 * 157 */ 158 void osync_member_set_schemadir(OSyncMember *member, const char *schemadir) 159 { 160 osync_assert(member); 161 osync_assert(schemadir); 162 163 if (member->schemadir) 164 g_free(member->schemadir); 165 166 member->schemadir = g_strdup(schemadir); 167 } 168 #endif /* OPENSYNC_UNITTESTS */ 169 149 170 /*@}*/ 150 171 … … 226 247 osync_member_flush_objtypes(member); 227 248 249 #ifdef OPENSYNC_UNITTESTS 250 if (member->schemadir) 251 g_free(member->schemadir); 252 #endif /* OPENSYNC_UNITTESTS */ 253 254 228 255 g_free(member); 229 256 } … … 327 354 char *filename = NULL; 328 355 OSyncPluginConfig *config = NULL; 356 const char *schemadir = NULL; 329 357 330 358 osync_trace(TRACE_ENTRY, "%s(%p, %p)", __func__, member, error); … … 349 377 } 350 378 351 if (!osync_plugin_config_file_load(config, filename, error)) 379 #ifdef OPENSYNC_UNITTESTS 380 if (member->schemadir) 381 schemadir = member->schemadir; 382 #endif 383 384 if (!osync_plugin_config_file_load(config, filename, schemadir, error)) 352 385 goto error_free_config; 353 386 … … 397 430 { 398 431 char *filename = NULL; 432 const char *schemadir = NULL; 399 433 400 434 osync_trace(TRACE_ENTRY, "%s(%p, %p)", __func__, member, error); … … 418 452 goto error; 419 453 420 if (!osync_plugin_config_file_load(config, filename, error)) 454 #ifdef OPENSYNC_UNITTESTS 455 if (member->schemadir) 456 schemadir = member->schemadir; 457 #endif 458 459 if (!osync_plugin_config_file_load(config, filename, schemadir, error)) 421 460 goto error_free_config; 422 461 trunk/opensync/group/opensync_member_internals.h
r3350 r3407 43 43 OSyncCapabilities *capabilities; 44 44 OSyncMerger *merger; 45 46 #ifdef OPENSYNC_UNITTESTS 47 char *schemadir; 48 #endif /* OPENSYNC_UNITTESTS */ 45 49 }; 46 50 51 52 #ifdef OPENSYNC_UNITTESTS 53 void osync_member_set_schemadir(OSyncMember *member, const char *schemadir); 54 #endif /* OPENSYNC_UNITTESTS */ 55 47 56 #endif /* _OPENSYNC_MEMBER_INTERNALS_H_ */
