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...> - 2005-03-22 18:17:54
|
Author: abauer Date: 2005-03-22 19:18:38 +0100 (Tue, 22 Mar 2005) New Revision: 407 Modified: trunk/misc/buildtest.sh Log: Fixed the buildtest script Modified: trunk/misc/buildtest.sh =================================================================== --- trunk/misc/buildtest.sh 2005-03-22 17:57:14 UTC (rev 406) +++ trunk/misc/buildtest.sh 2005-03-22 18:18:38 UTC (rev 407) @@ -4,9 +4,9 @@ rm -rf _inst > /dev/null echo -n "." -rm -rf opensync-0.?? > /dev/null +rm -rf libopensync-0.?? > /dev/null echo -n "." -rm -f opensync-0.??.tar.gz > /dev/null +rm -f libopensync-0.??.tar.gz > /dev/null echo -n "." echo "" @@ -22,12 +22,12 @@ make dist > /dev/null || exit 1 mkdir _inst > /dev/null -rm -rf opensync-0.?? +rm -rf libopensync-0.?? echo "Unpacking tarball" -tar zxvf opensync-0.??.tar.gz > /dev/null || exit 1 +tar zxvf libopensync-0.??.tar.gz > /dev/null || exit 1 -cd opensync-0.?? +cd libopensync-0.?? echo -n "Making OpenSync" ./autogen.sh --prefix=$TOP_SRCDIR/_inst > /dev/null || exit 1 @@ -44,7 +44,7 @@ make install > /dev/null || exit 1 echo "." -cd $TOP_SRCDIR/opensync-0.?? || exit 1 +cd $TOP_SRCDIR/libopensync-0.?? || exit 1 echo "Running tests now." make check || exit 1 @@ -52,6 +52,6 @@ cd $TOP_SRCDIR rm -rf _inst -rm -rf opensync-0.?? +rm -rf libopensync-0.?? echo "Everyting went fine!" |
From: <svn...@op...> - 2005-03-22 17:56:45
|
Author: azrael Date: 2005-03-22 18:57:14 +0100 (Tue, 22 Mar 2005) New Revision: 406 Modified: trunk/Doxyfile trunk/configure.in trunk/misc/buildtest.sh trunk/tests/Makefile.am Log: Update version to 0.15 Fixed the buildtest script Corrected the dists of the tests Makefile Modified: trunk/Doxyfile =================================================================== --- trunk/Doxyfile 2005-03-22 17:55:40 UTC (rev 405) +++ trunk/Doxyfile 2005-03-22 17:57:14 UTC (rev 406) @@ -23,7 +23,7 @@ # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 0.14 +PROJECT_NUMBER = 0.15 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. Modified: trunk/configure.in =================================================================== --- trunk/configure.in 2005-03-22 17:55:40 UTC (rev 405) +++ trunk/configure.in 2005-03-22 17:57:14 UTC (rev 406) @@ -1,7 +1,7 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.58) -AC_INIT(OpenSync, 0.14, [], libopensync) +AC_INIT(OpenSync, 0.15, [], libopensync) AC_CONFIG_SRCDIR([opensync/opensync.h]) AM_INIT_AUTOMAKE(foreign) AC_CONFIG_HEADER(config.h) @@ -139,8 +139,6 @@ if test x$have_python = xno ; then if test x$enable_python = xyes ; then AC_MSG_ERROR([Building python explicitly requested, but can't build python bindings]) - else - AC_MSG_WARN([Couldn't find either Pyrex or the Python headers, not building Python bindings]) fi fi fi Modified: trunk/misc/buildtest.sh =================================================================== --- trunk/misc/buildtest.sh 2005-03-22 17:55:40 UTC (rev 405) +++ trunk/misc/buildtest.sh 2005-03-22 17:57:14 UTC (rev 406) @@ -18,16 +18,6 @@ make clean > /dev/null || exit 1 echo -n "." -cd plugins/file-sync - -./autogen.sh > /dev/null -echo -n "." -make clean > /dev/null || exit 1 -echo -n "." -echo "" - -cd $TOP_SRCDIR - echo "Making tarball" make dist > /dev/null || exit 1 @@ -38,7 +28,6 @@ tar zxvf opensync-0.??.tar.gz > /dev/null || exit 1 cd opensync-0.?? -BUILD_DIR=$(pwd) echo -n "Making OpenSync" ./autogen.sh --prefix=$TOP_SRCDIR/_inst > /dev/null || exit 1 @@ -46,19 +35,8 @@ make install > /dev/null || exit 1 echo "." -cd plugins/file-sync +cd docs/example-plugin -echo -n "Making file-sync plugin" -export PKG_CONFIG_PATH=$TOP_SRCDIR/_inst/lib -./autogen.sh --prefix=$TOP_SRCDIR/_inst --enable-error-tests=yes > /dev/null || exit 1 -echo -n "." -make install > /dev/null || exit 1 -echo "." - -cd $BUILD_DIR || exit 1 - -cd plugins/example-plugin - echo -n "Making example plugin" export PKG_CONFIG_PATH=$TOP_SRCDIR/_inst/lib ./autogen.sh --prefix=$TOP_SRCDIR/_inst > /dev/null || exit 1 Modified: trunk/tests/Makefile.am =================================================================== --- trunk/tests/Makefile.am 2005-03-22 17:55:40 UTC (rev 405) +++ trunk/tests/Makefile.am 2005-03-22 17:57:14 UTC (rev 406) @@ -1,11 +1,17 @@ ## Process this file with automake to produce Makefile.in -EXTRA_DIST = data support.h - AM_CFLAGS = @XML_CFLAGS@ -Wall -Werror @GCOV_CFLAGS@ INCLUDES = -I$(top_srcdir) @PACKAGE_CFLAGS@ -I$(top_srcdir)/osengine +EXTRA_DIST = \ + data \ + support.h \ + mock-plugin/mock_sync.h \ + mock-plugin/mock_format.c \ + mock-plugin/mock_sync.c \ + mock-plugin/Makefile.am + if ENABLE_PROF PROFTEST = coverage.sh endif |
From: <svn...@op...> - 2005-03-22 17:55:09
|
Author: drzeus Date: 2005-03-22 18:55:40 +0100 (Tue, 22 Mar 2005) New Revision: 405 Modified: trunk/misc/ Log: Ignore the generated spec file Property changes on: trunk/misc ___________________________________________________________________ Name: svn:ignore + opensync.spec |
From: <svn...@op...> - 2005-03-22 17:49:11
|
Author: drzeus Date: 2005-03-22 18:49:56 +0100 (Tue, 22 Mar 2005) New Revision: 404 Modified: plugins/evolution/configure.in plugins/evolution2/configure.in plugins/file-sync/configure.in plugins/kdepim/configure.in plugins/palm/configure.in plugins/python-module/configure.in Log: Changed to a consistent naming that also reflects that these are plugins for OpenSync. Modified: plugins/evolution/configure.in =================================================================== --- plugins/evolution/configure.in 2005-03-22 17:49:09 UTC (rev 403) +++ plugins/evolution/configure.in 2005-03-22 17:49:56 UTC (rev 404) @@ -1,7 +1,7 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.58) -AC_INIT([OpenSync Evolution Plugin], 0.01, [], [evo-sync]) +AC_INIT([OpenSync Evolution Plugin], 0.01, [], [libopensync-plugin-evo]) AM_INIT_AUTOMAKE(foreign) AC_CONFIG_SRCDIR(src/evolution_sync.c) AC_CONFIG_HEADER(config.h) Modified: plugins/evolution2/configure.in =================================================================== --- plugins/evolution2/configure.in 2005-03-22 17:49:09 UTC (rev 403) +++ plugins/evolution2/configure.in 2005-03-22 17:49:56 UTC (rev 404) @@ -1,7 +1,7 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.58) -AC_INIT([OpenSync Evolution 2 Plugin], 0.01, [], [evo2-sync]) +AC_INIT([OpenSync Evolution 2 Plugin], 0.01, [], [libopensync-plugin-evo2]) AM_INIT_AUTOMAKE(foreign) AC_CONFIG_SRCDIR(src/evolution2_sync.c) AC_CONFIG_HEADER(config.h) Modified: plugins/file-sync/configure.in =================================================================== --- plugins/file-sync/configure.in 2005-03-22 17:49:09 UTC (rev 403) +++ plugins/file-sync/configure.in 2005-03-22 17:49:56 UTC (rev 404) @@ -1,7 +1,7 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.58) -AC_INIT([OpenSync File Plugin], 0.01, [], [file-sync]) +AC_INIT([OpenSync File Plugin], 0.01, [], [libopensync-plugin-file]) AM_INIT_AUTOMAKE(foreign) AC_CONFIG_SRCDIR(src/file_sync.c) AC_CONFIG_HEADER(config.h) Modified: plugins/kdepim/configure.in =================================================================== --- plugins/kdepim/configure.in 2005-03-22 17:49:09 UTC (rev 403) +++ plugins/kdepim/configure.in 2005-03-22 17:49:56 UTC (rev 404) @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT(kdepim_sync, 0.82) dnl a source file from your sub dir +AC_INIT(kdepim_sync, 0.82, libopensync-plugin-kdepim) dnl a source file from your sub dir AC_CONFIG_SRCDIR(src/kdepim_sync.cpp) AM_INIT_AUTOMAKE([foreign]) Modified: plugins/palm/configure.in =================================================================== --- plugins/palm/configure.in 2005-03-22 17:49:09 UTC (rev 403) +++ plugins/palm/configure.in 2005-03-22 17:49:56 UTC (rev 404) @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT([OpenSync Palm Plugin], 0.82, [], [palm_sync]) +AC_INIT([OpenSync Palm Plugin], 0.82, [], [libopensync-plugin-palm]) AM_INIT_AUTOMAKE(foreign) AC_CONFIG_SRCDIR(src/palm_sync.c) AC_CONFIG_HEADER(config.h) Modified: plugins/python-module/configure.in =================================================================== --- plugins/python-module/configure.in 2005-03-22 17:49:09 UTC (rev 403) +++ plugins/python-module/configure.in 2005-03-22 17:49:56 UTC (rev 404) @@ -1,7 +1,7 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.58) -AC_INIT([OpenSync Python Module], 0.01, [], [python-module]) +AC_INIT([OpenSync Python Module], 0.01, [], [libopensync-plugin-python]) AM_INIT_AUTOMAKE(foreign) AC_CONFIG_SRCDIR(src/python_module.c) AC_CONFIG_HEADER(config.h) |
From: <svn...@op...> - 2005-03-22 17:48:39
|
Author: drzeus Date: 2005-03-22 18:49:09 +0100 (Tue, 22 Mar 2005) New Revision: 403 Modified: trunk/configure.in Log: Name change to reflect OpenSync's library nature. This affects tarball and rpm creation. Modified: trunk/configure.in =================================================================== --- trunk/configure.in 2005-03-22 17:40:29 UTC (rev 402) +++ trunk/configure.in 2005-03-22 17:49:09 UTC (rev 403) @@ -1,7 +1,7 @@ dnl Process this file with autoconf to produce a configure script. AC_PREREQ(2.58) -AC_INIT(OpenSync, 0.14, [], opensync) +AC_INIT(OpenSync, 0.14, [], libopensync) AC_CONFIG_SRCDIR([opensync/opensync.h]) AM_INIT_AUTOMAKE(foreign) AC_CONFIG_HEADER(config.h) |
From: <svn...@op...> - 2005-03-22 17:39:41
|
Author: drzeus Date: 2005-03-22 18:40:29 +0100 (Tue, 22 Mar 2005) New Revision: 402 Modified: trunk/tests/mock-plugin/mock_sync.c Log: gcc4 fix Modified: trunk/tests/mock-plugin/mock_sync.c =================================================================== --- trunk/tests/mock-plugin/mock_sync.c 2005-03-22 17:36:45 UTC (rev 401) +++ trunk/tests/mock-plugin/mock_sync.c 2005-03-22 17:40:29 UTC (rev 402) @@ -47,7 +47,7 @@ return FALSE; } - if (xmlStrcmp(cur->name, "config")) { + if (xmlStrcmp(cur->name, (xmlChar*)"config")) { xmlFreeDoc(doc); osync_error_set(error, OSYNC_ERROR_GENERIC, "Config valid is not valid"); osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error)); @@ -57,7 +57,7 @@ cur = cur->xmlChildrenNode; while (cur != NULL) { - char *str = xmlNodeGetContent(cur); + char *str = (char*)xmlNodeGetContent(cur); if (str) { if (!xmlStrcmp(cur->name, (const xmlChar *)"path")) { env->path = g_strdup(str); |
From: <svn...@op...> - 2005-03-22 17:36:17
|
Author: drzeus Date: 2005-03-22 18:36:45 +0100 (Tue, 22 Mar 2005) New Revision: 401 Modified: trunk/Makefile.am Log: Plugins no longer in opensync directory so do no try to include it in the dist. Modified: trunk/Makefile.am =================================================================== --- trunk/Makefile.am 2005-03-22 16:50:00 UTC (rev 400) +++ trunk/Makefile.am 2005-03-22 17:36:45 UTC (rev 401) @@ -17,7 +17,6 @@ EXTRA_DIST = \ autogen.sh \ - plugins \ opensync-1.0.pc.in \ osengine-1.0.pc.in \ misc/opensync.spec.in \ |
From: <svn...@op...> - 2005-03-22 16:49:12
|
Author: azrael Date: 2005-03-22 17:50:00 +0100 (Tue, 22 Mar 2005) New Revision: 400 Removed: trunk/plugins/ Log: Removed the plugins directory |
From: <svn...@op...> - 2005-03-22 16:48:28
|
Author: azrael Date: 2005-03-22 17:49:14 +0100 (Tue, 22 Mar 2005) New Revision: 399 Added: trunk/docs/example-plugin/ Removed: trunk/plugins/example-plugin/ Log: Moved the example plugin into docs/ Copied: trunk/docs/example-plugin (from rev 398, trunk/plugins/example-plugin) |
From: <svn...@op...> - 2005-03-22 16:45:35
|
Author: azrael Date: 2005-03-22 17:46:18 +0100 (Tue, 22 Mar 2005) New Revision: 398 Added: plugins/evolution/ plugins/evolution2/ plugins/file-sync/ plugins/file-sync/configure.in plugins/file-sync/src/file_sync.c plugins/kdepim/ plugins/palm/ plugins/python-module/ plugins/syncml/ Removed: plugins/file-sync/configure.in plugins/file-sync/src/file_sync.c trunk/plugins/evolution2_sync/ trunk/plugins/evolution_sync/ trunk/plugins/file-sync/ trunk/plugins/kdepim/ trunk/plugins/palm_sync/ trunk/plugins/python-module/ trunk/plugins/syncml/ Log: Moved the plugin out of opensync Copied: plugins/evolution (from rev 394, trunk/plugins/evolution_sync) Copied: plugins/evolution2 (from rev 394, trunk/plugins/evolution2_sync) Copied: plugins/file-sync (from rev 394, trunk/plugins/file-sync) Deleted: plugins/file-sync/configure.in Copied: plugins/file-sync/configure.in (from rev 395, trunk/plugins/file-sync/configure.in) Deleted: plugins/file-sync/src/file_sync.c Copied: plugins/file-sync/src/file_sync.c (from rev 395, trunk/plugins/file-sync/src/file_sync.c) Copied: plugins/kdepim (from rev 394, trunk/plugins/kdepim) Copied: plugins/palm (from rev 394, trunk/plugins/palm_sync) Copied: plugins/python-module (from rev 394, trunk/plugins/python-module) Copied: plugins/syncml (from rev 394, trunk/plugins/syncml) |
From: <svn...@op...> - 2005-03-22 16:40:49
|
Author: azrael Date: 2005-03-22 17:41:17 +0100 (Tue, 22 Mar 2005) New Revision: 397 Added: plugins/ Log: Added new plugins directory |
From: <svn...@op...> - 2005-03-22 16:31:14
|
Author: azrael Date: 2005-03-22 17:31:43 +0100 (Tue, 22 Mar 2005) New Revision: 396 Added: trunk/misc/RPM Removed: trunk/RPM Log: Moved the RPM readme into misc/ Deleted: trunk/RPM Copied: trunk/misc/RPM (from rev 395, trunk/RPM) |
From: <svn...@op...> - 2005-03-22 16:25:40
|
Author: azrael Date: 2005-03-22 17:26:20 +0100 (Tue, 22 Mar 2005) New Revision: 395 Added: trunk/tests/mock-plugin/ trunk/tests/mock-plugin/Makefile.am trunk/tests/mock-plugin/mock_format.c trunk/tests/mock-plugin/mock_sync.c trunk/tests/mock-plugin/mock_sync.h Removed: trunk/misc/opensync.spec trunk/tests/mock-plugin/Makefile.am trunk/tests/mock-plugin/mock_format.c trunk/tests/mock-plugin/mock_sync.c trunk/tests/mock-plugin/mock_sync.h Modified: trunk/configure.in trunk/opensync/opensync_plugin.c trunk/plugins/file-sync/configure.in trunk/plugins/file-sync/src/file_sync.c trunk/tests/Makefile.am trunk/tests/check_codes.c trunk/tests/check_env.c trunk/tests/check_filter.c trunk/tests/check_multisync.c trunk/tests/check_sync.c trunk/tests/check_vcard.c trunk/tests/support.c Log: svn merge -r386:394 ../branches/experimental-branch/ . Modified: trunk/configure.in =================================================================== --- trunk/configure.in 2005-03-22 16:20:29 UTC (rev 394) +++ trunk/configure.in 2005-03-22 16:26:20 UTC (rev 395) @@ -164,6 +164,7 @@ opensync/Makefile tools/Makefile tests/Makefile +tests/mock-plugin/Makefile formats/Makefile formats/vformats-xml/Makefile osengine/Makefile Deleted: trunk/misc/opensync.spec Modified: trunk/opensync/opensync_plugin.c =================================================================== --- trunk/opensync/opensync_plugin.c 2005-03-22 16:20:29 UTC (rev 394) +++ trunk/opensync/opensync_plugin.c 2005-03-22 16:26:20 UTC (rev 395) @@ -121,6 +121,7 @@ OSyncPlugin *osync_plugin_load(OSyncEnv *env, const char *path, OSyncError **error) { osync_trace(TRACE_ENTRY, "osync_plugin_load(%p, %s, %p)", env, path, error); + /* Check if this platform supports dynamic * loading of modules */ if (!g_module_supported()) { @@ -136,7 +137,6 @@ memset(&(plugin->info.functions), 0, sizeof(OSyncPluginFunctions)); if (!plugin->real_plugin) { - osync_debug("OSPLG", 0, "Unable to open plugin %s", path); osync_error_set(error, OSYNC_ERROR_GENERIC, "Unable to open plugin %s: %s", path, g_module_error()); osync_plugin_free(plugin); osync_trace(TRACE_EXIT_ERROR, "osync_plugin_load: %s", osync_error_print(error)); @@ -186,7 +186,7 @@ osync_trace(TRACE_ENTRY, "osync_format_plugin_load(%p, %s, %p)", env, path, error); /* Check if this platform supports dynamic * loading of modules */ - osync_debug("OSFRM", 3, "Loading formats plugin from %s", path); + if (!g_module_supported()) { osync_error_set(error, OSYNC_ERROR_GENERIC, "This platform does not support loading of modules"); osync_debug("OSPLG", 0, "This platform does not support loading of modules"); Modified: trunk/plugins/file-sync/configure.in =================================================================== --- trunk/plugins/file-sync/configure.in 2005-03-22 16:20:29 UTC (rev 394) +++ trunk/plugins/file-sync/configure.in 2005-03-22 16:26:20 UTC (rev 395) @@ -34,21 +34,6 @@ AC_SUBST(OPENSYNC_FORMATSDIR) AC_SUBST(OPENSYNC_HEADERDIR) -AC_ARG_ENABLE(stress-tests, [ --enable-stress-tests enable support for stress testing],STRESS_TEST=$enableval) -if test "x${STRESS_TEST}" = "xyes"; then - AC_DEFINE(STRESS_TEST,1,[Stress Testing]) -fi - -AC_ARG_ENABLE(crash-tests, [ --enable-crash-tests enable support for crash testing],CRASH_TEST=$enableval) -if test "x${CRASH_TEST}" = "xyes"; then - AC_DEFINE(CRASH_TEST,1,[Crash Testing]) -fi - -AC_ARG_ENABLE(error-tests, [ --enable-error-tests enable support for error testing],ERROR_TEST=$enableval) -if test "x${ERROR_TEST}" = "xyes"; then - AC_DEFINE(ERROR_TEST,1,[Error Testing]) -fi - AC_CHECK_HEADER(fam.h,HAVE_FAM=1,HAVE_FAM=0) AM_CONDITIONAL(ENABLE_FAM, test x$HAVE_FAM = x1) AC_SUBST(HAVE_FAM) @@ -74,23 +59,6 @@ echo "have libfam-dev installed." fi echo "" -echo "Settings:" -if test "x${STRESS_TEST}" = "xyes"; then - echo "Stress Tests: Enabled" -else - echo "Stress Tests: Disabled" -fi -if test "x${ERROR_TEST}" = "xyes"; then - echo "Error Tests: Enabled" -else - echo "Error Tests: Disabled" -fi -if test "x${CRASH_TEST}" = "xyes"; then - echo "Crash Tests: Enabled" -else - echo "Crash Tests: Disabled" -fi -echo "" echo "Plugin will be installed in ${OPENSYNC_PLUGINDIR}" echo "Default config will be installed in ${OPENSYNC_CONFIGDIR}" echo "Format will be installed in ${OPENSYNC_FORMATSDIR}" Modified: trunk/plugins/file-sync/src/file_sync.c =================================================================== --- trunk/plugins/file-sync/src/file_sync.c 2005-03-22 16:20:29 UTC (rev 394) +++ trunk/plugins/file-sync/src/file_sync.c 2005-03-22 16:26:20 UTC (rev 395) @@ -21,32 +21,6 @@ #include "file_sync.h" #include <stdlib.h> -#ifdef ERROR_TEST -static osync_bool fs_get_error(OSyncMember *member, const char *domain) -{ - osync_debug("FILE-SYNC", 4, "checking error domain %s", domain); - const char *env = g_getenv(domain); - if (!env) - return FALSE; - - int num = atoi(env); - int mask = 1 << (osync_member_get_id(member) - 1); - osync_debug("FILE-SYNC", 2, "returning \"%s\" for error domain %s", (num & mask) ? "TRUE" : "FALSE", domain); - if (num & mask) { - char *chancestr = g_strdup_printf("%s_PROB", domain); - const char *chance = g_getenv(chancestr); - g_free(chancestr); - if (!chance) - return TRUE; - int prob = atoi(chance); - if (prob >= g_random_int_range(0, 100)) - return TRUE; - osync_debug("FILE-SYNC", 2, "returning \"FALSE\" for error domain %s", domain); - } - return FALSE; -} -#endif - #ifdef HAVE_FAM static gboolean _fam_prepare(GSource *source, gint *timeout_) { @@ -91,12 +65,7 @@ static void *fs_initialize(OSyncMember *member, OSyncError **error) { osync_debug("FILE-SYNC", 4, "start: %s", __func__); -#ifdef ERROR_TEST - if (fs_get_error(member, "INIT_NULL")) { - osync_error_set(error, OSYNC_ERROR_EXPECTED, "Triggering INIT_NULL error"); - return NULL; - } -#endif + char *configdata; int configsize; filesyncinfo *fsinfo = g_malloc0(sizeof(filesyncinfo)); @@ -141,15 +110,6 @@ osync_debug("FILE-SYNC", 4, "start: %s", __func__); filesyncinfo *fsinfo = (filesyncinfo *)osync_context_get_plugin_data(ctx); -#ifdef ERROR_TEST - if (fs_get_error(fsinfo->member, "CONNECT_ERROR")) { - osync_context_report_error(ctx, OSYNC_ERROR_EXPECTED, "Triggering CONNECT_ERROR error"); - return; - } - if (fs_get_error(fsinfo->member, "CONNECT_TIMEOUT")) - return; -#endif - OSyncError *error = NULL; if (!osync_hashtable_load(fsinfo->hashtable, fsinfo->member, &error)) { osync_context_report_osyncerror(ctx, &error); @@ -260,17 +220,6 @@ osync_debug("FILE-SYNC", 4, "start: %s", __func__); filesyncinfo *fsinfo = (filesyncinfo *)osync_context_get_plugin_data(ctx); -#ifdef ERROR_TEST - if (fs_get_error(fsinfo->member, "GET_CHANGES_ERROR")) { - osync_context_report_error(ctx, OSYNC_ERROR_EXPECTED, "Triggering GET_CHANGES_ERROR error"); - return; - } - if (fs_get_error(fsinfo->member, "GET_CHANGES_TIMEOUT")) - return; - if (fs_get_error(fsinfo->member, "GET_CHANGES_TIMEOUT2")) - sleep(8); -#endif - if (osync_member_get_slow_sync(fsinfo->member, "data")) { osync_debug("FILE-SYNC", 3, "Slow sync requested"); osync_hashtable_set_slow_sync(fsinfo->hashtable, "data"); @@ -291,15 +240,6 @@ filesyncinfo *fsinfo = (filesyncinfo *)osync_context_get_plugin_data(ctx); fs_fileinfo *file_info = (fs_fileinfo *)osync_change_get_data(change); -#ifdef ERROR_TEST - if (fs_get_error(fsinfo->member, "GET_DATA_ERROR")) { - osync_context_report_error(ctx, OSYNC_ERROR_EXPECTED, "Triggering GET_DATA_ERROR error"); - return; - } - if (fs_get_error(fsinfo->member, "GET_DATA_TIMEOUT")) - return; -#endif - char *filename = g_strdup_printf("%s/%s", fsinfo->path, osync_change_get_uid(change)); OSyncError *error = NULL; if (!osync_file_read(filename, &file_info->data, &file_info->size, &error)) { @@ -394,15 +334,6 @@ osync_debug("FILE-SYNC", 3, "Writing change %s with changetype %i", osync_change_get_uid(change), osync_change_get_changetype(change)); filesyncinfo *fsinfo = (filesyncinfo *)osync_context_get_plugin_data(ctx); -#ifdef ERROR_TEST - if (fs_get_error(fsinfo->member, "COMMIT_ERROR")) { - osync_context_report_error(ctx, OSYNC_ERROR_EXPECTED, "Triggering COMMIT_ERROR error"); - return FALSE; - } - if (fs_get_error(fsinfo->member, "COMMIT_TIMEOUT")) - return FALSE; -#endif - if (!fs_access(ctx, change)) return FALSE; @@ -416,15 +347,6 @@ osync_debug("FILE-SYNC", 3, "start: %s", __func__); filesyncinfo *fsinfo = (filesyncinfo *)osync_context_get_plugin_data(ctx); -#ifdef ERROR_TEST - if (fs_get_error(fsinfo->member, "SYNC_DONE_ERROR")) { - osync_context_report_error(ctx, OSYNC_ERROR_EXPECTED, "Triggering SYNC_DONE_ERROR error"); - return; - } - if (fs_get_error(fsinfo->member, "SYNC_DONE_TIMEOUT")) - return; -#endif - //osync_hashtable_forget(fsinfo->hashtable); osync_anchor_update(fsinfo->member, "path", fsinfo->path); osync_context_report_success(ctx); @@ -436,15 +358,6 @@ osync_debug("FILE-SYNC", 3, "start: %s", __func__); filesyncinfo *fsinfo = (filesyncinfo *)osync_context_get_plugin_data(ctx); -#ifdef ERROR_TEST - if (fs_get_error(fsinfo->member, "DISCONNECT_ERROR")) { - osync_context_report_error(ctx, OSYNC_ERROR_EXPECTED, "Triggering DISCONNECT_ERROR error"); - return; - } - if (fs_get_error(fsinfo->member, "DISCONNECT_TIMEOUT")) - return; -#endif - g_dir_close(fsinfo->dir); osync_hashtable_close(fsinfo->hashtable); osync_context_report_success(ctx); @@ -465,31 +378,6 @@ g_free(fsinfo); } -#ifdef ERROR_TEST -static osync_bool fs_is_available(OSyncError **error) -{ - if (g_getenv("IS_NOT_AVAILABLE")) { - osync_error_set(error, OSYNC_ERROR_GENERIC, "file-sync plugin is not available"); - return FALSE; - } - return TRUE; -} - -static void fs_batch_commit(void *data, OSyncContext **contexts, OSyncChange **changes) -{ - filesyncinfo *env = (filesyncinfo *)data; - osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, env, contexts, changes); - osync_trace(TRACE_EXIT, "%s", __func__); -} - -static void fs_committed_all(void *data) -{ - filesyncinfo *env = (filesyncinfo *)data; - osync_trace(TRACE_ENTRY, "%s(%p)", __func__, env); - osync_trace(TRACE_EXIT, "%s", __func__); -} -#endif - void get_info(OSyncPluginInfo *info) { info->name = "file-sync"; @@ -512,24 +400,4 @@ osync_plugin_set_access_objformat(info, "data", "file", fs_access); osync_plugin_set_read_objformat(info, "data", "file", fs_read); -#ifdef ERROR_TEST - //Lets reduce the timeouts a bit so the checks work faster - info->timeouts.disconnect_timeout = 5; - info->timeouts.connect_timeout = 5; - info->timeouts.sync_done_timeout = 5; - info->timeouts.get_changeinfo_timeout = 5; - info->timeouts.get_data_timeout = 5; - info->timeouts.commit_timeout = 5; - - if (g_getenv("IS_AVAILABLE")) - info->functions.is_available = fs_is_available; - - if (g_getenv("BATCH_COMMIT1")) - osync_plugin_set_batch_commit_objformat(info, "data", "file", fs_batch_commit); - - if (g_getenv("BATCH_COMMIT2")) - osync_plugin_set_committed_all_objformat(info, "data", "file", fs_committed_all); -#endif - - } Modified: trunk/tests/Makefile.am =================================================================== --- trunk/tests/Makefile.am 2005-03-22 16:20:29 UTC (rev 394) +++ trunk/tests/Makefile.am 2005-03-22 16:26:20 UTC (rev 395) @@ -85,3 +85,7 @@ clean: rm -rf coverage/* + $(MAKE) clean -C mock-plugin + +all-local: + $(MAKE) -C mock-plugin Modified: trunk/tests/check_codes.c =================================================================== --- trunk/tests/check_codes.c 2005-03-22 16:20:29 UTC (rev 394) +++ trunk/tests/check_codes.c 2005-03-22 16:26:20 UTC (rev 395) @@ -6,9 +6,7 @@ g_setenv("INIT_NULL", "2", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -38,9 +36,7 @@ g_setenv("CONNECT_ERROR", "3", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -75,9 +71,7 @@ g_setenv("CONNECT_ERROR", "1", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -113,9 +107,7 @@ g_setenv("CONNECT_ERROR", "5", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -151,9 +143,7 @@ g_setenv("CONNECT_ERROR", "6", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -189,9 +179,7 @@ g_setenv("CONNECT_ERROR", "7", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -227,9 +215,7 @@ g_setenv("CONNECT_ERROR", "2", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -265,9 +251,7 @@ g_setenv("CONNECT_ERROR", "0", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -304,9 +288,7 @@ g_setenv("CONNECT_TIMEOUT", "2", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -343,9 +325,7 @@ g_setenv("CONNECT_TIMEOUT", "3", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -382,9 +362,7 @@ g_setenv("CONNECT_TIMEOUT", "2", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -422,9 +400,7 @@ g_setenv("CONNECT_TIMEOUT", "2", TRUE); g_setenv("CONNECT_ERROR", "4", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -461,9 +437,7 @@ g_setenv("GET_CHANGES_ERROR", "2", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -502,9 +476,7 @@ g_setenv("GET_CHANGES_ERROR", "3", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -544,9 +516,7 @@ g_setenv("GET_CHANGES_ERROR", "5", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -584,9 +554,7 @@ g_setenv("GET_CHANGES_ERROR", "1", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -625,9 +593,7 @@ g_setenv("GET_CHANGES_TIMEOUT", "1", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -669,9 +635,7 @@ g_setenv("GET_CHANGES_TIMEOUT", "3", TRUE); g_setenv("GET_CHANGES_ERROR", "4", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -711,9 +675,7 @@ g_setenv("GET_CHANGES_TIMEOUT2", "7", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -756,9 +718,7 @@ g_setenv("COMMIT_ERROR", "4", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -805,9 +765,7 @@ g_setenv("COMMIT_ERROR", "6", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -854,9 +812,7 @@ g_setenv("COMMIT_TIMEOUT", "4", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -903,9 +859,7 @@ g_setenv("COMMIT_TIMEOUT", "6", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -953,9 +907,7 @@ g_setenv("COMMIT_TIMEOUT", "4", TRUE); g_setenv("COMMIT_ERROR", "2", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -1003,9 +955,7 @@ g_setenv("COMMIT_TIMEOUT", "2", TRUE); g_setenv("COMMIT_ERROR", "4", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -1050,9 +1000,7 @@ { char *testbed = setup_testbed("multisync_easy_new"); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -1108,9 +1056,7 @@ { char *testbed = setup_testbed("multisync_easy_new"); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -1168,9 +1114,7 @@ g_setenv("SYNC_DONE_ERROR", "4", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -1218,9 +1162,7 @@ g_setenv("SYNC_DONE_ERROR", "6", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -1268,9 +1210,7 @@ g_setenv("SYNC_DONE_ERROR", "7", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -1318,9 +1258,7 @@ g_setenv("SYNC_DONE_TIMEOUT", "4", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -1368,9 +1306,7 @@ g_setenv("SYNC_DONE_TIMEOUT", "6", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -1419,9 +1355,7 @@ g_setenv("SYNC_DONE_TIMEOUT", "5", TRUE); g_setenv("SYNC_DONE_ERROR", "2", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -1469,9 +1403,7 @@ g_setenv("DISCONNECT_ERROR", "4", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -1520,9 +1452,7 @@ g_setenv("DISCONNECT_ERROR", "6", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -1571,9 +1501,7 @@ g_setenv("DISCONNECT_ERROR", "7", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -1622,9 +1550,7 @@ g_setenv("DISCONNECT_TIMEOUT", "4", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -1673,9 +1599,7 @@ g_setenv("DISCONNECT_TIMEOUT", "6", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -1725,9 +1649,7 @@ g_setenv("DISCONNECT_TIMEOUT", "5", TRUE); g_setenv("DISCONNECT_ERROR", "2", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -1778,9 +1700,7 @@ g_setenv("DISCONNECT_ERROR", "2", TRUE); g_setenv("GET_CHANGES_TIMEOUT", "6", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; Modified: trunk/tests/check_env.c =================================================================== --- trunk/tests/check_env.c 2005-03-22 16:20:29 UTC (rev 394) +++ trunk/tests/check_env.c 2005-03-22 16:26:20 UTC (rev 395) @@ -108,6 +108,7 @@ START_TEST (env_check_plugin_true1) { + char *testbed = setup_testbed(NULL); OSyncEnv *env = init_env(); OSyncError *error = NULL; @@ -115,11 +116,13 @@ fail_unless(!osync_error_is_set(&error), NULL); osync_env_free(env); + destroy_testbed(testbed); } END_TEST START_TEST (env_check_plugin_true2) { + char *testbed = setup_testbed(NULL); g_setenv("IS_AVAILABLE", "1", TRUE); OSyncEnv *env = init_env(); @@ -130,11 +133,13 @@ fail_unless(!osync_error_is_set(&error), NULL); osync_env_free(env); + destroy_testbed(testbed); } END_TEST START_TEST (env_check_plugin_false) { + char *testbed = setup_testbed(NULL); OSyncEnv *env = init_env(); OSyncError *error = NULL; @@ -142,11 +147,13 @@ fail_unless(osync_error_is_set(&error), NULL); osync_env_free(env); + destroy_testbed(testbed); } END_TEST START_TEST (env_check_plugin_false2) { + char *testbed = setup_testbed(NULL); g_setenv("IS_AVAILABLE", "1", TRUE); g_setenv("IS_NOT_AVAILABLE", "1", TRUE); @@ -158,6 +165,7 @@ fail_unless(osync_error_is_set(&error), NULL); osync_env_free(env); + destroy_testbed(testbed); } END_TEST Modified: trunk/tests/check_filter.c =================================================================== --- trunk/tests/check_filter.c 2005-03-22 16:20:29 UTC (rev 394) +++ trunk/tests/check_filter.c 2005-03-22 16:26:20 UTC (rev 395) @@ -3,9 +3,8 @@ START_TEST (filter_setup) { char *testbed = setup_testbed("filter_setup"); - OSyncEnv *osync = osync_env_new(); - osync_env_initialize(osync, NULL); - mark_point(); + OSyncEnv *osync = init_env(); + OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); fail_unless(group != NULL, NULL); mark_point(); @@ -32,9 +31,7 @@ START_TEST (filter_flush) { char *testbed = setup_testbed("filter_setup"); - OSyncEnv *osync = osync_env_new(); - osync_env_initialize(osync, NULL); - mark_point(); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); fail_unless(group != NULL, NULL); mark_point(); @@ -63,9 +60,7 @@ START_TEST (filter_sync_deny_all) { char *testbed = setup_testbed("filter_sync_deny_all"); - OSyncEnv *osync = osync_env_new(); - osync_env_initialize(osync, NULL); - mark_point(); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); fail_unless(group != NULL, NULL); mark_point(); @@ -94,9 +89,7 @@ START_TEST (filter_sync_custom) { char *testbed = setup_testbed("filter_sync_custom"); - OSyncEnv *osync = osync_env_new(); - osync_env_initialize(osync, NULL); - mark_point(); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); fail_unless(group != NULL, NULL); mark_point(); @@ -199,9 +192,7 @@ START_TEST (filter_sync_vcard_only) { char *testbed = setup_testbed("filter_sync_vcard_only"); - OSyncEnv *osync = osync_env_new(); - osync_env_initialize(osync, NULL); - mark_point(); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); fail_unless(group != NULL, NULL); mark_point(); @@ -239,9 +230,7 @@ /* Check if the destobjtype of the changes is being * set when the change type os DELETE */ char *testbed = setup_testbed("destobjtype_delete"); - OSyncEnv *osync = osync_env_new(); - osync_env_initialize(osync, NULL); - mark_point(); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); fail_unless(group != NULL, NULL); mark_point(); Modified: trunk/tests/check_multisync.c =================================================================== --- trunk/tests/check_multisync.c 2005-03-22 16:20:29 UTC (rev 394) +++ trunk/tests/check_multisync.c 2005-03-22 16:26:20 UTC (rev 395) @@ -28,9 +28,9 @@ fail_unless(num_engine_end_conflicts = 1, NULL); OSyncMappingTable *maptable = mappingtable_load(group, 1, 0); - check_mapping(maptable, 1, 0, 3, "testdata", "file", "data"); - check_mapping(maptable, 2, 0, 3, "testdata", "file", "data"); - check_mapping(maptable, 3, 0, 3, "testdata", "file", "data"); + check_mapping(maptable, 1, 0, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, 0, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 3, 0, 3, "testdata", "mockformat", "data"); mappingtable_close(maptable); OSyncHashTable *table = hashtable_load(group, 1, 1); @@ -88,9 +88,9 @@ fail_unless(num_read == 1, NULL); OSyncMappingTable *maptable = mappingtable_load(group, 1, 0); - check_mapping(maptable, 1, 0, 3, "testdata", "file", "data"); - check_mapping(maptable, 2, 0, 3, "testdata", "file", "data"); - check_mapping(maptable, 3, 0, 3, "testdata", "file", "data"); + check_mapping(maptable, 1, 0, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, 0, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 3, 0, 3, "testdata", "mockformat", "data"); mappingtable_close(maptable); OSyncHashTable *table = hashtable_load(group, 1, 1); @@ -150,9 +150,9 @@ fail_unless(num_engine_end_conflicts = 1, NULL); OSyncMappingTable *maptable = mappingtable_load(group, 1, 0); - check_mapping(maptable, 1, 0, 3, "testdata", "file", "data"); - check_mapping(maptable, 2, 0, 3, "testdata", "file", "data"); - check_mapping(maptable, 3, 0, 3, "testdata", "file", "data"); + check_mapping(maptable, 1, 0, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, 0, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 3, 0, 3, "testdata", "mockformat", "data"); mappingtable_close(maptable); OSyncHashTable *table = hashtable_load(group, 1, 1); @@ -212,9 +212,9 @@ fail_unless(num_engine_end_conflicts = 1, NULL); OSyncMappingTable *maptable = mappingtable_load(group, 1, 0); - check_mapping(maptable, 1, 0, 3, "testdata", "file", "data"); - check_mapping(maptable, 2, 0, 3, "testdata", "file", "data"); - check_mapping(maptable, 3, 0, 3, "testdata", "file", "data"); + check_mapping(maptable, 1, 0, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, 0, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 3, 0, 3, "testdata", "mockformat", "data"); mappingtable_close(maptable); OSyncHashTable *table = hashtable_load(group, 1, 1); @@ -257,9 +257,9 @@ fail_unless(!system("test \"x$(diff -x \".*\" data1 data3)\" = \"x\""), NULL); OSyncMappingTable *maptable = mappingtable_load(group, 1, 0); - check_mapping(maptable, 1, 0, 3, "testdata", "file", "data"); - check_mapping(maptable, 2, 0, 3, "testdata", "file", "data"); - check_mapping(maptable, 3, 0, 3, "testdata", "file", "data"); + check_mapping(maptable, 1, 0, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, 0, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 3, 0, 3, "testdata", "mockformat", "data"); mappingtable_close(maptable); OSyncHashTable *table = hashtable_load(group, 1, 1); @@ -326,9 +326,9 @@ fail_unless(!system("test \"x$(diff -x \".*\" data1 data3)\" = \"x\""), NULL); OSyncMappingTable *maptable = mappingtable_load(group, 1, 0); - check_mapping(maptable, 1, 0, 3, "testdata", "file", "data"); - check_mapping(maptable, 2, 0, 3, "testdata", "file", "data"); - check_mapping(maptable, 3, 0, 3, "testdata", "file", "data"); + check_mapping(maptable, 1, 0, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, 0, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 3, 0, 3, "testdata", "mockformat", "data"); mappingtable_close(maptable); OSyncHashTable *table = hashtable_load(group, 1, 1); @@ -536,9 +536,9 @@ fail_unless(!system("test \"x$(diff -x \".*\" data1 data3)\" = \"x\""), NULL); OSyncMappingTable *maptable = mappingtable_load(group, 1, 0); - check_mapping(maptable, 1, 0, 3, "testdata", "file", "data"); - check_mapping(maptable, 2, 0, 3, "testdata", "file", "data"); - check_mapping(maptable, 3, 0, 3, "testdata", "file", "data"); + check_mapping(maptable, 1, 0, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, 0, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 3, 0, 3, "testdata", "mockformat", "data"); mappingtable_close(maptable); OSyncHashTable *table = hashtable_load(group, 1, 1); @@ -609,9 +609,9 @@ fail_unless(!system("test \"x$(diff -x \".*\" data1 data3)\" = \"x\""), NULL); OSyncMappingTable *maptable = mappingtable_load(group, 1, 0); - check_mapping(maptable, 1, 0, 3, "testdata", "file", "data"); - check_mapping(maptable, 2, 0, 3, "testdata", "file", "data"); - check_mapping(maptable, 3, 0, 3, "testdata", "file", "data"); + check_mapping(maptable, 1, 0, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, 0, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 3, 0, 3, "testdata", "mockformat", "data"); mappingtable_close(maptable); OSyncHashTable *table = hashtable_load(group, 1, 1); @@ -688,9 +688,9 @@ fail_unless(!system("test \"x$(diff -x \".*\" data1 data3)\" = \"x\""), NULL); OSyncMappingTable *maptable = mappingtable_load(group, 1, 0); - check_mapping(maptable, 1, 0, 3, "testdata", "file", "data"); - check_mapping(maptable, 2, 0, 3, "testdata", "file", "data"); - check_mapping(maptable, 3, 0, 3, "testdata", "file", "data"); + check_mapping(maptable, 1, 0, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, 0, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 3, 0, 3, "testdata", "mockformat", "data"); mappingtable_close(maptable); OSyncHashTable *table = hashtable_load(group, 1, 1); @@ -818,9 +818,9 @@ fail_unless(!system("test \"x$(diff -x \".*\" data1 data3)\" = \"x\""), NULL); OSyncMappingTable *maptable = mappingtable_load(group, 1, 0); - check_mapping(maptable, 1, 0, 3, "testdata", "file", "data"); - check_mapping(maptable, 2, 0, 3, "testdata", "file", "data"); - check_mapping(maptable, 3, 0, 3, "testdata", "file", "data"); + check_mapping(maptable, 1, 0, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, 0, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 3, 0, 3, "testdata", "mockformat", "data"); mappingtable_close(maptable); OSyncHashTable *table = hashtable_load(group, 1, 1); @@ -942,12 +942,12 @@ fail_unless(!system("test \"x$(diff -x \".*\" data1 data3)\" = \"x\""), NULL); OSyncMappingTable *maptable = mappingtable_load(group, 2, 0); - check_mapping(maptable, 1, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 1, -1, 3, "testdata-dupe", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata-dupe", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata-dupe", "file", "data"); + check_mapping(maptable, 1, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 1, -1, 3, "testdata-dupe", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata-dupe", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata-dupe", "mockformat", "data"); mappingtable_close(maptable); OSyncHashTable *table = hashtable_load(group, 1, 2); @@ -970,9 +970,9 @@ synchronize_once(engine, NULL); maptable = mappingtable_load(group, 1, 0); - check_mapping(maptable, 1, 0, 3, "testdata-dupe", "file", "data"); - check_mapping(maptable, 2, 0, 3, "testdata-dupe", "file", "data"); - check_mapping(maptable, 3, 0, 3, "testdata-dupe", "file", "data"); + check_mapping(maptable, 1, 0, 3, "testdata-dupe", "mockformat", "data"); + check_mapping(maptable, 2, 0, 3, "testdata-dupe", "mockformat", "data"); + check_mapping(maptable, 3, 0, 3, "testdata-dupe", "mockformat", "data"); mappingtable_close(maptable); table = hashtable_load(group, 1, 1); @@ -1043,15 +1043,15 @@ fail_unless(!system("test \"x$(diff -x \".*\" data1 data3)\" = \"x\""), NULL); OSyncMappingTable *maptable = mappingtable_load(group, 3, 0); - check_mapping(maptable, 1, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 1, -1, 3, "testdata-dupe", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata-dupe", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata-dupe", "file", "data"); - check_mapping(maptable, 1, -1, 3, "testdata-dupe-dupe", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata-dupe-dupe", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata-dupe-dupe", "file", "data"); + check_mapping(maptable, 1, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 1, -1, 3, "testdata-dupe", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata-dupe", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata-dupe", "mockformat", "data"); + check_mapping(maptable, 1, -1, 3, "testdata-dupe-dupe", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata-dupe-dupe", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata-dupe-dupe", "mockformat", "data"); mappingtable_close(maptable); OSyncHashTable *table = hashtable_load(group, 1, 3); @@ -1077,9 +1077,9 @@ synchronize_once(engine, NULL); maptable = mappingtable_load(group, 1, 0); - check_mapping(maptable, 1, 0, 3, "testdata-dupe", "file", "data"); - check_mapping(maptable, 2, 0, 3, "testdata-dupe", "file", "data"); - check_mapping(maptable, 3, 0, 3, "testdata-dupe", "file", "data"); + check_mapping(maptable, 1, 0, 3, "testdata-dupe", "mockformat", "data"); + check_mapping(maptable, 2, 0, 3, "testdata-dupe", "mockformat", "data"); + check_mapping(maptable, 3, 0, 3, "testdata-dupe", "mockformat", "data"); mappingtable_close(maptable); table = hashtable_load(group, 1, 1); @@ -1155,9 +1155,9 @@ fail_unless(!system("test \"x$(diff -x \".*\" data1 data3)\" = \"x\""), NULL); OSyncMappingTable *maptable = mappingtable_load(group, 1, 0); - check_mapping(maptable, 1, 0, 3, "testdata", "file", "data"); - check_mapping(maptable, 2, 0, 3, "testdata", "file", "data"); - check_mapping(maptable, 3, 0, 3, "testdata", "file", "data"); + check_mapping(maptable, 1, 0, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, 0, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 3, 0, 3, "testdata", "mockformat", "data"); mappingtable_close(maptable); OSyncHashTable *table = hashtable_load(group, 1, 1); @@ -1235,9 +1235,9 @@ fail_unless(!system("test \"x$(diff -x \".*\" data1 data3)\" = \"x\""), NULL); OSyncMappingTable *maptable = mappingtable_load(group, 1, 0); - check_mapping(maptable, 1, 0, 3, "testdata", "file", "data"); - check_mapping(maptable, 2, 0, 3, "testdata", "file", "data"); - check_mapping(maptable, 3, 0, 3, "testdata", "file", "data"); + check_mapping(maptable, 1, 0, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, 0, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 3, 0, 3, "testdata", "mockformat", "data"); mappingtable_close(maptable); OSyncHashTable *table = hashtable_load(group, 1, 1); @@ -1314,12 +1314,12 @@ fail_unless(!system("test \"x$(diff -x \".*\" data1 data3)\" = \"x\""), NULL); OSyncMappingTable *maptable = mappingtable_load(group, 2, 0); - check_mapping(maptable, 1, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 1, -1, 3, "testdata-dupe", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata-dupe", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata-dupe", "file", "data"); + check_mapping(maptable, 1, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 1, -1, 3, "testdata-dupe", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata-dupe", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata-dupe", "mockformat", "data"); mappingtable_close(maptable); OSyncHashTable *table = hashtable_load(group, 1, 2); @@ -1386,15 +1386,15 @@ fail_unless(!system("test \"x$(diff -x \".*\" data1 data3)\" = \"x\""), NULL); OSyncMappingTable *maptable = mappingtable_load(group, 3, 0); - check_mapping(maptable, 1, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 1, -1, 3, "testdata1", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata1", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata1", "file", "data"); - check_mapping(maptable, 1, -1, 3, "testdata2", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata2", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata2", "file", "data"); + check_mapping(maptable, 1, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 1, -1, 3, "testdata1", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata1", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata1", "mockformat", "data"); + check_mapping(maptable, 1, -1, 3, "testdata2", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata2", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata2", "mockformat", "data"); mappingtable_close(maptable); OSyncHashTable *table = hashtable_load(group, 1, 3); @@ -1443,21 +1443,21 @@ fail_unless(!system("test \"x$(diff -x \".*\" data1 data3)\" = \"x\""), NULL); maptable = mappingtable_load(group, 5, 0); - check_mapping(maptable, 1, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 1, -1, 3, "testdata1", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata1", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata1", "file", "data"); - check_mapping(maptable, 1, -1, 3, "testdata1-dupe", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata1-dupe", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata1-dupe", "file", "data"); - check_mapping(maptable, 1, -1, 3, "testdata2", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata2", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata2", "file", "data"); - check_mapping(maptable, 1, -1, 3, "testdata2-dupe", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata2-dupe", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata2-dupe", "file", "data"); + check_mapping(maptable, 1, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 1, -1, 3, "testdata1", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata1", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata1", "mockformat", "data"); + check_mapping(maptable, 1, -1, 3, "testdata1-dupe", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata1-dupe", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata1-dupe", "mockformat", "data"); + check_mapping(maptable, 1, -1, 3, "testdata2", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata2", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata2", "mockformat", "data"); + check_mapping(maptable, 1, -1, 3, "testdata2-dupe", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata2-dupe", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata2-dupe", "mockformat", "data"); mappingtable_close(maptable); table = hashtable_load(group, 1, 5); @@ -1533,15 +1533,15 @@ fail_unless(!system("test \"x$(diff -x \".*\" data1 data3)\" = \"x\""), NULL); OSyncMappingTable *maptable = mappingtable_load(group, 3, 0); - check_mapping(maptable, 1, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 1, -1, 3, "testdata1", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata1", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata1", "file", "data"); - check_mapping(maptable, 1, -1, 3, "testdata2", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata2", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata2", "file", "data"); + check_mapping(maptable, 1, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 1, -1, 3, "testdata1", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata1", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata1", "mockformat", "data"); + check_mapping(maptable, 1, -1, 3, "testdata2", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata2", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata2", "mockformat", "data"); mappingtable_close(maptable); OSyncHashTable *table = hashtable_load(group, 1, 3); @@ -1590,15 +1590,15 @@ fail_unless(!system("test \"x$(diff -x \".*\" data1 data3)\" = \"x\""), NULL); maptable = mappingtable_load(group, 3, 0); - check_mapping(maptable, 1, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 1, -1, 3, "testdata1", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata1", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata1", "file", "data"); - check_mapping(maptable, 1, -1, 3, "testdata2", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata2", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata2", "file", "data"); + check_mapping(maptable, 1, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 1, -1, 3, "testdata1", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata1", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata1", "mockformat", "data"); + check_mapping(maptable, 1, -1, 3, "testdata2", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata2", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata2", "mockformat", "data"); mappingtable_close(maptable); table = hashtable_load(group, 1, 3); @@ -1667,12 +1667,12 @@ fail_unless(!system("test \"x$(diff -x \".*\" data1 data3)\" = \"x\""), NULL); OSyncMappingTable *maptable = mappingtable_load(group, 2, 0); - check_mapping(maptable, 1, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 1, -1, 3, "testdata1", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata1", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata1", "file", "data"); + check_mapping(maptable, 1, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 1, -1, 3, "testdata1", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata1", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata1", "mockformat", "data"); mappingtable_close(maptable); OSyncHashTable *table = hashtable_load(group, 1, 2); @@ -1718,12 +1718,12 @@ fail_unless(!system("test \"x$(diff -x \".*\" data1 data3)\" != \"x\""), NULL); maptable = mappingtable_load(group, 2, 0); - check_mapping(maptable, 1, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 1, -1, 3, "testdata1", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata1", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata1", "file", "data"); + check_mapping(maptable, 1, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 1, -1, 3, "testdata1", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata1", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata1", "mockformat", "data"); mappingtable_close(maptable); table = hashtable_load(group, 1, 2); @@ -1751,12 +1751,12 @@ fail_unless(!system("test \"x$(diff -x \".*\" data1 data3)\" != \"x\""), NULL); maptable = mappingtable_load(group, 2, 0); - check_mapping(maptable, 1, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 1, -1, 3, "testdata1", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata1", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata1", "file", "data"); + check_mapping(maptable, 1, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 1, -1, 3, "testdata1", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata1", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata1", "mockformat", "data"); mappingtable_close(maptable); table = hashtable_load(group, 1, 2); @@ -1786,12 +1786,12 @@ fail_unless(!system("test \"x$(diff -x \".*\" data1 data3)\" = \"x\""), NULL); maptable = mappingtable_load(group, 2, 0); - check_mapping(maptable, 1, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 1, -1, 3, "testdata1", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata1", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata1", "file", "data"); + check_mapping(maptable, 1, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 1, -1, 3, "testdata1", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata1", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata1", "mockformat", "data"); mappingtable_close(maptable); table = hashtable_load(group, 1, 2); @@ -1860,11 +1860,11 @@ fail_unless(!system("test \"x$(diff -x \".*\" data1 data3)\" != \"x\""), NULL); OSyncMappingTable *maptable = mappingtable_load(group, 2, 0); - check_mapping(maptable, 1, -1, 2, "testdata", "file", "data"); - check_mapping(maptable, 3, -1, 2, "testdata", "file", "data"); - check_mapping(maptable, 1, -1, 3, "testdata1", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata1", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata1", "file", "data"); + check_mapping(maptable, 1, -1, 2, "testdata", "mockformat", "data"); + check_mapping(maptable, 3, -1, 2, "testdata", "mockformat", "data"); + check_mapping(maptable, 1, -1, 3, "testdata1", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata1", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata1", "mockformat", "data"); mappingtable_close(maptable); OSyncHashTable *table = hashtable_load(group, 1, 2); @@ -1894,12 +1894,12 @@ fail_unless(!system("test \"x$(diff -x \".*\" data1 data3)\" = \"x\""), NULL); maptable = mappingtable_load(group, 2, 0); - check_mapping(maptable, 1, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 1, -1, 3, "testdata1", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata1", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata1", "file", "data"); + check_mapping(maptable, 1, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 1, -1, 3, "testdata1", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata1", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata1", "mockformat", "data"); mappingtable_close(maptable); table = hashtable_load(group, 1, 2); Modified: trunk/tests/check_sync.c =================================================================== --- trunk/tests/check_sync.c 2005-03-22 16:20:29 UTC (rev 394) +++ trunk/tests/check_sync.c 2005-03-22 16:26:20 UTC (rev 395) @@ -32,8 +32,9 @@ OSyncEngine *engine = osync_engine_new(group, NULL); osync_engine_set_memberstatus_callback(engine, member_status, NULL); - osync_engine_init(engine, NULL); - synchronize_once(engine, NULL); + OSyncError *error = NULL; + osync_engine_init(engine, &error); + synchronize_once(engine, &error); osync_engine_finalize(engine); osync_engine_free(engine); @@ -84,8 +85,8 @@ fail_unless(!system("test \"x$(diff -x \".*\" data1 data2)\" = \"x\""), NULL); OSyncMappingTable *maptable = mappingtable_load(group, 1, 0); - check_mapping(maptable, 1, 0, 2, "testdata", "file", "data"); - check_mapping(maptable, 2, 0, 2, "testdata", "file", "data"); + check_mapping(maptable, 1, 0, 2, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, 0, 2, "testdata", "mockformat", "data"); mappingtable_close(maptable); OSyncHashTable *table = hashtable_load(group, 1, 1); check_hash(table, "testdata"); @@ -191,8 +192,8 @@ fail_unless(num_written == 0, NULL); OSyncMappingTable *maptable = mappingtable_load(group, 1, 0); - check_mapping(maptable, 1, 0, 2, "testdata", "file", "data"); - check_mapping(maptable, 2, 0, 2, "testdata", "file", "data"); + check_mapping(maptable, 1, 0, 2, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, 0, 2, "testdata", "mockformat", "data"); mappingtable_close(maptable); OSyncHashTable *table = hashtable_load(group, 1, 1); @@ -226,10 +227,10 @@ fail_unless(!system("test \"x$(diff -x \".*\" data1 data2)\" = \"x\""), NULL); OSyncMappingTable *maptable = mappingtable_load(group, 2, 0); - check_mapping(maptable, 1, -1, 2, "testdata", "file", "data"); - check_mapping(maptable, 1, -1, 2, "testdata-dupe", "file", "data"); - check_mapping(maptable, 2, -1, 2, "testdata", "file", "data"); - check_mapping(maptable, 1, -1, 2, "testdata-dupe", "file", "data"); + check_mapping(maptable, 1, -1, 2, "testdata", "mockformat", "data"); + check_mapping(maptable, 1, -1, 2, "testdata-dupe", "mockformat", "data"); + check_mapping(maptable, 2, -1, 2, "testdata", "mockformat", "data"); + check_mapping(maptable, 1, -1, 2, "testdata-dupe", "mockformat", "data"); mappingtable_close(maptable); OSyncHashTable *table = hashtable_load(group, 1, 2); @@ -253,8 +254,8 @@ fail_unless(num_conflicts == 0, NULL); maptable = mappingtable_load(group, 1, 0); - check_mapping(maptable, 1, 0, 2, "testdata", "file", "data"); - check_mapping(maptable, 2, 0, 2, "testdata", "file", "data"); + check_mapping(maptable, 1, 0, 2, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, 0, 2, "testdata", "mockformat", "data"); mappingtable_close(maptable); table = hashtable_load(group, 1, 1); @@ -287,12 +288,12 @@ fail_unless(!system("test \"x$(diff -x \".*\" data1 data2)\" = \"x\""), NULL); OSyncMappingTable *maptable = mappingtable_load(group, 3, 0); - check_mapping(maptable, 1, -1, 2, "testdata", "file", "data"); - check_mapping(maptable, 1, -1, 2, "testdata-dupe", "file", "data"); - check_mapping(maptable, 1, -1, 2, "testdata-dupe-dupe", "file", "data"); - check_mapping(maptable, 2, -1, 2, "testdata", "file", "data"); - check_mapping(maptable, 2, -1, 2, "testdata-dupe", "file", "data"); - check_mapping(maptable, 2, -1, 2, "testdata-dupe-dupe", "file", "data"); + check_mapping(maptable, 1, -1, 2, "testdata", "mockformat", "data"); + check_mapping(maptable, 1, -1, 2, "testdata-dupe", "mockformat", "data"); + check_mapping(maptable, 1, -1, 2, "testdata-dupe-dupe", "mockformat", "data"); + check_mapping(maptable, 2, -1, 2, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, -1, 2, "testdata-dupe", "mockformat", "data"); + check_mapping(maptable, 2, -1, 2, "testdata-dupe-dupe", "mockformat", "data"); mappingtable_close(maptable); OSyncHashTable *table = hashtable_load(group, 1, 3); @@ -315,8 +316,8 @@ fail_unless(num_conflicts == 0, NULL); maptable = mappingtable_load(group, 1, 0); - check_mapping(maptable, 1, 0, 2, "testdata", "file", "data"); - check_mapping(maptable, 2, 0, 2, "testdata", "file", "data"); + check_mapping(maptable, 1, 0, 2, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, 0, 2, "testdata", "mockformat", "data"); mappingtable_close(maptable); table = hashtable_load(group, 1, 1); @@ -359,8 +360,8 @@ fail_unless(num_conflicts == 1, NULL); OSyncMappingTable *maptable = mappingtable_load(group, 1, 0); - check_mapping(maptable, 1, 0, 2, "testdata", "file", "data"); - check_mapping(maptable, 2, 0, 2, "testdata", "file", "data"); + check_mapping(maptable, 1, 0, 2, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, 0, 2, "testdata", "mockformat", "data"); mappingtable_close(maptable); OSyncHashTable *table = hashtable_load(group, 1, 1); @@ -514,8 +515,7 @@ START_TEST (sync_easy_dualdel) { char *testbed = setup_testbed("sync_easy_dualdel"); - OSyncEnv *osync = osync_env_new(); - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -551,7 +551,8 @@ } END_TEST -START_TEST (sync_subdirs_new) +//This cannot work with the mock plugin +/*START_TEST (sync_subdirs_new) { char *testbed = setup_testbed("sync_subdirs_new"); OSyncEnv *osync = init_env(); @@ -576,14 +577,14 @@ fail_unless(!system("test \"x$(diff -x \".*\" -r data1 data2)\" = \"x\""), NULL); OSyncMappingTable *maptable = mappingtable_load(group, 3, 0); - check_mapping(maptable, 1, -1, 2, "testdata", "file", "data"); - check_mapping(maptable, 2, -1, 2, "testdata", "file", "data"); + check_mapping(maptable, 1, -1, 2, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, -1, 2, "testdata", "mockformat", "data"); - check_mapping(maptable, 1, -1, 2, "subdir/testdata", "file", "data"); - check_mapping(maptable, 2, -1, 2, "subdir/testdata", "file", "data"); + check_mapping(maptable, 1, -1, 2, "subdir/testdata", "mockformat", "data"); + check_mapping(maptable, 2, -1, 2, "subdir/testdata", "mockformat", "data"); - check_mapping(maptable, 1, -1, 2, "subdir/testdata1", "file", "data"); - check_mapping(maptable, 2, -1, 2, "subdir/testdata1", "file", "data"); + check_mapping(maptable, 1, -1, 2, "subdir/testdata1", "mockformat", "data"); + check_mapping(maptable, 2, -1, 2, "subdir/testdata1", "mockformat", "data"); mappingtable_close(maptable); @@ -625,7 +626,7 @@ destroy_testbed(testbed); } -END_TEST +END_TEST*/ Suite *env_suite(void) { @@ -646,7 +647,7 @@ create_case(s, "sync_moddel", sync_moddel); create_case(s, "sync_conflict_moddel", sync_conflict_moddel); create_case(s, "sync_conflict_duplicate", sync_conflict_duplicate); - create_case(s, "sync_subdirs_new", sync_subdirs_new); + //create_case(s, "sync_subdirs_new", sync_subdirs_new); return s; } Modified: trunk/tests/check_vcard.c =================================================================== --- trunk/tests/check_vcard.c 2005-03-22 16:20:29 UTC (rev 394) +++ trunk/tests/check_vcard.c 2005-03-22 16:26:20 UTC (rev 395) @@ -2,6 +2,12 @@ static void conv_vcard(const char *filename, const char *extension) { + ... [truncated message content] |
From: <svn...@op...> - 2005-03-22 16:19:44
|
Author: azrael Date: 2005-03-22 17:20:29 +0100 (Tue, 22 Mar 2005) New Revision: 394 Removed: branches/experimental-branch/misc/opensync.spec Modified: branches/experimental-branch/tests/Makefile.am branches/experimental-branch/tests/check_codes.c branches/experimental-branch/tests/mock-plugin/ Log: Removed the generated spec file from the repo Changed the way the mock-plugin is built so that it does not get installed but still is built as a shared library (stupid libtool!) Deleted: branches/experimental-branch/misc/opensync.spec Modified: branches/experimental-branch/tests/Makefile.am =================================================================== --- branches/experimental-branch/tests/Makefile.am 2005-03-22 14:30:03 UTC (rev 393) +++ branches/experimental-branch/tests/Makefile.am 2005-03-22 16:20:29 UTC (rev 394) @@ -1,7 +1,5 @@ ## Process this file with automake to produce Makefile.in -SUBDIRS = mock-plugin - EXTRA_DIST = data support.h AM_CFLAGS = @XML_CFLAGS@ -Wall -Werror @GCOV_CFLAGS@ @@ -87,3 +85,7 @@ clean: rm -rf coverage/* + $(MAKE) clean -C mock-plugin + +all-local: + $(MAKE) -C mock-plugin Modified: branches/experimental-branch/tests/check_codes.c =================================================================== --- branches/experimental-branch/tests/check_codes.c 2005-03-22 14:30:03 UTC (rev 393) +++ branches/experimental-branch/tests/check_codes.c 2005-03-22 16:20:29 UTC (rev 394) @@ -6,9 +6,7 @@ g_setenv("INIT_NULL", "2", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; Property changes on: branches/experimental-branch/tests/mock-plugin ___________________________________________________________________ Name: svn:ignore + Makefile.in .libs .deps Makefile |
From: <svn...@op...> - 2005-03-22 14:29:21
|
Author: azrael Date: 2005-03-22 15:30:03 +0100 (Tue, 22 Mar 2005) New Revision: 393 Modified: branches/experimental-branch/tests/check_codes.c branches/experimental-branch/tests/check_env.c branches/experimental-branch/tests/check_vcard.c branches/experimental-branch/tests/support.c Log: Finished the changes for the mock plugin. The tests can now be run without any plugin installed Modified: branches/experimental-branch/tests/check_codes.c =================================================================== --- branches/experimental-branch/tests/check_codes.c 2005-03-22 13:41:07 UTC (rev 392) +++ branches/experimental-branch/tests/check_codes.c 2005-03-22 14:30:03 UTC (rev 393) @@ -38,9 +38,7 @@ g_setenv("CONNECT_ERROR", "3", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -75,9 +73,7 @@ g_setenv("CONNECT_ERROR", "1", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -113,9 +109,7 @@ g_setenv("CONNECT_ERROR", "5", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -151,9 +145,7 @@ g_setenv("CONNECT_ERROR", "6", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -189,9 +181,7 @@ g_setenv("CONNECT_ERROR", "7", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -227,9 +217,7 @@ g_setenv("CONNECT_ERROR", "2", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -265,9 +253,7 @@ g_setenv("CONNECT_ERROR", "0", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -304,9 +290,7 @@ g_setenv("CONNECT_TIMEOUT", "2", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -343,9 +327,7 @@ g_setenv("CONNECT_TIMEOUT", "3", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -382,9 +364,7 @@ g_setenv("CONNECT_TIMEOUT", "2", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -422,9 +402,7 @@ g_setenv("CONNECT_TIMEOUT", "2", TRUE); g_setenv("CONNECT_ERROR", "4", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -461,9 +439,7 @@ g_setenv("GET_CHANGES_ERROR", "2", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -502,9 +478,7 @@ g_setenv("GET_CHANGES_ERROR", "3", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -544,9 +518,7 @@ g_setenv("GET_CHANGES_ERROR", "5", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -584,9 +556,7 @@ g_setenv("GET_CHANGES_ERROR", "1", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -625,9 +595,7 @@ g_setenv("GET_CHANGES_TIMEOUT", "1", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -669,9 +637,7 @@ g_setenv("GET_CHANGES_TIMEOUT", "3", TRUE); g_setenv("GET_CHANGES_ERROR", "4", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -711,9 +677,7 @@ g_setenv("GET_CHANGES_TIMEOUT2", "7", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -756,9 +720,7 @@ g_setenv("COMMIT_ERROR", "4", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -805,9 +767,7 @@ g_setenv("COMMIT_ERROR", "6", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -854,9 +814,7 @@ g_setenv("COMMIT_TIMEOUT", "4", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -903,9 +861,7 @@ g_setenv("COMMIT_TIMEOUT", "6", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -953,9 +909,7 @@ g_setenv("COMMIT_TIMEOUT", "4", TRUE); g_setenv("COMMIT_ERROR", "2", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -1003,9 +957,7 @@ g_setenv("COMMIT_TIMEOUT", "2", TRUE); g_setenv("COMMIT_ERROR", "4", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -1050,9 +1002,7 @@ { char *testbed = setup_testbed("multisync_easy_new"); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -1108,9 +1058,7 @@ { char *testbed = setup_testbed("multisync_easy_new"); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -1168,9 +1116,7 @@ g_setenv("SYNC_DONE_ERROR", "4", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -1218,9 +1164,7 @@ g_setenv("SYNC_DONE_ERROR", "6", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -1268,9 +1212,7 @@ g_setenv("SYNC_DONE_ERROR", "7", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -1318,9 +1260,7 @@ g_setenv("SYNC_DONE_TIMEOUT", "4", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -1368,9 +1308,7 @@ g_setenv("SYNC_DONE_TIMEOUT", "6", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -1419,9 +1357,7 @@ g_setenv("SYNC_DONE_TIMEOUT", "5", TRUE); g_setenv("SYNC_DONE_ERROR", "2", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -1469,9 +1405,7 @@ g_setenv("DISCONNECT_ERROR", "4", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -1520,9 +1454,7 @@ g_setenv("DISCONNECT_ERROR", "6", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -1571,9 +1503,7 @@ g_setenv("DISCONNECT_ERROR", "7", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -1622,9 +1552,7 @@ g_setenv("DISCONNECT_TIMEOUT", "4", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -1673,9 +1601,7 @@ g_setenv("DISCONNECT_TIMEOUT", "6", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -1725,9 +1651,7 @@ g_setenv("DISCONNECT_TIMEOUT", "5", TRUE); g_setenv("DISCONNECT_ERROR", "2", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -1778,9 +1702,7 @@ g_setenv("DISCONNECT_ERROR", "2", TRUE); g_setenv("GET_CHANGES_TIMEOUT", "6", TRUE); - OSyncEnv *osync = osync_env_new(); - - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; Modified: branches/experimental-branch/tests/check_env.c =================================================================== --- branches/experimental-branch/tests/check_env.c 2005-03-22 13:41:07 UTC (rev 392) +++ branches/experimental-branch/tests/check_env.c 2005-03-22 14:30:03 UTC (rev 393) @@ -112,7 +112,7 @@ OSyncEnv *env = init_env(); OSyncError *error = NULL; - fail_unless(osync_env_plugin_is_usable(env, "mock-sync", &error), NULL); + fail_unless(osync_env_plugin_is_usable(env, "file-sync", &error), NULL); fail_unless(!osync_error_is_set(&error), NULL); osync_env_free(env); @@ -129,7 +129,7 @@ OSyncError *error = NULL; - fail_unless(osync_env_plugin_is_usable(env, "mock-sync", &error), NULL); + fail_unless(osync_env_plugin_is_usable(env, "file-sync", &error), NULL); fail_unless(!osync_error_is_set(&error), NULL); osync_env_free(env); @@ -143,7 +143,7 @@ OSyncEnv *env = init_env(); OSyncError *error = NULL; - fail_unless(!osync_env_plugin_is_usable(env, "mock-syncc", &error), NULL); + fail_unless(!osync_env_plugin_is_usable(env, "file-syncc", &error), NULL); fail_unless(osync_error_is_set(&error), NULL); osync_env_free(env); @@ -161,7 +161,7 @@ OSyncError *error = NULL; - fail_unless(!osync_env_plugin_is_usable(env, "mock-sync", &error), NULL); + fail_unless(!osync_env_plugin_is_usable(env, "file-sync", &error), NULL); fail_unless(osync_error_is_set(&error), NULL); osync_env_free(env); Modified: branches/experimental-branch/tests/check_vcard.c =================================================================== --- branches/experimental-branch/tests/check_vcard.c 2005-03-22 13:41:07 UTC (rev 392) +++ branches/experimental-branch/tests/check_vcard.c 2005-03-22 14:30:03 UTC (rev 393) @@ -2,6 +2,12 @@ static void conv_vcard(const char *filename, const char *extension) { + char *command = g_strdup_printf("cp %s/%s .", g_get_current_dir(), filename); + char *testbed = setup_testbed(NULL); + system(command); + g_free(command); + + OSyncError *error = NULL; OSyncEnv *env = init_env(); @@ -11,10 +17,12 @@ char *buffer; int size; - fail_unless(osync_file_read(filename, &buffer, &size, &error), NULL); + char *file = g_path_get_basename(filename); + fail_unless(osync_file_read(file, &buffer, &size, &error), NULL); OSyncChange *change = osync_change_new(); - osync_change_set_uid(change, filename); + osync_change_set_uid(change, file); + g_free(file); osync_change_set_data(change, buffer, size + 1, TRUE); osync_change_set_conv_env(change, conv_env); @@ -52,10 +60,20 @@ osync_conv_env_free(conv_env); osync_env_finalize(env, NULL); osync_env_free(env); + + destroy_testbed(testbed); } -static void compare_vcard(const char *lfile, const char *rfile, OSyncConvCmpResult result) +static void compare_vcard(const char *lfilename, const char *rfilename, OSyncConvCmpResult result) { + char *command1 = g_strdup_printf("cp %s/%s lfile", g_get_current_dir(), lfilename); + char *command2 = g_strdup_printf("cp %s/%s rfile", g_get_current_dir(), rfilename); + char *testbed = setup_testbed(NULL); + system(command1); + g_free(command1); + system(command2); + g_free(command2); + OSyncError *error = NULL; OSyncEnv *env = init_env(); @@ -65,10 +83,10 @@ char *buffer; int size; - fail_unless(osync_file_read(lfile, &buffer, &size, &error), NULL); + fail_unless(osync_file_read("lfile", &buffer, &size, &error), NULL); OSyncChange *lchange = osync_change_new(); - osync_change_set_uid(lchange, lfile); + osync_change_set_uid(lchange, "lfile"); osync_change_set_data(lchange, buffer, size + 1, TRUE); osync_change_set_conv_env(lchange, conv_env); osync_change_set_objformat_string(lchange, "plain"); @@ -78,11 +96,10 @@ osync_change_set_objformat(lchange, sourceformat); osync_change_set_objtype(lchange, osync_objformat_get_objtype(sourceformat)); + fail_unless(osync_file_read("rfile", &buffer, &size, &error), NULL); - fail_unless(osync_file_read(rfile, &buffer, &size, &error), NULL); - OSyncChange *rchange = osync_change_new(); - osync_change_set_uid(rchange, lfile); + osync_change_set_uid(rchange, "rfile"); osync_change_set_data(rchange, buffer, size + 1, TRUE); osync_change_set_conv_env(rchange, conv_env); osync_change_set_objformat_string(rchange, "plain"); @@ -97,6 +114,7 @@ osync_conv_env_free(conv_env); osync_env_finalize(env, NULL); osync_env_free(env); + destroy_testbed(testbed); } START_TEST (conv_vcard_evolution2_full1) @@ -243,37 +261,37 @@ } END_TEST -START_TEST (comparvformat_mismatch1) +START_TEST (compare_vformat_mismatch1) { compare_vcard("data/vcards/evolution2/compare/1-different.vcf", "data/vcards/kdepim/compare/1-different.vcf", CONV_DATA_MISMATCH); } END_TEST -START_TEST (comparvformat_similar1) +START_TEST (compare_vformat_similar1) { compare_vcard("data/vcards/evolution2/compare/1-conflict.vcf", "data/vcards/kdepim/compare/1-conflict.vcf", CONV_DATA_SIMILAR); } END_TEST -START_TEST (comparvformat_mismatch2) +START_TEST (compare_vformat_mismatch2) { compare_vcard("data/vcards/evolution2/compare/2-conflict.vcf", "data/vcards/kdepim/compare/2-conflict.vcf", CONV_DATA_MISMATCH); } END_TEST -START_TEST (comparvformat_similar2) +START_TEST (compare_vformat_similar2) { compare_vcard("data/vcards/evolution2/compare/2-different.vcf", "data/vcards/kdepim/compare/2-different.vcf", CONV_DATA_SIMILAR); } END_TEST -START_TEST (comparvformat_same1) +START_TEST (compare_vformat_same1) { compare_vcard("data/vcards/evolution2/compare/1-same.vcf", "data/vcards/kdepim/compare/1-same.vcf", CONV_DATA_SAME); } END_TEST -START_TEST (comparvformat_same2) +START_TEST (compare_vformat_same2) { compare_vcard("data/vcards/evolution2/compare/2-same.vcf", "data/vcards/kdepim/compare/2-same.vcf", CONV_DATA_SAME); } @@ -311,12 +329,12 @@ create_case(s, "conv_vcard_kde_21_umlaute", conv_vcard_kde_21_umlaute); create_case(s, "conv_vcard_kde_30_umlaute", conv_vcard_kde_30_umlaute); - create_case(s, "comparvformat_mismatch1", comparvformat_mismatch1); - create_case(s, "comparvformat_mismatch2", comparvformat_mismatch2); - create_case(s, "comparvformat_similar1", comparvformat_similar1); - create_case(s, "comparvformat_similar2", comparvformat_similar2); - create_case(s, "comparvformat_same1", comparvformat_same1); - create_case(s, "comparvformat_same2", comparvformat_same2); + create_case(s, "compare_vformat_mismatch1", compare_vformat_mismatch1); + create_case(s, "compare_vformat_mismatch2", compare_vformat_mismatch2); + create_case(s, "compare_vformat_similar1", compare_vformat_similar1); + create_case(s, "compare_vformat_similar2", compare_vformat_similar2); + create_case(s, "compare_vformat_same1", compare_vformat_same1); + create_case(s, "compare_vformat_same2", compare_vformat_same2); return s; } Modified: branches/experimental-branch/tests/support.c =================================================================== --- branches/experimental-branch/tests/support.c 2005-03-22 13:41:07 UTC (rev 392) +++ branches/experimental-branch/tests/support.c 2005-03-22 14:30:03 UTC (rev 393) @@ -442,6 +442,8 @@ load_format(osync, "xml-vcal.so"); load_format(osync, "xml-vcard.so"); load_format(osync, "xml-vnote.so"); + load_format(osync, "xml-evolution.so"); + load_format(osync, "xml-kde.so"); load_format(osync, "mockformat.so"); return osync; |
From: <svn...@op...> - 2005-03-22 13:40:28
|
Author: azrael Date: 2005-03-22 14:41:07 +0100 (Tue, 22 Mar 2005) New Revision: 392 Modified: branches/experimental-branch/configure.in branches/experimental-branch/opensync/opensync_plugin.c branches/experimental-branch/tests/check_env.c branches/experimental-branch/tests/check_filter.c branches/experimental-branch/tests/check_multisync.c branches/experimental-branch/tests/check_sync.c branches/experimental-branch/tests/mock-plugin/Makefile.am branches/experimental-branch/tests/mock-plugin/mock_format.c branches/experimental-branch/tests/mock-plugin/mock_sync.c branches/experimental-branch/tests/support.c Log: Finished implemting the mock plugin Updated the tests to use the new plugin instead of the file-sync plugin Modified: branches/experimental-branch/configure.in =================================================================== --- branches/experimental-branch/configure.in 2005-03-21 23:38:39 UTC (rev 391) +++ branches/experimental-branch/configure.in 2005-03-22 13:41:07 UTC (rev 392) @@ -164,6 +164,7 @@ opensync/Makefile tools/Makefile tests/Makefile +tests/mock-plugin/Makefile formats/Makefile formats/vformats-xml/Makefile osengine/Makefile Modified: branches/experimental-branch/opensync/opensync_plugin.c =================================================================== --- branches/experimental-branch/opensync/opensync_plugin.c 2005-03-21 23:38:39 UTC (rev 391) +++ branches/experimental-branch/opensync/opensync_plugin.c 2005-03-22 13:41:07 UTC (rev 392) @@ -121,6 +121,7 @@ OSyncPlugin *osync_plugin_load(OSyncEnv *env, const char *path, OSyncError **error) { osync_trace(TRACE_ENTRY, "osync_plugin_load(%p, %s, %p)", env, path, error); + /* Check if this platform supports dynamic * loading of modules */ if (!g_module_supported()) { @@ -136,7 +137,6 @@ memset(&(plugin->info.functions), 0, sizeof(OSyncPluginFunctions)); if (!plugin->real_plugin) { - osync_debug("OSPLG", 0, "Unable to open plugin %s", path); osync_error_set(error, OSYNC_ERROR_GENERIC, "Unable to open plugin %s: %s", path, g_module_error()); osync_plugin_free(plugin); osync_trace(TRACE_EXIT_ERROR, "osync_plugin_load: %s", osync_error_print(error)); @@ -186,7 +186,7 @@ osync_trace(TRACE_ENTRY, "osync_format_plugin_load(%p, %s, %p)", env, path, error); /* Check if this platform supports dynamic * loading of modules */ - osync_debug("OSFRM", 3, "Loading formats plugin from %s", path); + if (!g_module_supported()) { osync_error_set(error, OSYNC_ERROR_GENERIC, "This platform does not support loading of modules"); osync_debug("OSPLG", 0, "This platform does not support loading of modules"); Modified: branches/experimental-branch/tests/check_env.c =================================================================== --- branches/experimental-branch/tests/check_env.c 2005-03-21 23:38:39 UTC (rev 391) +++ branches/experimental-branch/tests/check_env.c 2005-03-22 13:41:07 UTC (rev 392) @@ -108,45 +108,52 @@ START_TEST (env_check_plugin_true1) { + char *testbed = setup_testbed(NULL); OSyncEnv *env = init_env(); OSyncError *error = NULL; - fail_unless(osync_env_plugin_is_usable(env, "file-sync", &error), NULL); + fail_unless(osync_env_plugin_is_usable(env, "mock-sync", &error), NULL); fail_unless(!osync_error_is_set(&error), NULL); osync_env_free(env); + destroy_testbed(testbed); } END_TEST START_TEST (env_check_plugin_true2) { + char *testbed = setup_testbed(NULL); g_setenv("IS_AVAILABLE", "1", TRUE); OSyncEnv *env = init_env(); OSyncError *error = NULL; - fail_unless(osync_env_plugin_is_usable(env, "file-sync", &error), NULL); + fail_unless(osync_env_plugin_is_usable(env, "mock-sync", &error), NULL); fail_unless(!osync_error_is_set(&error), NULL); osync_env_free(env); + destroy_testbed(testbed); } END_TEST START_TEST (env_check_plugin_false) { + char *testbed = setup_testbed(NULL); OSyncEnv *env = init_env(); OSyncError *error = NULL; - fail_unless(!osync_env_plugin_is_usable(env, "file-syncc", &error), NULL); + fail_unless(!osync_env_plugin_is_usable(env, "mock-syncc", &error), NULL); fail_unless(osync_error_is_set(&error), NULL); osync_env_free(env); + destroy_testbed(testbed); } END_TEST START_TEST (env_check_plugin_false2) { + char *testbed = setup_testbed(NULL); g_setenv("IS_AVAILABLE", "1", TRUE); g_setenv("IS_NOT_AVAILABLE", "1", TRUE); @@ -154,10 +161,11 @@ OSyncError *error = NULL; - fail_unless(!osync_env_plugin_is_usable(env, "file-sync", &error), NULL); + fail_unless(!osync_env_plugin_is_usable(env, "mock-sync", &error), NULL); fail_unless(osync_error_is_set(&error), NULL); osync_env_free(env); + destroy_testbed(testbed); } END_TEST Modified: branches/experimental-branch/tests/check_filter.c =================================================================== --- branches/experimental-branch/tests/check_filter.c 2005-03-21 23:38:39 UTC (rev 391) +++ branches/experimental-branch/tests/check_filter.c 2005-03-22 13:41:07 UTC (rev 392) @@ -3,9 +3,8 @@ START_TEST (filter_setup) { char *testbed = setup_testbed("filter_setup"); - OSyncEnv *osync = osync_env_new(); - osync_env_initialize(osync, NULL); - mark_point(); + OSyncEnv *osync = init_env(); + OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); fail_unless(group != NULL, NULL); mark_point(); @@ -32,9 +31,7 @@ START_TEST (filter_flush) { char *testbed = setup_testbed("filter_setup"); - OSyncEnv *osync = osync_env_new(); - osync_env_initialize(osync, NULL); - mark_point(); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); fail_unless(group != NULL, NULL); mark_point(); @@ -63,9 +60,7 @@ START_TEST (filter_sync_deny_all) { char *testbed = setup_testbed("filter_sync_deny_all"); - OSyncEnv *osync = osync_env_new(); - osync_env_initialize(osync, NULL); - mark_point(); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); fail_unless(group != NULL, NULL); mark_point(); @@ -94,9 +89,7 @@ START_TEST (filter_sync_custom) { char *testbed = setup_testbed("filter_sync_custom"); - OSyncEnv *osync = osync_env_new(); - osync_env_initialize(osync, NULL); - mark_point(); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); fail_unless(group != NULL, NULL); mark_point(); @@ -199,9 +192,7 @@ START_TEST (filter_sync_vcard_only) { char *testbed = setup_testbed("filter_sync_vcard_only"); - OSyncEnv *osync = osync_env_new(); - osync_env_initialize(osync, NULL); - mark_point(); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); fail_unless(group != NULL, NULL); mark_point(); @@ -239,9 +230,7 @@ /* Check if the destobjtype of the changes is being * set when the change type os DELETE */ char *testbed = setup_testbed("destobjtype_delete"); - OSyncEnv *osync = osync_env_new(); - osync_env_initialize(osync, NULL); - mark_point(); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); fail_unless(group != NULL, NULL); mark_point(); Modified: branches/experimental-branch/tests/check_multisync.c =================================================================== --- branches/experimental-branch/tests/check_multisync.c 2005-03-21 23:38:39 UTC (rev 391) +++ branches/experimental-branch/tests/check_multisync.c 2005-03-22 13:41:07 UTC (rev 392) @@ -28,9 +28,9 @@ fail_unless(num_engine_end_conflicts = 1, NULL); OSyncMappingTable *maptable = mappingtable_load(group, 1, 0); - check_mapping(maptable, 1, 0, 3, "testdata", "file", "data"); - check_mapping(maptable, 2, 0, 3, "testdata", "file", "data"); - check_mapping(maptable, 3, 0, 3, "testdata", "file", "data"); + check_mapping(maptable, 1, 0, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, 0, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 3, 0, 3, "testdata", "mockformat", "data"); mappingtable_close(maptable); OSyncHashTable *table = hashtable_load(group, 1, 1); @@ -88,9 +88,9 @@ fail_unless(num_read == 1, NULL); OSyncMappingTable *maptable = mappingtable_load(group, 1, 0); - check_mapping(maptable, 1, 0, 3, "testdata", "file", "data"); - check_mapping(maptable, 2, 0, 3, "testdata", "file", "data"); - check_mapping(maptable, 3, 0, 3, "testdata", "file", "data"); + check_mapping(maptable, 1, 0, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, 0, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 3, 0, 3, "testdata", "mockformat", "data"); mappingtable_close(maptable); OSyncHashTable *table = hashtable_load(group, 1, 1); @@ -150,9 +150,9 @@ fail_unless(num_engine_end_conflicts = 1, NULL); OSyncMappingTable *maptable = mappingtable_load(group, 1, 0); - check_mapping(maptable, 1, 0, 3, "testdata", "file", "data"); - check_mapping(maptable, 2, 0, 3, "testdata", "file", "data"); - check_mapping(maptable, 3, 0, 3, "testdata", "file", "data"); + check_mapping(maptable, 1, 0, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, 0, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 3, 0, 3, "testdata", "mockformat", "data"); mappingtable_close(maptable); OSyncHashTable *table = hashtable_load(group, 1, 1); @@ -212,9 +212,9 @@ fail_unless(num_engine_end_conflicts = 1, NULL); OSyncMappingTable *maptable = mappingtable_load(group, 1, 0); - check_mapping(maptable, 1, 0, 3, "testdata", "file", "data"); - check_mapping(maptable, 2, 0, 3, "testdata", "file", "data"); - check_mapping(maptable, 3, 0, 3, "testdata", "file", "data"); + check_mapping(maptable, 1, 0, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, 0, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 3, 0, 3, "testdata", "mockformat", "data"); mappingtable_close(maptable); OSyncHashTable *table = hashtable_load(group, 1, 1); @@ -257,9 +257,9 @@ fail_unless(!system("test \"x$(diff -x \".*\" data1 data3)\" = \"x\""), NULL); OSyncMappingTable *maptable = mappingtable_load(group, 1, 0); - check_mapping(maptable, 1, 0, 3, "testdata", "file", "data"); - check_mapping(maptable, 2, 0, 3, "testdata", "file", "data"); - check_mapping(maptable, 3, 0, 3, "testdata", "file", "data"); + check_mapping(maptable, 1, 0, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, 0, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 3, 0, 3, "testdata", "mockformat", "data"); mappingtable_close(maptable); OSyncHashTable *table = hashtable_load(group, 1, 1); @@ -326,9 +326,9 @@ fail_unless(!system("test \"x$(diff -x \".*\" data1 data3)\" = \"x\""), NULL); OSyncMappingTable *maptable = mappingtable_load(group, 1, 0); - check_mapping(maptable, 1, 0, 3, "testdata", "file", "data"); - check_mapping(maptable, 2, 0, 3, "testdata", "file", "data"); - check_mapping(maptable, 3, 0, 3, "testdata", "file", "data"); + check_mapping(maptable, 1, 0, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, 0, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 3, 0, 3, "testdata", "mockformat", "data"); mappingtable_close(maptable); OSyncHashTable *table = hashtable_load(group, 1, 1); @@ -536,9 +536,9 @@ fail_unless(!system("test \"x$(diff -x \".*\" data1 data3)\" = \"x\""), NULL); OSyncMappingTable *maptable = mappingtable_load(group, 1, 0); - check_mapping(maptable, 1, 0, 3, "testdata", "file", "data"); - check_mapping(maptable, 2, 0, 3, "testdata", "file", "data"); - check_mapping(maptable, 3, 0, 3, "testdata", "file", "data"); + check_mapping(maptable, 1, 0, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, 0, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 3, 0, 3, "testdata", "mockformat", "data"); mappingtable_close(maptable); OSyncHashTable *table = hashtable_load(group, 1, 1); @@ -609,9 +609,9 @@ fail_unless(!system("test \"x$(diff -x \".*\" data1 data3)\" = \"x\""), NULL); OSyncMappingTable *maptable = mappingtable_load(group, 1, 0); - check_mapping(maptable, 1, 0, 3, "testdata", "file", "data"); - check_mapping(maptable, 2, 0, 3, "testdata", "file", "data"); - check_mapping(maptable, 3, 0, 3, "testdata", "file", "data"); + check_mapping(maptable, 1, 0, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, 0, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 3, 0, 3, "testdata", "mockformat", "data"); mappingtable_close(maptable); OSyncHashTable *table = hashtable_load(group, 1, 1); @@ -688,9 +688,9 @@ fail_unless(!system("test \"x$(diff -x \".*\" data1 data3)\" = \"x\""), NULL); OSyncMappingTable *maptable = mappingtable_load(group, 1, 0); - check_mapping(maptable, 1, 0, 3, "testdata", "file", "data"); - check_mapping(maptable, 2, 0, 3, "testdata", "file", "data"); - check_mapping(maptable, 3, 0, 3, "testdata", "file", "data"); + check_mapping(maptable, 1, 0, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, 0, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 3, 0, 3, "testdata", "mockformat", "data"); mappingtable_close(maptable); OSyncHashTable *table = hashtable_load(group, 1, 1); @@ -818,9 +818,9 @@ fail_unless(!system("test \"x$(diff -x \".*\" data1 data3)\" = \"x\""), NULL); OSyncMappingTable *maptable = mappingtable_load(group, 1, 0); - check_mapping(maptable, 1, 0, 3, "testdata", "file", "data"); - check_mapping(maptable, 2, 0, 3, "testdata", "file", "data"); - check_mapping(maptable, 3, 0, 3, "testdata", "file", "data"); + check_mapping(maptable, 1, 0, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, 0, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 3, 0, 3, "testdata", "mockformat", "data"); mappingtable_close(maptable); OSyncHashTable *table = hashtable_load(group, 1, 1); @@ -942,12 +942,12 @@ fail_unless(!system("test \"x$(diff -x \".*\" data1 data3)\" = \"x\""), NULL); OSyncMappingTable *maptable = mappingtable_load(group, 2, 0); - check_mapping(maptable, 1, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 1, -1, 3, "testdata-dupe", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata-dupe", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata-dupe", "file", "data"); + check_mapping(maptable, 1, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 1, -1, 3, "testdata-dupe", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata-dupe", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata-dupe", "mockformat", "data"); mappingtable_close(maptable); OSyncHashTable *table = hashtable_load(group, 1, 2); @@ -970,9 +970,9 @@ synchronize_once(engine, NULL); maptable = mappingtable_load(group, 1, 0); - check_mapping(maptable, 1, 0, 3, "testdata-dupe", "file", "data"); - check_mapping(maptable, 2, 0, 3, "testdata-dupe", "file", "data"); - check_mapping(maptable, 3, 0, 3, "testdata-dupe", "file", "data"); + check_mapping(maptable, 1, 0, 3, "testdata-dupe", "mockformat", "data"); + check_mapping(maptable, 2, 0, 3, "testdata-dupe", "mockformat", "data"); + check_mapping(maptable, 3, 0, 3, "testdata-dupe", "mockformat", "data"); mappingtable_close(maptable); table = hashtable_load(group, 1, 1); @@ -1043,15 +1043,15 @@ fail_unless(!system("test \"x$(diff -x \".*\" data1 data3)\" = \"x\""), NULL); OSyncMappingTable *maptable = mappingtable_load(group, 3, 0); - check_mapping(maptable, 1, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 1, -1, 3, "testdata-dupe", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata-dupe", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata-dupe", "file", "data"); - check_mapping(maptable, 1, -1, 3, "testdata-dupe-dupe", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata-dupe-dupe", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata-dupe-dupe", "file", "data"); + check_mapping(maptable, 1, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 1, -1, 3, "testdata-dupe", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata-dupe", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata-dupe", "mockformat", "data"); + check_mapping(maptable, 1, -1, 3, "testdata-dupe-dupe", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata-dupe-dupe", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata-dupe-dupe", "mockformat", "data"); mappingtable_close(maptable); OSyncHashTable *table = hashtable_load(group, 1, 3); @@ -1077,9 +1077,9 @@ synchronize_once(engine, NULL); maptable = mappingtable_load(group, 1, 0); - check_mapping(maptable, 1, 0, 3, "testdata-dupe", "file", "data"); - check_mapping(maptable, 2, 0, 3, "testdata-dupe", "file", "data"); - check_mapping(maptable, 3, 0, 3, "testdata-dupe", "file", "data"); + check_mapping(maptable, 1, 0, 3, "testdata-dupe", "mockformat", "data"); + check_mapping(maptable, 2, 0, 3, "testdata-dupe", "mockformat", "data"); + check_mapping(maptable, 3, 0, 3, "testdata-dupe", "mockformat", "data"); mappingtable_close(maptable); table = hashtable_load(group, 1, 1); @@ -1155,9 +1155,9 @@ fail_unless(!system("test \"x$(diff -x \".*\" data1 data3)\" = \"x\""), NULL); OSyncMappingTable *maptable = mappingtable_load(group, 1, 0); - check_mapping(maptable, 1, 0, 3, "testdata", "file", "data"); - check_mapping(maptable, 2, 0, 3, "testdata", "file", "data"); - check_mapping(maptable, 3, 0, 3, "testdata", "file", "data"); + check_mapping(maptable, 1, 0, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, 0, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 3, 0, 3, "testdata", "mockformat", "data"); mappingtable_close(maptable); OSyncHashTable *table = hashtable_load(group, 1, 1); @@ -1235,9 +1235,9 @@ fail_unless(!system("test \"x$(diff -x \".*\" data1 data3)\" = \"x\""), NULL); OSyncMappingTable *maptable = mappingtable_load(group, 1, 0); - check_mapping(maptable, 1, 0, 3, "testdata", "file", "data"); - check_mapping(maptable, 2, 0, 3, "testdata", "file", "data"); - check_mapping(maptable, 3, 0, 3, "testdata", "file", "data"); + check_mapping(maptable, 1, 0, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, 0, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 3, 0, 3, "testdata", "mockformat", "data"); mappingtable_close(maptable); OSyncHashTable *table = hashtable_load(group, 1, 1); @@ -1314,12 +1314,12 @@ fail_unless(!system("test \"x$(diff -x \".*\" data1 data3)\" = \"x\""), NULL); OSyncMappingTable *maptable = mappingtable_load(group, 2, 0); - check_mapping(maptable, 1, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 1, -1, 3, "testdata-dupe", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata-dupe", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata-dupe", "file", "data"); + check_mapping(maptable, 1, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 1, -1, 3, "testdata-dupe", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata-dupe", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata-dupe", "mockformat", "data"); mappingtable_close(maptable); OSyncHashTable *table = hashtable_load(group, 1, 2); @@ -1386,15 +1386,15 @@ fail_unless(!system("test \"x$(diff -x \".*\" data1 data3)\" = \"x\""), NULL); OSyncMappingTable *maptable = mappingtable_load(group, 3, 0); - check_mapping(maptable, 1, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 1, -1, 3, "testdata1", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata1", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata1", "file", "data"); - check_mapping(maptable, 1, -1, 3, "testdata2", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata2", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata2", "file", "data"); + check_mapping(maptable, 1, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 1, -1, 3, "testdata1", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata1", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata1", "mockformat", "data"); + check_mapping(maptable, 1, -1, 3, "testdata2", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata2", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata2", "mockformat", "data"); mappingtable_close(maptable); OSyncHashTable *table = hashtable_load(group, 1, 3); @@ -1443,21 +1443,21 @@ fail_unless(!system("test \"x$(diff -x \".*\" data1 data3)\" = \"x\""), NULL); maptable = mappingtable_load(group, 5, 0); - check_mapping(maptable, 1, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 1, -1, 3, "testdata1", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata1", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata1", "file", "data"); - check_mapping(maptable, 1, -1, 3, "testdata1-dupe", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata1-dupe", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata1-dupe", "file", "data"); - check_mapping(maptable, 1, -1, 3, "testdata2", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata2", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata2", "file", "data"); - check_mapping(maptable, 1, -1, 3, "testdata2-dupe", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata2-dupe", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata2-dupe", "file", "data"); + check_mapping(maptable, 1, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 1, -1, 3, "testdata1", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata1", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata1", "mockformat", "data"); + check_mapping(maptable, 1, -1, 3, "testdata1-dupe", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata1-dupe", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata1-dupe", "mockformat", "data"); + check_mapping(maptable, 1, -1, 3, "testdata2", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata2", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata2", "mockformat", "data"); + check_mapping(maptable, 1, -1, 3, "testdata2-dupe", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata2-dupe", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata2-dupe", "mockformat", "data"); mappingtable_close(maptable); table = hashtable_load(group, 1, 5); @@ -1533,15 +1533,15 @@ fail_unless(!system("test \"x$(diff -x \".*\" data1 data3)\" = \"x\""), NULL); OSyncMappingTable *maptable = mappingtable_load(group, 3, 0); - check_mapping(maptable, 1, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 1, -1, 3, "testdata1", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata1", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata1", "file", "data"); - check_mapping(maptable, 1, -1, 3, "testdata2", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata2", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata2", "file", "data"); + check_mapping(maptable, 1, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 1, -1, 3, "testdata1", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata1", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata1", "mockformat", "data"); + check_mapping(maptable, 1, -1, 3, "testdata2", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata2", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata2", "mockformat", "data"); mappingtable_close(maptable); OSyncHashTable *table = hashtable_load(group, 1, 3); @@ -1590,15 +1590,15 @@ fail_unless(!system("test \"x$(diff -x \".*\" data1 data3)\" = \"x\""), NULL); maptable = mappingtable_load(group, 3, 0); - check_mapping(maptable, 1, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 1, -1, 3, "testdata1", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata1", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata1", "file", "data"); - check_mapping(maptable, 1, -1, 3, "testdata2", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata2", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata2", "file", "data"); + check_mapping(maptable, 1, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 1, -1, 3, "testdata1", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata1", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata1", "mockformat", "data"); + check_mapping(maptable, 1, -1, 3, "testdata2", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata2", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata2", "mockformat", "data"); mappingtable_close(maptable); table = hashtable_load(group, 1, 3); @@ -1667,12 +1667,12 @@ fail_unless(!system("test \"x$(diff -x \".*\" data1 data3)\" = \"x\""), NULL); OSyncMappingTable *maptable = mappingtable_load(group, 2, 0); - check_mapping(maptable, 1, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 1, -1, 3, "testdata1", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata1", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata1", "file", "data"); + check_mapping(maptable, 1, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 1, -1, 3, "testdata1", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata1", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata1", "mockformat", "data"); mappingtable_close(maptable); OSyncHashTable *table = hashtable_load(group, 1, 2); @@ -1718,12 +1718,12 @@ fail_unless(!system("test \"x$(diff -x \".*\" data1 data3)\" != \"x\""), NULL); maptable = mappingtable_load(group, 2, 0); - check_mapping(maptable, 1, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 1, -1, 3, "testdata1", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata1", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata1", "file", "data"); + check_mapping(maptable, 1, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 1, -1, 3, "testdata1", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata1", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata1", "mockformat", "data"); mappingtable_close(maptable); table = hashtable_load(group, 1, 2); @@ -1751,12 +1751,12 @@ fail_unless(!system("test \"x$(diff -x \".*\" data1 data3)\" != \"x\""), NULL); maptable = mappingtable_load(group, 2, 0); - check_mapping(maptable, 1, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 1, -1, 3, "testdata1", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata1", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata1", "file", "data"); + check_mapping(maptable, 1, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 1, -1, 3, "testdata1", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata1", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata1", "mockformat", "data"); mappingtable_close(maptable); table = hashtable_load(group, 1, 2); @@ -1786,12 +1786,12 @@ fail_unless(!system("test \"x$(diff -x \".*\" data1 data3)\" = \"x\""), NULL); maptable = mappingtable_load(group, 2, 0); - check_mapping(maptable, 1, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 1, -1, 3, "testdata1", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata1", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata1", "file", "data"); + check_mapping(maptable, 1, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 1, -1, 3, "testdata1", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata1", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata1", "mockformat", "data"); mappingtable_close(maptable); table = hashtable_load(group, 1, 2); @@ -1860,11 +1860,11 @@ fail_unless(!system("test \"x$(diff -x \".*\" data1 data3)\" != \"x\""), NULL); OSyncMappingTable *maptable = mappingtable_load(group, 2, 0); - check_mapping(maptable, 1, -1, 2, "testdata", "file", "data"); - check_mapping(maptable, 3, -1, 2, "testdata", "file", "data"); - check_mapping(maptable, 1, -1, 3, "testdata1", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata1", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata1", "file", "data"); + check_mapping(maptable, 1, -1, 2, "testdata", "mockformat", "data"); + check_mapping(maptable, 3, -1, 2, "testdata", "mockformat", "data"); + check_mapping(maptable, 1, -1, 3, "testdata1", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata1", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata1", "mockformat", "data"); mappingtable_close(maptable); OSyncHashTable *table = hashtable_load(group, 1, 2); @@ -1894,12 +1894,12 @@ fail_unless(!system("test \"x$(diff -x \".*\" data1 data3)\" = \"x\""), NULL); maptable = mappingtable_load(group, 2, 0); - check_mapping(maptable, 1, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata", "file", "data"); - check_mapping(maptable, 1, -1, 3, "testdata1", "file", "data"); - check_mapping(maptable, 2, -1, 3, "testdata1", "file", "data"); - check_mapping(maptable, 3, -1, 3, "testdata1", "file", "data"); + check_mapping(maptable, 1, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata", "mockformat", "data"); + check_mapping(maptable, 1, -1, 3, "testdata1", "mockformat", "data"); + check_mapping(maptable, 2, -1, 3, "testdata1", "mockformat", "data"); + check_mapping(maptable, 3, -1, 3, "testdata1", "mockformat", "data"); mappingtable_close(maptable); table = hashtable_load(group, 1, 2); Modified: branches/experimental-branch/tests/check_sync.c =================================================================== --- branches/experimental-branch/tests/check_sync.c 2005-03-21 23:38:39 UTC (rev 391) +++ branches/experimental-branch/tests/check_sync.c 2005-03-22 13:41:07 UTC (rev 392) @@ -32,8 +32,9 @@ OSyncEngine *engine = osync_engine_new(group, NULL); osync_engine_set_memberstatus_callback(engine, member_status, NULL); - osync_engine_init(engine, NULL); - synchronize_once(engine, NULL); + OSyncError *error = NULL; + osync_engine_init(engine, &error); + synchronize_once(engine, &error); osync_engine_finalize(engine); osync_engine_free(engine); @@ -84,8 +85,8 @@ fail_unless(!system("test \"x$(diff -x \".*\" data1 data2)\" = \"x\""), NULL); OSyncMappingTable *maptable = mappingtable_load(group, 1, 0); - check_mapping(maptable, 1, 0, 2, "testdata", "file", "data"); - check_mapping(maptable, 2, 0, 2, "testdata", "file", "data"); + check_mapping(maptable, 1, 0, 2, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, 0, 2, "testdata", "mockformat", "data"); mappingtable_close(maptable); OSyncHashTable *table = hashtable_load(group, 1, 1); check_hash(table, "testdata"); @@ -191,8 +192,8 @@ fail_unless(num_written == 0, NULL); OSyncMappingTable *maptable = mappingtable_load(group, 1, 0); - check_mapping(maptable, 1, 0, 2, "testdata", "file", "data"); - check_mapping(maptable, 2, 0, 2, "testdata", "file", "data"); + check_mapping(maptable, 1, 0, 2, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, 0, 2, "testdata", "mockformat", "data"); mappingtable_close(maptable); OSyncHashTable *table = hashtable_load(group, 1, 1); @@ -226,10 +227,10 @@ fail_unless(!system("test \"x$(diff -x \".*\" data1 data2)\" = \"x\""), NULL); OSyncMappingTable *maptable = mappingtable_load(group, 2, 0); - check_mapping(maptable, 1, -1, 2, "testdata", "file", "data"); - check_mapping(maptable, 1, -1, 2, "testdata-dupe", "file", "data"); - check_mapping(maptable, 2, -1, 2, "testdata", "file", "data"); - check_mapping(maptable, 1, -1, 2, "testdata-dupe", "file", "data"); + check_mapping(maptable, 1, -1, 2, "testdata", "mockformat", "data"); + check_mapping(maptable, 1, -1, 2, "testdata-dupe", "mockformat", "data"); + check_mapping(maptable, 2, -1, 2, "testdata", "mockformat", "data"); + check_mapping(maptable, 1, -1, 2, "testdata-dupe", "mockformat", "data"); mappingtable_close(maptable); OSyncHashTable *table = hashtable_load(group, 1, 2); @@ -253,8 +254,8 @@ fail_unless(num_conflicts == 0, NULL); maptable = mappingtable_load(group, 1, 0); - check_mapping(maptable, 1, 0, 2, "testdata", "file", "data"); - check_mapping(maptable, 2, 0, 2, "testdata", "file", "data"); + check_mapping(maptable, 1, 0, 2, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, 0, 2, "testdata", "mockformat", "data"); mappingtable_close(maptable); table = hashtable_load(group, 1, 1); @@ -287,12 +288,12 @@ fail_unless(!system("test \"x$(diff -x \".*\" data1 data2)\" = \"x\""), NULL); OSyncMappingTable *maptable = mappingtable_load(group, 3, 0); - check_mapping(maptable, 1, -1, 2, "testdata", "file", "data"); - check_mapping(maptable, 1, -1, 2, "testdata-dupe", "file", "data"); - check_mapping(maptable, 1, -1, 2, "testdata-dupe-dupe", "file", "data"); - check_mapping(maptable, 2, -1, 2, "testdata", "file", "data"); - check_mapping(maptable, 2, -1, 2, "testdata-dupe", "file", "data"); - check_mapping(maptable, 2, -1, 2, "testdata-dupe-dupe", "file", "data"); + check_mapping(maptable, 1, -1, 2, "testdata", "mockformat", "data"); + check_mapping(maptable, 1, -1, 2, "testdata-dupe", "mockformat", "data"); + check_mapping(maptable, 1, -1, 2, "testdata-dupe-dupe", "mockformat", "data"); + check_mapping(maptable, 2, -1, 2, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, -1, 2, "testdata-dupe", "mockformat", "data"); + check_mapping(maptable, 2, -1, 2, "testdata-dupe-dupe", "mockformat", "data"); mappingtable_close(maptable); OSyncHashTable *table = hashtable_load(group, 1, 3); @@ -315,8 +316,8 @@ fail_unless(num_conflicts == 0, NULL); maptable = mappingtable_load(group, 1, 0); - check_mapping(maptable, 1, 0, 2, "testdata", "file", "data"); - check_mapping(maptable, 2, 0, 2, "testdata", "file", "data"); + check_mapping(maptable, 1, 0, 2, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, 0, 2, "testdata", "mockformat", "data"); mappingtable_close(maptable); table = hashtable_load(group, 1, 1); @@ -359,8 +360,8 @@ fail_unless(num_conflicts == 1, NULL); OSyncMappingTable *maptable = mappingtable_load(group, 1, 0); - check_mapping(maptable, 1, 0, 2, "testdata", "file", "data"); - check_mapping(maptable, 2, 0, 2, "testdata", "file", "data"); + check_mapping(maptable, 1, 0, 2, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, 0, 2, "testdata", "mockformat", "data"); mappingtable_close(maptable); OSyncHashTable *table = hashtable_load(group, 1, 1); @@ -514,8 +515,7 @@ START_TEST (sync_easy_dualdel) { char *testbed = setup_testbed("sync_easy_dualdel"); - OSyncEnv *osync = osync_env_new(); - osync_env_initialize(osync, NULL); + OSyncEnv *osync = init_env(); OSyncGroup *group = osync_group_load(osync, "configs/group", NULL); OSyncError *error = NULL; @@ -551,7 +551,8 @@ } END_TEST -START_TEST (sync_subdirs_new) +//This cannot work with the mock plugin +/*START_TEST (sync_subdirs_new) { char *testbed = setup_testbed("sync_subdirs_new"); OSyncEnv *osync = init_env(); @@ -576,14 +577,14 @@ fail_unless(!system("test \"x$(diff -x \".*\" -r data1 data2)\" = \"x\""), NULL); OSyncMappingTable *maptable = mappingtable_load(group, 3, 0); - check_mapping(maptable, 1, -1, 2, "testdata", "file", "data"); - check_mapping(maptable, 2, -1, 2, "testdata", "file", "data"); + check_mapping(maptable, 1, -1, 2, "testdata", "mockformat", "data"); + check_mapping(maptable, 2, -1, 2, "testdata", "mockformat", "data"); - check_mapping(maptable, 1, -1, 2, "subdir/testdata", "file", "data"); - check_mapping(maptable, 2, -1, 2, "subdir/testdata", "file", "data"); + check_mapping(maptable, 1, -1, 2, "subdir/testdata", "mockformat", "data"); + check_mapping(maptable, 2, -1, 2, "subdir/testdata", "mockformat", "data"); - check_mapping(maptable, 1, -1, 2, "subdir/testdata1", "file", "data"); - check_mapping(maptable, 2, -1, 2, "subdir/testdata1", "file", "data"); + check_mapping(maptable, 1, -1, 2, "subdir/testdata1", "mockformat", "data"); + check_mapping(maptable, 2, -1, 2, "subdir/testdata1", "mockformat", "data"); mappingtable_close(maptable); @@ -625,7 +626,7 @@ destroy_testbed(testbed); } -END_TEST +END_TEST*/ Suite *env_suite(void) { @@ -646,7 +647,7 @@ create_case(s, "sync_moddel", sync_moddel); create_case(s, "sync_conflict_moddel", sync_conflict_moddel); create_case(s, "sync_conflict_duplicate", sync_conflict_duplicate); - create_case(s, "sync_subdirs_new", sync_subdirs_new); + //create_case(s, "sync_subdirs_new", sync_subdirs_new); return s; } Modified: branches/experimental-branch/tests/mock-plugin/Makefile.am =================================================================== --- branches/experimental-branch/tests/mock-plugin/Makefile.am 2005-03-21 23:38:39 UTC (rev 391) +++ branches/experimental-branch/tests/mock-plugin/Makefile.am 2005-03-22 13:41:07 UTC (rev 392) @@ -4,8 +4,12 @@ EXTRA_DIST = mock_sync.h -noinst_LTLIBRARIES = mock_sync.la +lib_LTLIBRARIES = mock_sync.la mockformat.la mock_sync_la_SOURCES = mock_sync.c mock_sync_la_LDFLAGS = -avoid-version -export-dynamic -module mock_sync_la_LIBADD = @PACKAGE_LIBS@ @LIBS@ @XML_LIBS@ + +mockformat_la_SOURCES = mock_format.c +mockformat_la_LDFLAGS = -avoid-version -export-dynamic -module +mockformat_la_LIBADD = @PACKAGE_LIBS@ @LIBS@ Modified: branches/experimental-branch/tests/mock-plugin/mock_format.c =================================================================== --- branches/experimental-branch/tests/mock-plugin/mock_format.c 2005-03-21 23:38:39 UTC (rev 391) +++ branches/experimental-branch/tests/mock-plugin/mock_format.c 2005-03-22 13:41:07 UTC (rev 392) @@ -25,8 +25,6 @@ static OSyncConvCmpResult compare_file(OSyncChange *leftchange, OSyncChange *rightchange) { osync_trace(TRACE_ENTRY, "%s(%p, %p)", __func__, leftchange, rightchange); - fs_fileinfo *leftfile = (fs_fileinfo *)osync_change_get_data(leftchange); - fs_fileinfo *rightfile = (fs_fileinfo *)osync_change_get_data(rightchange); osync_bool data_same = FALSE; osync_bool path_same = FALSE; @@ -34,13 +32,11 @@ if (!strcmp(osync_change_get_uid(leftchange), osync_change_get_uid(rightchange))) path_same = TRUE; - osync_trace(TRACE_INTERNAL, "%i %i", leftfile->size, rightfile->size); - - if (leftfile->size == rightfile->size) { - if (leftfile->data == rightfile->data) { + if (osync_change_get_datasize(leftchange) == osync_change_get_datasize(rightchange)) { + if (osync_change_get_data(leftchange) == osync_change_get_data(rightchange)) { data_same = TRUE; } else { - if (!memcmp(leftfile->data, rightfile->data, leftfile->size)) + if (!memcmp(osync_change_get_data(leftchange), osync_change_get_data(rightchange), osync_change_get_datasize(leftchange))) data_same = TRUE; } } @@ -60,37 +56,26 @@ static osync_bool conv_file_to_plain(void *user_data, char *input, int inpsize, char **output, int *outpsize, osync_bool *free_input, OSyncError **error) { osync_debug("FILE", 4, "start: %s", __func__); - fs_fileinfo *file = (fs_fileinfo *)input; *free_input = FALSE; - *output = file->data; - *outpsize = file->size; + *output = input; + *outpsize = inpsize; return TRUE; } static osync_bool conv_plain_to_file(void *user_data, char *input, int inpsize, char **output, int *outpsize, osync_bool *free_input, OSyncError **error) { osync_debug("FILE", 4, "start: %s", __func__); - fs_fileinfo *file = g_malloc0(sizeof(fs_fileinfo)); - - file->data = input; - file->size = inpsize; *free_input = FALSE; - *output = (char *)file; - *outpsize = sizeof(file); + *output = input; + *outpsize = inpsize; return TRUE; } static void destroy_file(char *input, size_t inpsize) { - fs_fileinfo *file = (fs_fileinfo *)input; - if (inpsize != sizeof(fs_fileinfo)) { - osync_debug("FILE", 0, "destroy_file: Wrong data size: %d, but it should be %u", inpsize, sizeof(fs_fileinfo)); - return; - } - g_free(file->data); - g_free(file); + g_free(input); } static void duplicate_file(OSyncChange *change) @@ -104,19 +89,15 @@ static osync_bool copy_file(const char *input, int inpsize, char **output, int *outpsize) { osync_debug("FILE", 4, "start: %s", __func__); - - fs_fileinfo *oldfile = (fs_fileinfo *)input; - fs_fileinfo *newfile = g_malloc0(sizeof(fs_fileinfo)); - newfile->filestats = oldfile->filestats; - newfile->size = oldfile->size; + char *new = NULL; - if (oldfile->size) { - newfile->data = g_malloc0(oldfile->size); - memcpy(newfile->data, oldfile->data, oldfile->size); + if (inpsize) { + new = g_malloc0(inpsize); + memcpy(new, input, inpsize); } - *output = (char *)newfile; + *output = new; *outpsize = inpsize; return TRUE; } @@ -124,14 +105,9 @@ static void create_file(OSyncChange *change) { osync_debug("FILE", 4, "start: %s", __func__); - - fs_fileinfo *newfile = g_malloc0(sizeof(fs_fileinfo)); char *data = osync_rand_str(g_random_int_range(1, 100)); - newfile->data = data; - newfile->size = strlen(data) + 1; - - osync_change_set_data(change, (char *)newfile, sizeof(newfile), TRUE); + osync_change_set_data(change, data, strlen(data) + 1, TRUE); if (!osync_change_get_uid(change)) osync_change_set_uid(change, osync_rand_str(6)); } @@ -139,9 +115,8 @@ static char *print_file(OSyncChange *change) { osync_debug("FILE", 4, "start: %s", __func__); - fs_fileinfo *file = (fs_fileinfo *)osync_change_get_data(change); - char *printable = g_strdup_printf ("File: %s\nSize: %i", osync_change_get_uid(change), file->size); + char *printable = g_strdup_printf ("File: %s\nSize: %i", osync_change_get_uid(change), osync_change_get_datasize(change)); return printable; } Modified: branches/experimental-branch/tests/mock-plugin/mock_sync.c =================================================================== --- branches/experimental-branch/tests/mock-plugin/mock_sync.c 2005-03-21 23:38:39 UTC (rev 391) +++ branches/experimental-branch/tests/mock-plugin/mock_sync.c 2005-03-22 13:41:07 UTC (rev 392) @@ -20,6 +20,58 @@ #include "mock_sync.h" +/*Load the state from a xml file and return it in the conn struct*/ +static osync_bool mock_parse_settings(mock_env *env, char *data, int size, OSyncError **error) +{ + osync_trace(TRACE_ENTRY, "%s(%p, %p, %i)", __func__, env, data, size); + xmlDocPtr doc; + xmlNodePtr cur; + + //set defaults + env->path = NULL; + + doc = xmlParseMemory(data, size); + + if (!doc) { + osync_error_set(error, OSYNC_ERROR_GENERIC, "Unable to parse settings"); + osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error)); + return FALSE; + } + + cur = xmlDocGetRootElement(doc); + + if (!cur) { + xmlFreeDoc(doc); + osync_error_set(error, OSYNC_ERROR_GENERIC, "Unable to get root element of the settings"); + osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error)); + return FALSE; + } + + if (xmlStrcmp(cur->name, "config")) { + xmlFreeDoc(doc); + osync_error_set(error, OSYNC_ERROR_GENERIC, "Config valid is not valid"); + osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error)); + return FALSE; + } + + cur = cur->xmlChildrenNode; + + while (cur != NULL) { + char *str = xmlNodeGetContent(cur); + if (str) { + if (!xmlStrcmp(cur->name, (const xmlChar *)"path")) { + env->path = g_strdup(str); + } + xmlFree(str); + } + cur = cur->next; + } + + xmlFreeDoc(doc); + osync_trace(TRACE_EXIT, "%s", __func__); + return TRUE; +} + static osync_bool mock_get_error(OSyncMember *member, const char *domain) { const char *env = g_getenv(domain); @@ -50,14 +102,19 @@ osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error)); return NULL; } + char *configdata; + int configsize; + mock_env *env = g_malloc0(sizeof(mock_env)); - char *configdata; - if (!osync_member_get_config(member, &configdata, NULL, error)) { + if (!osync_member_get_config(member, &configdata, &configsize, error)) { osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error)); return NULL; } - mock_env *env = (mock_env *)configdata; + if (!mock_parse_settings(env, configdata, configsize, error)) { + g_free(env); + return NULL; + } env->member = member; env->hashtable = osync_hashtable_new(); @@ -148,7 +205,7 @@ osync_change_set_member(change, env->member); osync_change_set_uid(change, de); - osync_change_set_objformat_string(change, "file"); + osync_change_set_objformat_string(change, "mockformat"); struct stat buf; stat(filename, &buf); @@ -178,7 +235,8 @@ } } g_dir_close(dir); - + osync_hashtable_report_deleted(env->hashtable, ctx, "data"); + osync_context_report_success(ctx); } @@ -372,7 +430,7 @@ void get_info(OSyncPluginInfo *info) { - info->name = "mock-sync"; + info->name = "file-sync"; info->longname = "Mock Plugin"; info->description = "Mock Plugin"; info->version = 1; Modified: branches/experimental-branch/tests/support.c =================================================================== --- branches/experimental-branch/tests/support.c 2005-03-21 23:38:39 UTC (rev 391) +++ branches/experimental-branch/tests/support.c 2005-03-22 13:41:07 UTC (rev 392) @@ -23,14 +23,35 @@ setuid(65534); char *testbed = g_strdup_printf("%s/testbed.XXXXXX", g_get_tmp_dir()); mkdtemp(testbed); - char *command = g_strdup_printf("cp -a %s%sdata/%s/* %s", g_getenv("srcdir") ? g_getenv("srcdir") : "", g_getenv("srcdir") ? "/" : "", fkt_name, testbed); + + char *command = NULL; + if (fkt_name) { + command = g_strdup_printf("cp -a %s%sdata/%s/* %s", g_getenv("srcdir") ? g_getenv("srcdir") : "", g_getenv("srcdir") ? "/" : "", fkt_name, testbed); + if (system(command)) + abort(); + g_free(command); + } + + command = g_strdup_printf("cp -a %s%smock-plugin/.libs/*.so %s", g_getenv("srcdir") ? g_getenv("srcdir") : "", g_getenv("srcdir") ? "/" : "", testbed); if (system(command)) abort(); + g_free(command); + + command = g_strdup_printf("cp -a %s%s../formats/.libs/*.so %s", g_getenv("srcdir") ? g_getenv("srcdir") : "", g_getenv("srcdir") ? "/" : "", testbed); + if (system(command)) + abort(); + g_free(command); + + command = g_strdup_printf("cp -a %s%s../formats/vformats-xml/.libs/*.so %s", g_getenv("srcdir") ? g_getenv("srcdir") : "", g_getenv("srcdir") ? "/" : "", testbed); + if (system(command)) + abort(); + g_free(command); + olddir = g_get_current_dir(); if (chdir(testbed)) abort(); - g_free(command); - osync_debug("TEST", 4, "Seting up %s at %s\n", fkt_name, testbed); + + osync_debug("TEST", 4, "Seting up %s at %s", fkt_name, testbed); printf("."); fflush(NULL); reset_env(); @@ -388,16 +409,41 @@ fail_unless(found == TRUE, NULL); } +static void load_format(OSyncEnv *env, const char *name) +{ + OSyncError *error = NULL; + char *path = g_strdup_printf("%s/%s", g_get_current_dir(), name); + fail_unless(osync_format_plugin_load(env, path, &error), NULL); + g_free(path); +} + OSyncEnv *init_env(void) { mark_point(); OSyncEnv *osync = osync_env_new(); mark_point(); osync_env_set_option(osync, "LOAD_GROUPS", "FALSE"); + osync_env_set_option(osync, "LOAD_FORMATS", "FALSE"); + osync_env_set_option(osync, "LOAD_PLUGINS", "FALSE"); mark_point(); OSyncError *error = NULL; fail_unless(osync_env_initialize(osync, &error), NULL); fail_unless(!osync_error_is_set(&error), NULL); + + char *path = g_strdup_printf("%s/%s", g_get_current_dir(), "mock_sync.so"); + fail_unless(osync_plugin_load(osync, path, &error) != NULL, NULL); + g_free(path); + + load_format(osync, "contact.so"); + load_format(osync, "data.so"); + load_format(osync, "event.so"); + load_format(osync, "note.so"); + load_format(osync, "todo.so"); + load_format(osync, "xml-vcal.so"); + load_format(osync, "xml-vcard.so"); + load_format(osync, "xml-vnote.so"); + load_format(osync, "mockformat.so"); + return osync; } |
From: <svn...@op...> - 2005-03-21 23:37:54
|
Author: drzeus Date: 2005-03-22 00:38:39 +0100 (Tue, 22 Mar 2005) New Revision: 391 Added: trunk/RPM Log: Instructions for building an RPM Added: trunk/RPM =================================================================== --- trunk/RPM 2005-03-21 23:30:00 UTC (rev 390) +++ trunk/RPM 2005-03-21 23:38:39 UTC (rev 391) @@ -0,0 +1,18 @@ +Building a rpm +=== + +OpenSync already contains a ready to use spec file so building an RPM is a +piece of cake. All you need to do is: + + rpmbuild -ta <tarball> + +where <tarball> is the current OpenSync tar file (e.g. opensync-0.14.tar.gz). + +As long as you have the necessary prerequisites the package should build just +fine. + +The packages needed for building the rpm are: + + * libxml2-devel + * glib2-devel + * sqlite-devel >= 3.0.0 |
From: <svn...@op...> - 2005-03-21 23:29:15
|
Author: drzeus Date: 2005-03-22 00:30:00 +0100 (Tue, 22 Mar 2005) New Revision: 390 Modified: trunk/opensync/opensync_db.c Log: Another gcc4 fix. Modified: trunk/opensync/opensync_db.c =================================================================== --- trunk/opensync/opensync_db.c 2005-03-21 23:02:58 UTC (rev 389) +++ trunk/opensync/opensync_db.c 2005-03-21 23:30:00 UTC (rev 390) @@ -103,7 +103,7 @@ sqlite3_prepare(sdb, "SELECT uid, memberid, changetype FROM tbl_log", -1, &ppStmt, NULL); int i = 0; while (sqlite3_step(ppStmt) == SQLITE_ROW) { - (*uids)[i] = g_strdup(sqlite3_column_text(ppStmt, 0)); + (*uids)[i] = g_strdup((gchar*)sqlite3_column_text(ppStmt, 0)); (*memberids)[i] = sqlite3_column_int64(ppStmt, 1); (*changetypes)[i] = sqlite3_column_int(ppStmt, 2); i++; |
From: <svn...@op...> - 2005-03-21 23:02:14
|
Author: azrael Date: 2005-03-22 00:02:58 +0100 (Tue, 22 Mar 2005) New Revision: 389 Modified: branches/experimental-branch/tests/Makefile.am branches/experimental-branch/tests/mock-plugin/Makefile.am branches/experimental-branch/tests/mock-plugin/mock_sync.c branches/experimental-branch/tests/mock-plugin/mock_sync.h Log: Made the mock-plugin compile Modified: branches/experimental-branch/tests/Makefile.am =================================================================== --- branches/experimental-branch/tests/Makefile.am 2005-03-21 22:47:53 UTC (rev 388) +++ branches/experimental-branch/tests/Makefile.am 2005-03-21 23:02:58 UTC (rev 389) @@ -1,5 +1,7 @@ ## Process this file with automake to produce Makefile.in +SUBDIRS = mock-plugin + EXTRA_DIST = data support.h AM_CFLAGS = @XML_CFLAGS@ -Wall -Werror @GCOV_CFLAGS@ Modified: branches/experimental-branch/tests/mock-plugin/Makefile.am =================================================================== --- branches/experimental-branch/tests/mock-plugin/Makefile.am 2005-03-21 22:47:53 UTC (rev 388) +++ branches/experimental-branch/tests/mock-plugin/Makefile.am 2005-03-21 23:02:58 UTC (rev 389) @@ -1,10 +1,6 @@ -plugindir=@OPENSYNC_PLUGINDIR@ -configdir=@OPENSYNC_CONFIGDIR@ -formatsdir=@OPENSYNC_FORMATSDIR@ - INCLUDES = @PACKAGE_CFLAGS@ -AM_CFLAGS = -Wall -Werror +AM_CFLAGS = -Wall -Werror @XML_CFLAGS@ EXTRA_DIST = mock_sync.h @@ -12,4 +8,4 @@ mock_sync_la_SOURCES = mock_sync.c mock_sync_la_LDFLAGS = -avoid-version -export-dynamic -module -mock_sync_la_LIBADD = @PACKAGE_LIBS@ @LIBS@ @FAM_LIBS@ +mock_sync_la_LIBADD = @PACKAGE_LIBS@ @LIBS@ @XML_LIBS@ Modified: branches/experimental-branch/tests/mock-plugin/mock_sync.c =================================================================== --- branches/experimental-branch/tests/mock-plugin/mock_sync.c 2005-03-21 22:47:53 UTC (rev 388) +++ branches/experimental-branch/tests/mock-plugin/mock_sync.c 2005-03-21 23:02:58 UTC (rev 389) @@ -52,7 +52,6 @@ } char *configdata; - int configsize; if (!osync_member_get_config(member, &configdata, NULL, error)) { osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error)); return NULL; @@ -86,7 +85,7 @@ OSyncError *error = NULL; if (!osync_hashtable_load(env->hashtable, env->member, &error)) { osync_context_report_osyncerror(ctx, &error); - osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error)); + osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(&error)); osync_error_free(&error); return; } @@ -108,9 +107,9 @@ osync_trace(TRACE_EXIT, "%s", __func__); } -static char *mock_generate_hash(mock_fileinfo *info) +static char *mock_generate_hash(struct stat *buf) { - char *hash = g_strdup_printf("%i-%i", (int)info->filestats.st_mtime, (int)info->filestats.st_ctime); + char *hash = g_strdup_printf("%i-%i", (int)buf->st_mtime, (int)buf->st_ctime); return hash; } @@ -138,7 +137,7 @@ dir = g_dir_open(env->path, 0, &gerror); if (!dir) { - osync_trace(TRACE_EXIT_ERROR, "mock_report_dir: Unable to open directory %s: %s", path, gerror ? gerror->message : "None"); + osync_trace(TRACE_EXIT_ERROR, "mock_report_dir: Unable to open directory %s: %s", env->path, gerror ? gerror->message : "None"); return; } while ((de = g_dir_read_name(dir))) { @@ -151,23 +150,24 @@ osync_change_set_objformat_string(change, "file"); - mock_fileinfo *info = g_malloc0(sizeof(mock_fileinfo)); - struct stat buf; stat(filename, &buf); char *hash = mock_generate_hash(&buf); osync_change_set_hash(change, hash); if (mock_get_error(env->member, "ONLY_INFO")) { - osync_change_set_data(change, (char *)info, sizeof(mock_fileinfo), FALSE); + osync_change_set_data(change, NULL, 0, FALSE); } else { - if (!osync_file_read(filename, &info->data, &info->size, &error)) { + char *data = NULL; + int size = 0; + OSyncError *error = NULL; + if (!osync_file_read(filename, &data, &size, &error)) { osync_context_report_osyncerror(ctx, &error); g_free(filename); return; } - osync_change_set_data(change, (char *)file_info, sizeof(mock_fileinfo), TRUE); + osync_change_set_data(change, data, size, TRUE); } if (osync_hashtable_detect_change(env->hashtable, change)) { @@ -185,8 +185,7 @@ static void mock_get_data(OSyncContext *ctx, OSyncChange *change) { mock_env *env = (mock_env *)osync_context_get_plugin_data(ctx); - mock_fileinfo *file_info = (mock_fileinfo *)osync_change_get_data(change); - + if (mock_get_error(env->member, "GET_DATA_ERROR")) { osync_context_report_error(ctx, OSYNC_ERROR_EXPECTED, "Triggering GET_DATA_ERROR error"); return; @@ -195,14 +194,16 @@ return; char *filename = g_strdup_printf("%s/%s", env->path, osync_change_get_uid(change)); + char *data = NULL; + int size = 0; OSyncError *error = NULL; - if (!osync_file_read(filename, &file_info->data, &file_info->size, &error)) { + if (!osync_file_read(filename, &data, &size, &error)) { osync_context_report_osyncerror(ctx, &error); g_free(filename); return; } - osync_change_set_data(change, (char *)file_info, sizeof(mock_fileinfo), TRUE); + osync_change_set_data(change, data, size, TRUE); g_free(filename); osync_context_report_success(ctx); @@ -213,18 +214,17 @@ mock_env *env = (mock_env *)osync_context_get_plugin_data(ctx); char *filename = g_strdup_printf("%s/%s", env->path, osync_change_get_uid(change)); - - mock_fileinfo *info = g_malloc0(sizeof(mock_fileinfo)); - stat(filename, &info->filestats); + char *data = NULL; + int size = 0; OSyncError *error = NULL; - if (!osync_file_read(filename, &info->data, &info->size, &error)) { + if (!osync_file_read(filename, &data, &size, &error)) { osync_context_report_osyncerror(ctx, &error); g_free(filename); return; } - - osync_change_set_data(change, (char *)info, sizeof(mock_fileinfo), TRUE); + + osync_change_set_data(change, data, size, TRUE); g_free(filename); @@ -236,8 +236,7 @@ /*TODO: Create directory for file, if it doesn't exist */ osync_debug("FILE-SYNC", 4, "start: %s", __func__); mock_env *env = (mock_env *)osync_context_get_plugin_data(ctx); - mock_fileinfo *file_info = (mock_fileinfo *)osync_change_get_data(change); - + char *filename = NULL; OSyncError *error = NULL; filename = g_strdup_printf ("%s/%s", env->path, osync_change_get_uid(change)); @@ -261,14 +260,17 @@ /* No break. Continue below */ case CHANGE_MODIFIED: //FIXME add permission and ownership for file-sync - if (!osync_file_write(filename, file_info->data, file_info->size, 0700, &error)) { + if (!osync_file_write(filename, osync_change_get_data(change), osync_change_get_datasize(change), 0700, &error)) { osync_debug("FILE-SYNC", 0, "Unable to write to file %s", filename); osync_context_report_osyncerror(ctx, &error); g_free(filename); return FALSE; } - stat(filename, &file_info->filestats); - osync_change_set_hash(change, mock_generate_hash(file_info)); + + struct stat buf; + stat(filename, &buf); + char *hash = mock_generate_hash(&buf); + osync_change_set_hash(change, hash); break; default: osync_debug("FILE-SYNC", 0, "Unknown change type"); Modified: branches/experimental-branch/tests/mock-plugin/mock_sync.h =================================================================== --- branches/experimental-branch/tests/mock-plugin/mock_sync.h 2005-03-21 22:47:53 UTC (rev 388) +++ branches/experimental-branch/tests/mock-plugin/mock_sync.h 2005-03-21 23:02:58 UTC (rev 389) @@ -8,9 +8,9 @@ #include <libxml/xmlmemory.h> #include <libxml/parser.h> -typedef struct mockenv { +typedef struct mock_env { char *path; OSyncMember *member; GDir *dir; OSyncHashTable *hashtable; -} filesyncinfo; +} mock_env; |
From: <svn...@op...> - 2005-03-21 22:47:11
|
Author: azrael Date: 2005-03-21 23:47:53 +0100 (Mon, 21 Mar 2005) New Revision: 388 Added: branches/experimental-branch/tests/mock-plugin/ branches/experimental-branch/tests/mock-plugin/Makefile.am branches/experimental-branch/tests/mock-plugin/mock_format.c branches/experimental-branch/tests/mock-plugin/mock_sync.c branches/experimental-branch/tests/mock-plugin/mock_sync.h Log: Added a new mock plugin that replaces the real file-sync plugin in the unit tests Added: branches/experimental-branch/tests/mock-plugin/Makefile.am =================================================================== --- branches/experimental-branch/tests/mock-plugin/Makefile.am 2005-03-21 22:47:00 UTC (rev 387) +++ branches/experimental-branch/tests/mock-plugin/Makefile.am 2005-03-21 22:47:53 UTC (rev 388) @@ -0,0 +1,15 @@ +plugindir=@OPENSYNC_PLUGINDIR@ +configdir=@OPENSYNC_CONFIGDIR@ +formatsdir=@OPENSYNC_FORMATSDIR@ + +INCLUDES = @PACKAGE_CFLAGS@ + +AM_CFLAGS = -Wall -Werror + +EXTRA_DIST = mock_sync.h + +noinst_LTLIBRARIES = mock_sync.la + +mock_sync_la_SOURCES = mock_sync.c +mock_sync_la_LDFLAGS = -avoid-version -export-dynamic -module +mock_sync_la_LIBADD = @PACKAGE_LIBS@ @LIBS@ @FAM_LIBS@ Added: branches/experimental-branch/tests/mock-plugin/mock_format.c =================================================================== --- branches/experimental-branch/tests/mock-plugin/mock_format.c 2005-03-21 22:47:00 UTC (rev 387) +++ branches/experimental-branch/tests/mock-plugin/mock_format.c 2005-03-21 22:47:53 UTC (rev 388) @@ -0,0 +1,162 @@ +/* + * file - A plugin for file objects for the opensync framework + * Copyright (C) 2004-2005 Armin Bauer <arm...@op...> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#include <opensync/opensync.h> +#include <glib.h> +#include "mock_sync.h" + +static OSyncConvCmpResult compare_file(OSyncChange *leftchange, OSyncChange *rightchange) +{ + osync_trace(TRACE_ENTRY, "%s(%p, %p)", __func__, leftchange, rightchange); + fs_fileinfo *leftfile = (fs_fileinfo *)osync_change_get_data(leftchange); + fs_fileinfo *rightfile = (fs_fileinfo *)osync_change_get_data(rightchange); + + osync_bool data_same = FALSE; + osync_bool path_same = FALSE; + + if (!strcmp(osync_change_get_uid(leftchange), osync_change_get_uid(rightchange))) + path_same = TRUE; + + osync_trace(TRACE_INTERNAL, "%i %i", leftfile->size, rightfile->size); + + if (leftfile->size == rightfile->size) { + if (leftfile->data == rightfile->data) { + data_same = TRUE; + } else { + if (!memcmp(leftfile->data, rightfile->data, leftfile->size)) + data_same = TRUE; + } + } + + if (data_same && path_same) { + osync_trace(TRACE_EXIT, "%s: Same", __func__); + return CONV_DATA_SAME; + } + if (path_same) { + osync_trace(TRACE_EXIT, "%s: Similar", __func__); + return CONV_DATA_SIMILAR; + } + osync_trace(TRACE_EXIT, "%s: Mismatch", __func__); + return CONV_DATA_MISMATCH; +} + +static osync_bool conv_file_to_plain(void *user_data, char *input, int inpsize, char **output, int *outpsize, osync_bool *free_input, OSyncError **error) +{ + osync_debug("FILE", 4, "start: %s", __func__); + fs_fileinfo *file = (fs_fileinfo *)input; + + *free_input = FALSE; + *output = file->data; + *outpsize = file->size; + return TRUE; +} + +static osync_bool conv_plain_to_file(void *user_data, char *input, int inpsize, char **output, int *outpsize, osync_bool *free_input, OSyncError **error) +{ + osync_debug("FILE", 4, "start: %s", __func__); + fs_fileinfo *file = g_malloc0(sizeof(fs_fileinfo)); + + file->data = input; + file->size = inpsize; + + *free_input = FALSE; + *output = (char *)file; + *outpsize = sizeof(file); + return TRUE; +} + +static void destroy_file(char *input, size_t inpsize) +{ + fs_fileinfo *file = (fs_fileinfo *)input; + if (inpsize != sizeof(fs_fileinfo)) { + osync_debug("FILE", 0, "destroy_file: Wrong data size: %d, but it should be %u", inpsize, sizeof(fs_fileinfo)); + return; + } + g_free(file->data); + g_free(file); +} + +static void duplicate_file(OSyncChange *change) +{ + osync_debug("FILE", 4, "start: %s", __func__); + char *newuid = g_strdup_printf ("%s-dupe", osync_change_get_uid(change)); + osync_change_set_uid(change, newuid); + g_free(newuid); +} + +static osync_bool copy_file(const char *input, int inpsize, char **output, int *outpsize) +{ + osync_debug("FILE", 4, "start: %s", __func__); + + fs_fileinfo *oldfile = (fs_fileinfo *)input; + fs_fileinfo *newfile = g_malloc0(sizeof(fs_fileinfo)); + + newfile->filestats = oldfile->filestats; + newfile->size = oldfile->size; + + if (oldfile->size) { + newfile->data = g_malloc0(oldfile->size); + memcpy(newfile->data, oldfile->data, oldfile->size); + } + + *output = (char *)newfile; + *outpsize = inpsize; + return TRUE; +} + +static void create_file(OSyncChange *change) +{ + osync_debug("FILE", 4, "start: %s", __func__); + + fs_fileinfo *newfile = g_malloc0(sizeof(fs_fileinfo)); + + char *data = osync_rand_str(g_random_int_range(1, 100)); + newfile->data = data; + newfile->size = strlen(data) + 1; + + osync_change_set_data(change, (char *)newfile, sizeof(newfile), TRUE); + if (!osync_change_get_uid(change)) + osync_change_set_uid(change, osync_rand_str(6)); +} + +static char *print_file(OSyncChange *change) +{ + osync_debug("FILE", 4, "start: %s", __func__); + fs_fileinfo *file = (fs_fileinfo *)osync_change_get_data(change); + + char *printable = g_strdup_printf ("File: %s\nSize: %i", osync_change_get_uid(change), file->size); + return printable; +} + +void get_info(OSyncEnv *env) +{ + osync_env_register_objtype(env, "data"); + osync_env_register_objformat(env, "data", "mockformat"); + osync_env_format_set_compare_func(env, "mockformat", compare_file); + osync_env_format_set_duplicate_func(env, "mockformat", duplicate_file); + osync_env_format_set_destroy_func(env, "mockformat", destroy_file); + osync_env_format_set_print_func(env, "mockformat", print_file); + osync_env_format_set_copy_func(env, "mockformat", copy_file); + osync_env_format_set_create_func(env, "mockformat", create_file); + + osync_env_format_set_create_func(env, "mockformat", create_file); + osync_env_register_converter(env, CONVERTER_DECAP, "mockformat", "plain", conv_file_to_plain); + osync_env_register_converter(env, CONVERTER_ENCAP, "plain", "mockformat", conv_plain_to_file); +} Added: branches/experimental-branch/tests/mock-plugin/mock_sync.c =================================================================== --- branches/experimental-branch/tests/mock-plugin/mock_sync.c 2005-03-21 22:47:00 UTC (rev 387) +++ branches/experimental-branch/tests/mock-plugin/mock_sync.c 2005-03-21 22:47:53 UTC (rev 388) @@ -0,0 +1,410 @@ +/* + * mock-sync - A mock-plugin for the opensync framework + * Copyright (C) 2004-2005 Armin Bauer <arm...@op...> + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + */ + +#include "mock_sync.h" + +static osync_bool mock_get_error(OSyncMember *member, const char *domain) +{ + const char *env = g_getenv(domain); + if (!env) + return FALSE; + + int num = atoi(env); + int mask = 1 << (osync_member_get_id(member) - 1); + if (num & mask) { + char *chancestr = g_strdup_printf("%s_PROB", domain); + const char *chance = g_getenv(chancestr); + g_free(chancestr); + if (!chance) + return TRUE; + int prob = atoi(chance); + if (prob >= g_random_int_range(0, 100)) + return TRUE; + } + return FALSE; +} + +static void *mock_initialize(OSyncMember *member, OSyncError **error) +{ + osync_trace(TRACE_ENTRY, "%s(%p, %p)", __func__, member, error); + + if (mock_get_error(member, "INIT_NULL")) { + osync_error_set(error, OSYNC_ERROR_EXPECTED, "Triggering INIT_NULL error"); + osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error)); + return NULL; + } + + char *configdata; + int configsize; + if (!osync_member_get_config(member, &configdata, NULL, error)) { + osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error)); + return NULL; + } + + mock_env *env = (mock_env *)configdata; + + env->member = member; + env->hashtable = osync_hashtable_new(); + + osync_trace(TRACE_EXIT, "%s: %p", __func__, env); + return (void *)env; +} + +static void mock_connect(OSyncContext *ctx) +{ + osync_trace(TRACE_ENTRY, "%s(%p)", __func__, ctx); + mock_env *env = (mock_env *)osync_context_get_plugin_data(ctx); + + if (mock_get_error(env->member, "CONNECT_ERROR")) { + osync_context_report_error(ctx, OSYNC_ERROR_EXPECTED, "Triggering CONNECT_ERROR error"); + osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, "Triggering CONNECT_ERROR error"); + return; + } + + if (mock_get_error(env->member, "CONNECT_TIMEOUT")) { + osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, "Triggering CONNECT_TIMEOUT error"); + return; + } + + OSyncError *error = NULL; + if (!osync_hashtable_load(env->hashtable, env->member, &error)) { + osync_context_report_osyncerror(ctx, &error); + osync_trace(TRACE_EXIT_ERROR, "%s: %s", __func__, osync_error_print(error)); + osync_error_free(&error); + return; + } + + if (!osync_anchor_compare(env->member, "path", env->path)) + osync_member_set_slow_sync(env->member, "data", TRUE); + + GError *direrror = NULL; + + env->dir = g_dir_open(env->path, 0, &direrror); + if (direrror) { + //Unable to open directory + osync_context_report_error(ctx, OSYNC_ERROR_FILE_NOT_FOUND, "Unable to open directory %s", env->path); + g_error_free (direrror); + } else { + osync_context_report_success(ctx); + } + + osync_trace(TRACE_EXIT, "%s", __func__); +} + +static char *mock_generate_hash(mock_fileinfo *info) +{ + char *hash = g_strdup_printf("%i-%i", (int)info->filestats.st_mtime, (int)info->filestats.st_ctime); + return hash; +} + +static void mock_get_changeinfo(OSyncContext *ctx) +{ + mock_env *env = (mock_env *)osync_context_get_plugin_data(ctx); + + if (mock_get_error(env->member, "GET_CHANGES_ERROR")) { + osync_context_report_error(ctx, OSYNC_ERROR_EXPECTED, "Triggering GET_CHANGES_ERROR error"); + return; + } + if (mock_get_error(env->member, "GET_CHANGES_TIMEOUT")) + return; + if (mock_get_error(env->member, "GET_CHANGES_TIMEOUT2")) + sleep(8); + + if (osync_member_get_slow_sync(env->member, "data")) { + osync_debug("FILE-SYNC", 3, "Slow sync requested"); + osync_hashtable_set_slow_sync(env->hashtable, "data"); + } + + GDir *dir; + GError *gerror = NULL; + const char *de = NULL; + + dir = g_dir_open(env->path, 0, &gerror); + if (!dir) { + osync_trace(TRACE_EXIT_ERROR, "mock_report_dir: Unable to open directory %s: %s", path, gerror ? gerror->message : "None"); + return; + } + while ((de = g_dir_read_name(dir))) { + char *filename = g_build_filename(env->path, de, NULL); + if (g_file_test(filename, G_FILE_TEST_IS_REGULAR)) { + /* Report normal files */ + OSyncChange *change = osync_change_new(); + osync_change_set_member(change, env->member); + osync_change_set_uid(change, de); + + osync_change_set_objformat_string(change, "file"); + + mock_fileinfo *info = g_malloc0(sizeof(mock_fileinfo)); + + struct stat buf; + stat(filename, &buf); + char *hash = mock_generate_hash(&buf); + osync_change_set_hash(change, hash); + + if (mock_get_error(env->member, "ONLY_INFO")) { + osync_change_set_data(change, (char *)info, sizeof(mock_fileinfo), FALSE); + } else { + if (!osync_file_read(filename, &info->data, &info->size, &error)) { + osync_context_report_osyncerror(ctx, &error); + g_free(filename); + return; + } + + osync_change_set_data(change, (char *)file_info, sizeof(mock_fileinfo), TRUE); + } + + if (osync_hashtable_detect_change(env->hashtable, change)) { + osync_context_report_change(ctx, change); + osync_hashtable_update_hash(env->hashtable, change); + } + g_free(hash); + } + } + g_dir_close(dir); + + osync_context_report_success(ctx); +} + +static void mock_get_data(OSyncContext *ctx, OSyncChange *change) +{ + mock_env *env = (mock_env *)osync_context_get_plugin_data(ctx); + mock_fileinfo *file_info = (mock_fileinfo *)osync_change_get_data(change); + + if (mock_get_error(env->member, "GET_DATA_ERROR")) { + osync_context_report_error(ctx, OSYNC_ERROR_EXPECTED, "Triggering GET_DATA_ERROR error"); + return; + } + if (mock_get_error(env->member, "GET_DATA_TIMEOUT")) + return; + + char *filename = g_strdup_printf("%s/%s", env->path, osync_change_get_uid(change)); + OSyncError *error = NULL; + if (!osync_file_read(filename, &file_info->data, &file_info->size, &error)) { + osync_context_report_osyncerror(ctx, &error); + g_free(filename); + return; + } + + osync_change_set_data(change, (char *)file_info, sizeof(mock_fileinfo), TRUE); + g_free(filename); + + osync_context_report_success(ctx); +} + +static void mock_read(OSyncContext *ctx, OSyncChange *change) +{ + mock_env *env = (mock_env *)osync_context_get_plugin_data(ctx); + + char *filename = g_strdup_printf("%s/%s", env->path, osync_change_get_uid(change)); + + mock_fileinfo *info = g_malloc0(sizeof(mock_fileinfo)); + stat(filename, &info->filestats); + + OSyncError *error = NULL; + if (!osync_file_read(filename, &info->data, &info->size, &error)) { + osync_context_report_osyncerror(ctx, &error); + g_free(filename); + return; + } + + osync_change_set_data(change, (char *)info, sizeof(mock_fileinfo), TRUE); + + g_free(filename); + + osync_context_report_success(ctx); +} + +static osync_bool mock_access(OSyncContext *ctx, OSyncChange *change) +{ + /*TODO: Create directory for file, if it doesn't exist */ + osync_debug("FILE-SYNC", 4, "start: %s", __func__); + mock_env *env = (mock_env *)osync_context_get_plugin_data(ctx); + mock_fileinfo *file_info = (mock_fileinfo *)osync_change_get_data(change); + + char *filename = NULL; + OSyncError *error = NULL; + filename = g_strdup_printf ("%s/%s", env->path, osync_change_get_uid(change)); + + switch (osync_change_get_changetype(change)) { + case CHANGE_DELETED: + if (!remove(filename) == 0) { + osync_debug("FILE-SYNC", 0, "Unable to remove file %s", filename); + osync_context_report_error(ctx, OSYNC_ERROR_FILE_NOT_FOUND, "Unable to write"); + g_free(filename); + return FALSE; + } + break; + case CHANGE_ADDED: + if (g_file_test(filename, G_FILE_TEST_EXISTS)) { + osync_debug("FILE-SYNC", 0, "File %s already exists", filename); + osync_context_report_error(ctx, OSYNC_ERROR_EXISTS, "Entry already exists"); + g_free(filename); + return FALSE; + } + /* No break. Continue below */ + case CHANGE_MODIFIED: + //FIXME add permission and ownership for file-sync + if (!osync_file_write(filename, file_info->data, file_info->size, 0700, &error)) { + osync_debug("FILE-SYNC", 0, "Unable to write to file %s", filename); + osync_context_report_osyncerror(ctx, &error); + g_free(filename); + return FALSE; + } + stat(filename, &file_info->filestats); + osync_change_set_hash(change, mock_generate_hash(file_info)); + break; + default: + osync_debug("FILE-SYNC", 0, "Unknown change type"); + } + osync_context_report_success(ctx); + g_free(filename); + osync_debug("FILE-SYNC", 4, "end: %s", __func__); + return TRUE; +} + +static osync_bool mock_commit_change(OSyncContext *ctx, OSyncChange *change) +{ + osync_debug("FILE-SYNC", 4, "start: %s", __func__); + osync_debug("FILE-SYNC", 3, "Writing change %s with changetype %i", osync_change_get_uid(change), osync_change_get_changetype(change)); + mock_env *env = (mock_env *)osync_context_get_plugin_data(ctx); + + if (mock_get_error(env->member, "COMMIT_ERROR")) { + osync_context_report_error(ctx, OSYNC_ERROR_EXPECTED, "Triggering COMMIT_ERROR error"); + return FALSE; + } + if (mock_get_error(env->member, "COMMIT_TIMEOUT")) + return FALSE; + + if (!mock_access(ctx, change)) + return FALSE; + + osync_hashtable_update_hash(env->hashtable, change); + osync_debug("FILE-SYNC", 4, "end: %s", __func__); + return TRUE; +} + +static void mock_sync_done(OSyncContext *ctx) +{ + osync_debug("FILE-SYNC", 3, "start: %s", __func__); + mock_env *env = (mock_env *)osync_context_get_plugin_data(ctx); + + if (mock_get_error(env->member, "SYNC_DONE_ERROR")) { + osync_context_report_error(ctx, OSYNC_ERROR_EXPECTED, "Triggering SYNC_DONE_ERROR error"); + return; + } + if (mock_get_error(env->member, "SYNC_DONE_TIMEOUT")) + return; + + osync_anchor_update(env->member, "path", env->path); + osync_context_report_success(ctx); + osync_debug("FILE-SYNC", 3, "end: %s", __func__); +} + +static void mock_disconnect(OSyncContext *ctx) +{ + osync_debug("FILE-SYNC", 3, "start: %s", __func__); + mock_env *env = (mock_env *)osync_context_get_plugin_data(ctx); + + if (mock_get_error(env->member, "DISCONNECT_ERROR")) { + osync_context_report_error(ctx, OSYNC_ERROR_EXPECTED, "Triggering DISCONNECT_ERROR error"); + return; + } + if (mock_get_error(env->member, "DISCONNECT_TIMEOUT")) + return; + + g_dir_close(env->dir); + osync_hashtable_close(env->hashtable); + osync_context_report_success(ctx); + osync_debug("FILE-SYNC", 3, "end: %s", __func__); +} + +static void mock_finalize(void *data) +{ + osync_debug("FILE-SYNC", 3, "start: %s", __func__); + mock_env *env = (mock_env *)data; + osync_hashtable_free(env->hashtable); + + g_free(env->path); + g_free(env); +} + +static osync_bool mock_is_available(OSyncError **error) +{ + if (g_getenv("IS_NOT_AVAILABLE")) { + osync_error_set(error, OSYNC_ERROR_GENERIC, "file-sync plugin is not available"); + return FALSE; + } + return TRUE; +} + +static void mock_batch_commit(void *data, OSyncContext **contexts, OSyncChange **changes) +{ + mock_env *env = (mock_env *)data; + osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, env, contexts, changes); + osync_trace(TRACE_EXIT, "%s", __func__); +} + +static void mock_committed_all(void *data) +{ + mock_env *env = (mock_env *)data; + osync_trace(TRACE_ENTRY, "%s(%p)", __func__, env); + osync_trace(TRACE_EXIT, "%s", __func__); +} + +void get_info(OSyncPluginInfo *info) +{ + info->name = "mock-sync"; + info->longname = "Mock Plugin"; + info->description = "Mock Plugin"; + info->version = 1; + + info->functions.initialize = mock_initialize; + info->functions.connect = mock_connect; + info->functions.sync_done = mock_sync_done; + info->functions.disconnect = mock_disconnect; + info->functions.finalize = mock_finalize; + info->functions.get_changeinfo = mock_get_changeinfo; + info->functions.get_data = mock_get_data; + + osync_plugin_accept_objtype(info, "data"); + osync_plugin_accept_objformat(info, "data", "mockformat", NULL); + + osync_plugin_set_access_objformat(info, "data", "mockformat", mock_access); + osync_plugin_set_read_objformat(info, "data", "mockformat", mock_read); + + //Lets reduce the timeouts a bit so the checks work faster + info->timeouts.disconnect_timeout = 5; + info->timeouts.connect_timeout = 5; + info->timeouts.sync_done_timeout = 5; + info->timeouts.get_changeinfo_timeout = 5; + info->timeouts.get_data_timeout = 5; + info->timeouts.commit_timeout = 5; + + if (g_getenv("IS_AVAILABLE")) + info->functions.is_available = mock_is_available; + + if (g_getenv("BATCH_COMMIT1")) { + osync_plugin_set_batch_commit_objformat(info, "data", "mockformat", mock_batch_commit); + } else { + osync_plugin_set_commit_objformat(info, "data", "mockformat", mock_commit_change); + if (g_getenv("BATCH_COMMIT2")) + osync_plugin_set_committed_all_objformat(info, "data", "mockformat", mock_committed_all); + } +} Added: branches/experimental-branch/tests/mock-plugin/mock_sync.h =================================================================== --- branches/experimental-branch/tests/mock-plugin/mock_sync.h 2005-03-21 22:47:00 UTC (rev 387) +++ branches/experimental-branch/tests/mock-plugin/mock_sync.h 2005-03-21 22:47:53 UTC (rev 388) @@ -0,0 +1,16 @@ +#include <opensync/opensync.h> +#include <sys/stat.h> +#include <stdio.h> +#include <glib.h> +#include <string.h> +#include <config.h> + +#include <libxml/xmlmemory.h> +#include <libxml/parser.h> + +typedef struct mockenv { + char *path; + OSyncMember *member; + GDir *dir; + OSyncHashTable *hashtable; +} filesyncinfo; |
From: <svn...@op...> - 2005-03-21 22:46:18
|
Author: azrael Date: 2005-03-21 23:47:00 +0100 (Mon, 21 Mar 2005) New Revision: 387 Modified: branches/experimental-branch/plugins/file-sync/configure.in branches/experimental-branch/plugins/file-sync/src/file_sync.c Log: Removed the error testing stuff from the file-sync plugin Modified: branches/experimental-branch/plugins/file-sync/configure.in =================================================================== --- branches/experimental-branch/plugins/file-sync/configure.in 2005-03-21 22:35:50 UTC (rev 386) +++ branches/experimental-branch/plugins/file-sync/configure.in 2005-03-21 22:47:00 UTC (rev 387) @@ -34,21 +34,6 @@ AC_SUBST(OPENSYNC_FORMATSDIR) AC_SUBST(OPENSYNC_HEADERDIR) -AC_ARG_ENABLE(stress-tests, [ --enable-stress-tests enable support for stress testing],STRESS_TEST=$enableval) -if test "x${STRESS_TEST}" = "xyes"; then - AC_DEFINE(STRESS_TEST,1,[Stress Testing]) -fi - -AC_ARG_ENABLE(crash-tests, [ --enable-crash-tests enable support for crash testing],CRASH_TEST=$enableval) -if test "x${CRASH_TEST}" = "xyes"; then - AC_DEFINE(CRASH_TEST,1,[Crash Testing]) -fi - -AC_ARG_ENABLE(error-tests, [ --enable-error-tests enable support for error testing],ERROR_TEST=$enableval) -if test "x${ERROR_TEST}" = "xyes"; then - AC_DEFINE(ERROR_TEST,1,[Error Testing]) -fi - AC_CHECK_HEADER(fam.h,HAVE_FAM=1,HAVE_FAM=0) AM_CONDITIONAL(ENABLE_FAM, test x$HAVE_FAM = x1) AC_SUBST(HAVE_FAM) @@ -74,23 +59,6 @@ echo "have libfam-dev installed." fi echo "" -echo "Settings:" -if test "x${STRESS_TEST}" = "xyes"; then - echo "Stress Tests: Enabled" -else - echo "Stress Tests: Disabled" -fi -if test "x${ERROR_TEST}" = "xyes"; then - echo "Error Tests: Enabled" -else - echo "Error Tests: Disabled" -fi -if test "x${CRASH_TEST}" = "xyes"; then - echo "Crash Tests: Enabled" -else - echo "Crash Tests: Disabled" -fi -echo "" echo "Plugin will be installed in ${OPENSYNC_PLUGINDIR}" echo "Default config will be installed in ${OPENSYNC_CONFIGDIR}" echo "Format will be installed in ${OPENSYNC_FORMATSDIR}" Modified: branches/experimental-branch/plugins/file-sync/src/file_sync.c =================================================================== --- branches/experimental-branch/plugins/file-sync/src/file_sync.c 2005-03-21 22:35:50 UTC (rev 386) +++ branches/experimental-branch/plugins/file-sync/src/file_sync.c 2005-03-21 22:47:00 UTC (rev 387) @@ -21,32 +21,6 @@ #include "file_sync.h" #include <stdlib.h> -#ifdef ERROR_TEST -static osync_bool fs_get_error(OSyncMember *member, const char *domain) -{ - osync_debug("FILE-SYNC", 4, "checking error domain %s", domain); - const char *env = g_getenv(domain); - if (!env) - return FALSE; - - int num = atoi(env); - int mask = 1 << (osync_member_get_id(member) - 1); - osync_debug("FILE-SYNC", 2, "returning \"%s\" for error domain %s", (num & mask) ? "TRUE" : "FALSE", domain); - if (num & mask) { - char *chancestr = g_strdup_printf("%s_PROB", domain); - const char *chance = g_getenv(chancestr); - g_free(chancestr); - if (!chance) - return TRUE; - int prob = atoi(chance); - if (prob >= g_random_int_range(0, 100)) - return TRUE; - osync_debug("FILE-SYNC", 2, "returning \"FALSE\" for error domain %s", domain); - } - return FALSE; -} -#endif - #ifdef HAVE_FAM static gboolean _fam_prepare(GSource *source, gint *timeout_) { @@ -91,12 +65,7 @@ static void *fs_initialize(OSyncMember *member, OSyncError **error) { osync_debug("FILE-SYNC", 4, "start: %s", __func__); -#ifdef ERROR_TEST - if (fs_get_error(member, "INIT_NULL")) { - osync_error_set(error, OSYNC_ERROR_EXPECTED, "Triggering INIT_NULL error"); - return NULL; - } -#endif + char *configdata; int configsize; filesyncinfo *fsinfo = g_malloc0(sizeof(filesyncinfo)); @@ -141,15 +110,6 @@ osync_debug("FILE-SYNC", 4, "start: %s", __func__); filesyncinfo *fsinfo = (filesyncinfo *)osync_context_get_plugin_data(ctx); -#ifdef ERROR_TEST - if (fs_get_error(fsinfo->member, "CONNECT_ERROR")) { - osync_context_report_error(ctx, OSYNC_ERROR_EXPECTED, "Triggering CONNECT_ERROR error"); - return; - } - if (fs_get_error(fsinfo->member, "CONNECT_TIMEOUT")) - return; -#endif - OSyncError *error = NULL; if (!osync_hashtable_load(fsinfo->hashtable, fsinfo->member, &error)) { osync_context_report_osyncerror(ctx, &error); @@ -260,17 +220,6 @@ osync_debug("FILE-SYNC", 4, "start: %s", __func__); filesyncinfo *fsinfo = (filesyncinfo *)osync_context_get_plugin_data(ctx); -#ifdef ERROR_TEST - if (fs_get_error(fsinfo->member, "GET_CHANGES_ERROR")) { - osync_context_report_error(ctx, OSYNC_ERROR_EXPECTED, "Triggering GET_CHANGES_ERROR error"); - return; - } - if (fs_get_error(fsinfo->member, "GET_CHANGES_TIMEOUT")) - return; - if (fs_get_error(fsinfo->member, "GET_CHANGES_TIMEOUT2")) - sleep(8); -#endif - if (osync_member_get_slow_sync(fsinfo->member, "data")) { osync_debug("FILE-SYNC", 3, "Slow sync requested"); osync_hashtable_set_slow_sync(fsinfo->hashtable, "data"); @@ -291,15 +240,6 @@ filesyncinfo *fsinfo = (filesyncinfo *)osync_context_get_plugin_data(ctx); fs_fileinfo *file_info = (fs_fileinfo *)osync_change_get_data(change); -#ifdef ERROR_TEST - if (fs_get_error(fsinfo->member, "GET_DATA_ERROR")) { - osync_context_report_error(ctx, OSYNC_ERROR_EXPECTED, "Triggering GET_DATA_ERROR error"); - return; - } - if (fs_get_error(fsinfo->member, "GET_DATA_TIMEOUT")) - return; -#endif - char *filename = g_strdup_printf("%s/%s", fsinfo->path, osync_change_get_uid(change)); OSyncError *error = NULL; if (!osync_file_read(filename, &file_info->data, &file_info->size, &error)) { @@ -394,15 +334,6 @@ osync_debug("FILE-SYNC", 3, "Writing change %s with changetype %i", osync_change_get_uid(change), osync_change_get_changetype(change)); filesyncinfo *fsinfo = (filesyncinfo *)osync_context_get_plugin_data(ctx); -#ifdef ERROR_TEST - if (fs_get_error(fsinfo->member, "COMMIT_ERROR")) { - osync_context_report_error(ctx, OSYNC_ERROR_EXPECTED, "Triggering COMMIT_ERROR error"); - return FALSE; - } - if (fs_get_error(fsinfo->member, "COMMIT_TIMEOUT")) - return FALSE; -#endif - if (!fs_access(ctx, change)) return FALSE; @@ -416,15 +347,6 @@ osync_debug("FILE-SYNC", 3, "start: %s", __func__); filesyncinfo *fsinfo = (filesyncinfo *)osync_context_get_plugin_data(ctx); -#ifdef ERROR_TEST - if (fs_get_error(fsinfo->member, "SYNC_DONE_ERROR")) { - osync_context_report_error(ctx, OSYNC_ERROR_EXPECTED, "Triggering SYNC_DONE_ERROR error"); - return; - } - if (fs_get_error(fsinfo->member, "SYNC_DONE_TIMEOUT")) - return; -#endif - //osync_hashtable_forget(fsinfo->hashtable); osync_anchor_update(fsinfo->member, "path", fsinfo->path); osync_context_report_success(ctx); @@ -436,15 +358,6 @@ osync_debug("FILE-SYNC", 3, "start: %s", __func__); filesyncinfo *fsinfo = (filesyncinfo *)osync_context_get_plugin_data(ctx); -#ifdef ERROR_TEST - if (fs_get_error(fsinfo->member, "DISCONNECT_ERROR")) { - osync_context_report_error(ctx, OSYNC_ERROR_EXPECTED, "Triggering DISCONNECT_ERROR error"); - return; - } - if (fs_get_error(fsinfo->member, "DISCONNECT_TIMEOUT")) - return; -#endif - g_dir_close(fsinfo->dir); osync_hashtable_close(fsinfo->hashtable); osync_context_report_success(ctx); @@ -465,31 +378,6 @@ g_free(fsinfo); } -#ifdef ERROR_TEST -static osync_bool fs_is_available(OSyncError **error) -{ - if (g_getenv("IS_NOT_AVAILABLE")) { - osync_error_set(error, OSYNC_ERROR_GENERIC, "file-sync plugin is not available"); - return FALSE; - } - return TRUE; -} - -static void fs_batch_commit(void *data, OSyncContext **contexts, OSyncChange **changes) -{ - filesyncinfo *env = (filesyncinfo *)data; - osync_trace(TRACE_ENTRY, "%s(%p, %p, %p)", __func__, env, contexts, changes); - osync_trace(TRACE_EXIT, "%s", __func__); -} - -static void fs_committed_all(void *data) -{ - filesyncinfo *env = (filesyncinfo *)data; - osync_trace(TRACE_ENTRY, "%s(%p)", __func__, env); - osync_trace(TRACE_EXIT, "%s", __func__); -} -#endif - void get_info(OSyncPluginInfo *info) { info->name = "file-sync"; @@ -512,24 +400,4 @@ osync_plugin_set_access_objformat(info, "data", "file", fs_access); osync_plugin_set_read_objformat(info, "data", "file", fs_read); -#ifdef ERROR_TEST - //Lets reduce the timeouts a bit so the checks work faster - info->timeouts.disconnect_timeout = 5; - info->timeouts.connect_timeout = 5; - info->timeouts.sync_done_timeout = 5; - info->timeouts.get_changeinfo_timeout = 5; - info->timeouts.get_data_timeout = 5; - info->timeouts.commit_timeout = 5; - - if (g_getenv("IS_AVAILABLE")) - info->functions.is_available = fs_is_available; - - if (g_getenv("BATCH_COMMIT1")) - osync_plugin_set_batch_commit_objformat(info, "data", "file", fs_batch_commit); - - if (g_getenv("BATCH_COMMIT2")) - osync_plugin_set_committed_all_objformat(info, "data", "file", fs_committed_all); -#endif - - } |
From: <svn...@op...> - 2005-03-21 22:35:11
|
Author: azrael Date: 2005-03-21 23:35:50 +0100 (Mon, 21 Mar 2005) New Revision: 386 Added: branches/experimental-branch/ Log: Recreated experimental branch Copied: branches/experimental-branch (from rev 384, trunk) |
From: <svn...@op...> - 2005-03-21 22:33:05
|
Author: azrael Date: 2005-03-21 23:33:46 +0100 (Mon, 21 Mar 2005) New Revision: 385 Removed: branches/experimental-branch/ Log: Deleted old experimental branch |
From: <svn...@op...> - 2005-03-21 17:03:59
|
Author: azrael Date: 2005-03-21 18:04:35 +0100 (Mon, 21 Mar 2005) New Revision: 384 Modified: trunk/formats/vformats-xml/vformat.c trunk/formats/vformats-xml/xml-evolution.c trunk/formats/vformats-xml/xml-kde.c trunk/formats/vformats-xml/xml-support.c trunk/formats/vformats-xml/xml-vcal.c trunk/formats/vformats-xml/xml-vcard.c trunk/formats/vformats-xml/xml-vnote.c trunk/opensync/opensync_db.c trunk/opensync/opensync_env.c trunk/opensync/opensync_group.c trunk/opensync/opensync_hashtable.c trunk/opensync/opensync_member.c trunk/tools/osyncdump.c Log: Made opensync compile with gcc4. Thanks to pierre for the patch Modified: trunk/formats/vformats-xml/vformat.c =================================================================== --- trunk/formats/vformats-xml/vformat.c 2005-03-21 16:47:55 UTC (rev 383) +++ trunk/formats/vformats-xml/vformat.c 2005-03-21 17:04:35 UTC (rev 384) @@ -916,7 +916,7 @@ break; } case VF_ENCODING_QP: { - char *qp_data = quoted_encode_simple (value, len); + char *qp_data = quoted_encode_simple ((unsigned char*)value, len); GString *decoded = g_string_new (value); /* make sure the decoded list is up to date */ @@ -1483,7 +1483,7 @@ static size_t base64_decode_step(unsigned char *in, size_t len, unsigned char *out, int *state, unsigned int *save) { unsigned char base64_rank[256]; - base64_init(base64_rank); + base64_init((char*)base64_rank); register unsigned char *inptr, *outptr; unsigned char *inend, c; @@ -1540,7 +1540,7 @@ out = g_malloc (len * 4 / 3 + 5); outlen = base64_encode_close ((unsigned char *)data, len, FALSE, - out, &state, &save); + out, &state, (int*)&save); out[outlen] = '\0'; return (char *)out; } Modified: trunk/formats/vformats-xml/xml-evolution.c =================================================================== --- trunk/formats/vformats-xml/xml-evolution.c 2005-03-21 16:47:55 UTC (rev 383) +++ trunk/formats/vformats-xml/xml-evolution.c 2005-03-21 17:04:35 UTC (rev 384) @@ -27,7 +27,7 @@ static xmlNode *handle_x_aim_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling x-aim attribute"); - xmlNode *current = xmlNewChild(root, NULL, "IM-AIM", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"IM-AIM", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -35,7 +35,7 @@ static xmlNode *handle_file_as_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling FileAs attribute"); - xmlNode *current = xmlNewChild(root, NULL, "FileAs", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"FileAs", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -43,7 +43,7 @@ static xmlNode *handle_manager_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling Manager attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Manager", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Manager", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -51,7 +51,7 @@ static xmlNode *handle_assistant_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling Assistant attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Assistant", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Assistant", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -59,7 +59,7 @@ static xmlNode *handle_anniversary_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling Anniversary attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Anniversary", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Anniversary", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -67,7 +67,7 @@ static xmlNode *handle_spouse_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling Spouse attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Spouse", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Spouse", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -75,7 +75,7 @@ static xmlNode *handle_blog_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling BlogUrl attribute"); - xmlNode *current = xmlNewChild(root, NULL, "BlogUrl", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"BlogUrl", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -83,7 +83,7 @@ static xmlNode *handle_calendar_url_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling CalendarUrl attribute"); - xmlNode *current = xmlNewChild(root, NULL, "CalendarUrl", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"CalendarUrl", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -91,7 +91,7 @@ static xmlNode *handle_free_busy_url_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling FreeBusyUrl attribute"); - xmlNode *current = xmlNewChild(root, NULL, "FreeBusyUrl", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"FreeBusyUrl", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -99,7 +99,7 @@ static xmlNode *handle_video_chat_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling VideoUrl attribute"); - xmlNode *current = xmlNewChild(root, NULL, "VideoUrl", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"VideoUrl", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -107,7 +107,7 @@ static xmlNode *handle_wants_html_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling WantsHtml attribute"); - xmlNode *current = xmlNewChild(root, NULL, "WantsHtml", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"WantsHtml", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -115,7 +115,7 @@ static xmlNode *handle_yahoo_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling IM-Yahoo attribute"); - xmlNode *current = xmlNewChild(root, NULL, "IM-Yahoo", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"IM-Yahoo", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -123,7 +123,7 @@ static xmlNode *handle_icq_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling IM-ICQ attribute"); - xmlNode *current = xmlNewChild(root, NULL, "IM-ICQ", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"IM-ICQ", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -131,7 +131,7 @@ static xmlNode *handle_groupwise_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling GroupwiseDirectory attribute"); - xmlNode *current = xmlNewChild(root, NULL, "GroupwiseDirectory", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"GroupwiseDirectory", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -139,7 +139,7 @@ static xmlNode *handle_jabber_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling Jabber attribute"); - xmlNode *current = xmlNewChild(root, NULL, "IM-Jabber", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"IM-Jabber", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -147,7 +147,7 @@ static xmlNode *handle_msn_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling MSN attribute"); - xmlNode *current = xmlNewChild(root, NULL, "IM-MSN", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"IM-MSN", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -156,7 +156,7 @@ static xmlNode *handle_role_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling role attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Profession", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Profession", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -164,37 +164,38 @@ static void handle_slot_parameter(xmlNode *current, VFormatParam *param) { osync_trace(TRACE_INTERNAL, "Handling Slot parameter %s", vformat_attribute_param_get_name(param)); - xmlNewChild(current, NULL, "Slot", vformat_attribute_param_get_nth_value(param, 0)); + xmlNewChild(current, NULL, (xmlChar*)"Slot", + (xmlChar*)vformat_attribute_param_get_nth_value(param, 0)); } static void handle_assistant_parameter(xmlNode *current, VFormatParam *param) { osync_trace(TRACE_INTERNAL, "Handling Assistant parameter %s", vformat_attribute_param_get_name(param)); - xmlNewChild(current, NULL, "Type", "Assistant"); + xmlNewChild(current, NULL, (xmlChar*)"Type", (xmlChar*)"Assistant"); } static void handle_callback_parameter(xmlNode *current, VFormatParam *param) { osync_trace(TRACE_INTERNAL, "Handling Callback parameter %s", vformat_attribute_param_get_name(param)); - xmlNewChild(current, NULL, "Type", "Callback"); + xmlNewChild(current, NULL, (xmlChar*)"Type", (xmlChar*)"Callback"); } static void handle_company_parameter(xmlNode *current, VFormatParam *param) { osync_trace(TRACE_INTERNAL, "Handling Company parameter %s", vformat_attribute_param_get_name(param)); - xmlNewChild(current, NULL, "Type", "Company"); + xmlNewChild(current, NULL, (xmlChar*)"Type", (xmlChar*)"Company"); } static void handle_telex_parameter(xmlNode *current, VFormatParam *param) { osync_trace(TRACE_INTERNAL, "Handling Telex parameter %s", vformat_attribute_param_get_name(param)); - xmlNewChild(current, NULL, "Type", "Telex"); + xmlNewChild(current, NULL, (xmlChar*)"Type", (xmlChar*)"Telex"); } static void handle_radio_parameter(xmlNode *current, VFormatParam *param) { osync_trace(TRACE_INTERNAL, "Handling Radio parameter %s", vformat_attribute_param_get_name(param)); - xmlNewChild(current, NULL, "Type", "Radio"); + xmlNewChild(current, NULL, (xmlChar*)"Type", (xmlChar*)"Radio"); } static osync_bool init_x_evo_to_xml(void *input) @@ -244,7 +245,7 @@ i++; } } else { - return !g_utf8_validate(tmp, -1, NULL); + return !g_utf8_validate((gchar*)tmp, -1, NULL); } return FALSE; } @@ -266,11 +267,11 @@ if (!tmp) return; - if (needs_charset(tmp)) + if (needs_charset((unsigned char*)tmp)) if (!vformat_attribute_has_param (attr, "CHARSET")) vformat_attribute_add_param_with_value(attr, "CHARSET", "UTF-8"); - if (needs_encoding(tmp, encoding)) { + if (needs_encoding((unsigned char*)tmp, encoding)) { if (!vformat_attribute_has_param (attr, "ENCODING")) vformat_attribute_add_param_with_value(attr, "ENCODING", encoding); vformat_attribute_add_value_decoded(attr, tmp, strlen(tmp) + 1); @@ -436,7 +437,7 @@ static void handle_xml_slot_parameter(VFormatAttribute *attr, xmlNode *current) { osync_trace(TRACE_INTERNAL, "Handling slot xml parameter"); - char *content = xmlNodeGetContent(current); + char *content = (char*)xmlNodeGetContent(current); vformat_attribute_add_param_with_value(attr, "X-EVOLUTION-UI-SLOT", content); g_free(content); } Modified: trunk/formats/vformats-xml/xml-kde.c =================================================================== --- trunk/formats/vformats-xml/xml-kde.c 2005-03-21 16:47:55 UTC (rev 383) +++ trunk/formats/vformats-xml/xml-kde.c 2005-03-21 17:04:35 UTC (rev 384) @@ -27,7 +27,7 @@ static xmlNode *handle_aim_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling x-aim attribute"); - xmlNode *current = xmlNewChild(root, NULL, "IM-AIM", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"IM-AIM", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -35,7 +35,7 @@ static xmlNode *handle_manager_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling Manager attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Manager", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Manager", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -43,7 +43,7 @@ static xmlNode *handle_assistant_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling Assistant attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Assistant", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Assistant", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -51,7 +51,7 @@ static xmlNode *handle_anniversary_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling Anniversary attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Anniversary", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Anniversary", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -59,7 +59,7 @@ static xmlNode *handle_spouse_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling Spouse attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Spouse", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Spouse", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -67,7 +67,7 @@ static xmlNode *handle_yahoo_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling IM-Yahoo attribute"); - xmlNode *current = xmlNewChild(root, NULL, "IM-Yahoo", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"IM-Yahoo", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -75,7 +75,7 @@ static xmlNode *handle_icq_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling IM-ICQ attribute"); - xmlNode *current = xmlNewChild(root, NULL, "IM-ICQ", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"IM-ICQ", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -83,7 +83,7 @@ static xmlNode *handle_jabber_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling Jabber attribute"); - xmlNode *current = xmlNewChild(root, NULL, "IM-Jabber", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"IM-Jabber", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -91,7 +91,7 @@ static xmlNode *handle_msn_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling MSN attribute"); - xmlNode *current = xmlNewChild(root, NULL, "IM-MSN", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"IM-MSN", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -103,7 +103,7 @@ //We need to check first if the node already exists. if (!(current = osxml_get_node(root, "Organization"))) - current = xmlNewChild(root, NULL, "Organization", NULL); + current = xmlNewChild(root, NULL, (xmlChar*)"Organization", NULL); osxml_node_add(current, "Department", vformat_attribute_get_nth_value(attr, 0)); return current; @@ -116,7 +116,7 @@ //We need to check first if the node already exists. if (!(current = osxml_get_node(root, "Organization"))) - current = xmlNewChild(root, NULL, "Organization", NULL); + current = xmlNewChild(root, NULL, (xmlChar*)"Organization", NULL); osxml_node_add(current, "Unit", vformat_attribute_get_nth_value(attr, 0)); return current; @@ -125,7 +125,7 @@ static xmlNode *handle_profession_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling profession attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Profession", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Profession", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -133,7 +133,7 @@ static xmlNode *handle_gadu_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling gadu attribute"); - xmlNode *current = xmlNewChild(root, NULL, "IM-GaduGadu", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"IM-GaduGadu", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -141,7 +141,7 @@ static xmlNode *handle_irc_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling IRC attribute"); - xmlNode *current = xmlNewChild(root, NULL, "IRC", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"IRC", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -149,7 +149,7 @@ static xmlNode *handle_sms_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling SMS attribute"); - xmlNode *current = xmlNewChild(root, NULL, "SMS", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"SMS", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -161,7 +161,7 @@ //We need to check first if the node already exists. if (!(current = osxml_get_node(root, "Organization"))) - current = xmlNewChild(root, NULL, "Organization", NULL); + current = xmlNewChild(root, NULL, (xmlChar*)"Organization", NULL); osxml_node_add(current, "Name", vformat_attribute_get_nth_value(attr, 0)); osxml_node_add(current, "Department", vformat_attribute_get_nth_value(attr, 1)); @@ -179,7 +179,7 @@ static xmlNode *handle_x_kde_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling X-KDE attribute"); - xmlNode *current = xmlNewChild(root, NULL, "KDE-Extension", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"KDE-Extension", NULL); osxml_node_add(current, "ExtName", vformat_attribute_get_name(attr)); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; @@ -230,7 +230,7 @@ i++; } } else { - return !g_utf8_validate(tmp, -1, NULL); + return !g_utf8_validate((gchar*)tmp, -1, NULL); } return FALSE; } @@ -252,11 +252,11 @@ if (!tmp) return; - if (needs_charset(tmp)) + if (needs_charset((unsigned char*)tmp)) if (!vformat_attribute_has_param (attr, "CHARSET")) vformat_attribute_add_param_with_value(attr, "CHARSET", "UTF-8"); - if (needs_encoding(tmp, encoding)) { + if (needs_encoding((unsigned char*)tmp, encoding)) { if (!vformat_attribute_has_param (attr, "ENCODING")) vformat_attribute_add_param_with_value(attr, "ENCODING", encoding); vformat_attribute_add_value_decoded(attr, tmp, strlen(tmp) + 1); @@ -356,19 +356,19 @@ int i = 0; while (root) { - char *content = xmlNodeGetContent(root); - if (!strcmp(root->name, "Name")) { + char *content = (char*)xmlNodeGetContent(root); + if (!strcmp((char*)root->name, "Name")) { org = vformat_attribute_new(NULL, "ORG"); vformat_attribute_add_value(org, content); vformat_add_attribute(vcard, org); } - if (!strcmp(root->name, "Department")) { + if (!strcmp((char*)root->name, "Department")) { attr = vformat_attribute_new(NULL, "X-KADDRESSBOOK-X-Department"); vformat_attribute_add_value(attr, content); vformat_add_attribute(vcard, attr); } - if (!strcmp(root->name, "Unit")) { + if (!strcmp((char*)root->name, "Unit")) { switch (i) { case 0: attr = vformat_attribute_new(NULL, "X-KADDRESSBOOK-X-Office"); Modified: trunk/formats/vformats-xml/xml-support.c =================================================================== --- trunk/formats/vformats-xml/xml-support.c 2005-03-21 16:47:55 UTC (rev 383) +++ trunk/formats/vformats-xml/xml-support.c 2005-03-21 17:04:35 UTC (rev 384) @@ -23,7 +23,7 @@ xmlNode *osxml_node_add_root(xmlDoc *doc, const char *name) { - doc->children = xmlNewDocNode(doc, NULL, name, NULL); + doc->children = xmlNewDocNode(doc, NULL, (xmlChar*)name, NULL); return doc->children; } @@ -47,10 +47,10 @@ void osxml_node_set(xmlNode *node, const char *name, const char *data, OSyncXMLEncoding encoding) { if (name) - xmlNodeSetName(node, name); //FIXME Free previous name? + xmlNodeSetName(node, (xmlChar*)name); //FIXME Free previous name? if (data) - xmlNewTextChild(node, NULL, "Content", data); + xmlNewTextChild(node, NULL, (xmlChar*)"Content", (xmlChar*)data); } xmlNode *osxml_node_add(xmlNode *parent, const char *name, const char *data) @@ -59,24 +59,24 @@ return NULL; if (strlen(data) == 0) return NULL; - xmlNode *node = xmlNewTextChild(parent, NULL, name, data); + xmlNode *node = xmlNewTextChild(parent, NULL, (xmlChar*)name, (xmlChar*)data); return node; } void osxml_node_add_property(xmlNode *parent, const char *name, const char *data) { - xmlNewProp(parent, name, data); + xmlNewProp(parent, (xmlChar*)name, (xmlChar*)data); } void osxml_node_mark_unknown(xmlNode *parent) { - if (!xmlHasProp(parent, "Type")) - xmlNewProp(parent, "Type", "Unknown"); + if (!xmlHasProp(parent, (xmlChar*)"Type")) + xmlNewProp(parent, (xmlChar*)"Type", (xmlChar*)"Unknown"); } void osxml_node_remove_unknown_mark(xmlNode *node) { - xmlAttr *attr = xmlHasProp(node, "Type"); + xmlAttr *attr = xmlHasProp(node, (xmlChar*)"Type"); if (!attr) return; xmlRemoveProp(attr); @@ -95,7 +95,7 @@ char *osxml_find_node(xmlNode *parent, const char *name) { - return xmlNodeGetContent(osxml_get_node(parent, name)); + return (char*)xmlNodeGetContent(osxml_get_node(parent, name)); } xmlXPathObject *osxml_get_nodeset(xmlDoc *doc, const char *expression) @@ -111,7 +111,7 @@ } /* Evaluate xpath expression */ - xpathObj = xmlXPathEvalExpression(expression, xpathCtx); + xpathObj = xmlXPathEvalExpression((xmlChar*)expression, xpathCtx); if(xpathObj == NULL) { fprintf(stderr,"Error: unable to evaluate xpath expression \"%s\"\n", expression); xmlXPathFreeContext(xpathCtx); @@ -160,24 +160,24 @@ osync_bool osxml_has_property_full(xmlNode *parent, const char *name, const char *data) { if (osxml_has_property(parent, name)) - return (strcmp(xmlGetProp(parent, name), data) == 0); + return (strcmp((char*)xmlGetProp(parent, (xmlChar*)name), data) == 0); return FALSE; } char *osxml_find_property(xmlNode *parent, const char *name) { - return xmlGetProp(parent, name); + return (char*)xmlGetProp(parent, (xmlChar*)name); } osync_bool osxml_has_property(xmlNode *parent, const char *name) { - return (xmlHasProp(parent, name) != NULL); + return (xmlHasProp(parent, (xmlChar*)name) != NULL); } static osync_bool osxml_compare_node(xmlNode *leftnode, xmlNode *rightnode) { osync_trace(TRACE_ENTRY, "%s(%p:%s, %p:%s)", __func__, leftnode, leftnode->name, rightnode, rightnode->name); - if (strcmp(leftnode->name, rightnode->name)) { + if (strcmp((char*)leftnode->name, (char*)rightnode->name)) { osync_trace(TRACE_EXIT, "%s: FALSE: Different Name", __func__); return FALSE; } @@ -197,17 +197,17 @@ } do { - if (!strcmp("UnknownParam", leftnode->name)) + if (!strcmp("UnknownParam", (char*)leftnode->name)) continue; - if (!strcmp("Order", leftnode->name)) + if (!strcmp("Order", (char*)leftnode->name)) continue; rightnode = rightstartnode; - char *leftcontent = xmlNodeGetContent(leftnode); + char *leftcontent = (char*)xmlNodeGetContent(leftnode); do { - if (!strcmp("UnknownParam", rightnode->name)) + if (!strcmp("UnknownParam", (char*)rightnode->name)) continue; - char *rightcontent = xmlNodeGetContent(rightnode); + char *rightcontent = (char*)xmlNodeGetContent(rightnode); osync_trace(TRACE_INTERNAL, "leftcontent %s (%s), rightcontent %s (%s)", leftcontent, leftnode->name, rightcontent, rightnode->name); if (leftcontent == rightcontent) { Modified: trunk/formats/vformats-xml/xml-vcal.c =================================================================== --- trunk/formats/vformats-xml/xml-vcal.c 2005-03-21 16:47:55 UTC (rev 383) +++ trunk/formats/vformats-xml/xml-vcal.c 2005-03-21 17:04:35 UTC (rev 384) @@ -26,100 +26,118 @@ static void handle_unknown_parameter(xmlNode *current, VFormatParam *param) { osync_trace(TRACE_INTERNAL, "Handling unknown parameter %s", vformat_attribute_param_get_name(param)); - xmlNode *property = xmlNewChild(current, NULL, "UnknownParam", vformat_attribute_param_get_nth_value(param, 0)); + xmlNode *property = xmlNewChild(current, NULL, (xmlChar*)"UnknownParam", + (xmlChar*)vformat_attribute_param_get_nth_value(param, 0)); osxml_node_add(property, "ParamName", vformat_attribute_param_get_name(param)); } static void handle_tzid_parameter(xmlNode *current, VFormatParam *param) { osync_trace(TRACE_INTERNAL, "Handling tzid parameter"); - xmlNewChild(current, NULL, "TimezoneID", vformat_attribute_param_get_nth_value(param, 0)); + xmlNewChild(current, NULL, (xmlChar*)"TimezoneID", + (xmlChar*)vformat_attribute_param_get_nth_value(param, 0)); } static void handle_value_parameter(xmlNode *current, VFormatParam *param) { - xmlNewChild(current, NULL, "Value", vformat_attribute_param_get_nth_value(param, 0)); + xmlNewChild(current, NULL, (xmlChar*)"Value", + (xmlChar*)vformat_attribute_param_get_nth_value(param, 0)); } static void handle_altrep_parameter(xmlNode *current, VFormatParam *param) { - xmlNewChild(current, NULL, "AlternateRep", vformat_attribute_param_get_nth_value(param, 0)); + xmlNewChild(current, NULL, (xmlChar*)"AlternateRep", + (xmlChar*)vformat_attribute_param_get_nth_value(param, 0)); } static void handle_cn_parameter(xmlNode *current, VFormatParam *param) { - xmlNewChild(current, NULL, "CommonName", vformat_attribute_param_get_nth_value(param, 0)); + xmlNewChild(current, NULL, (xmlChar*)"CommonName", + (xmlChar*)vformat_attribute_param_get_nth_value(param, 0)); } static void handle_delegated_from_parameter(xmlNode *current, VFormatParam *param) { - xmlNewChild(current, NULL, "DelegatedFrom", vformat_attribute_param_get_nth_value(param, 0)); + xmlNewChild(current, NULL, (xmlChar*)"DelegatedFrom", + (xmlChar*)vformat_attribute_param_get_nth_value(param, 0)); } static void handle_delegated_to_parameter(xmlNode *current, VFormatParam *param) { - xmlNewChild(current, NULL, "DelegatedTo", vformat_attribute_param_get_nth_value(param, 0)); + xmlNewChild(current, NULL, (xmlChar*)"DelegatedTo", + (xmlChar*)vformat_attribute_param_get_nth_value(param, 0)); } static void handle_dir_parameter(xmlNode *current, VFormatParam *param) { - xmlNewChild(current, NULL, "Directory", vformat_attribute_param_get_nth_value(param, 0)); + xmlNewChild(current, NULL, (xmlChar*)"Directory", + (xmlChar*)vformat_attribute_param_get_nth_value(param, 0)); } static void handle_format_type_parameter(xmlNode *current, VFormatParam *param) { - xmlNewChild(current, NULL, "FormaType", vformat_attribute_param_get_nth_value(param, 0)); + xmlNewChild(current, NULL, (xmlChar*)"FormaType", + (xmlChar*)vformat_attribute_param_get_nth_value(param, 0)); } static void handle_fb_type_parameter(xmlNode *current, VFormatParam *param) { - xmlNewChild(current, NULL, "FreeBusyType", vformat_attribute_param_get_nth_value(param, 0)); + xmlNewChild(current, NULL, (xmlChar*)"FreeBusyType", + (xmlChar*)vformat_attribute_param_get_nth_value(param, 0)); } static void handle_member_parameter(xmlNode *current, VFormatParam *param) { - xmlNewChild(current, NULL, "Member", vformat_attribute_param_get_nth_value(param, 0)); + xmlNewChild(current, NULL, (xmlChar*)"Member", + (xmlChar*)vformat_attribute_param_get_nth_value(param, 0)); } static void handle_partstat_parameter(xmlNode *current, VFormatParam *param) { - xmlNewChild(current, NULL, "PartStat", vformat_attribute_param_get_nth_value(param, 0)); + xmlNewChild(current, NULL, (xmlChar*)"PartStat", + (xmlChar*)vformat_attribute_param_get_nth_value(param, 0)); } static void handle_range_parameter(xmlNode *current, VFormatParam *param) { - xmlNewChild(current, NULL, "Range", vformat_attribute_param_get_nth_value(param, 0)); + xmlNewChild(current, NULL, (xmlChar*)"Range", + (xmlChar*)vformat_attribute_param_get_nth_value(param, 0)); } static void handle_related_parameter(xmlNode *current, VFormatParam *param) { - xmlNewChild(current, NULL, "Related", vformat_attribute_param_get_nth_value(param, 0)); + xmlNewChild(current, NULL, (xmlChar*)"Related", + (xmlChar*)vformat_attribute_param_get_nth_value(param, 0)); } static void handle_reltype_parameter(xmlNode *current, VFormatParam *param) { - xmlNewChild(current, NULL, "RelationType", vformat_attribute_param_get_nth_value(param, 0)); + xmlNewChild(current, NULL, (xmlChar*)"RelationType", + (xmlChar*)vformat_attribute_param_get_nth_value(param, 0)); } static void handle_role_parameter(xmlNode *current, VFormatParam *param) { - xmlNewChild(current, NULL, "Role", vformat_attribute_param_get_nth_value(param, 0)); + xmlNewChild(current, NULL, (xmlChar*)"Role", + (xmlChar*)vformat_attribute_param_get_nth_value(param, 0)); } static void handle_rsvp_parameter(xmlNode *current, VFormatParam *param) { - xmlNewChild(current, NULL, "RSVP", vformat_attribute_param_get_nth_value(param, 0)); + xmlNewChild(current, NULL, (xmlChar*)"RSVP", + (xmlChar*)vformat_attribute_param_get_nth_value(param, 0)); } static void handle_sent_by_parameter(xmlNode *current, VFormatParam *param) { - xmlNewChild(current, NULL, "SentBy", vformat_attribute_param_get_nth_value(param, 0)); + xmlNewChild(current, NULL, (xmlChar*)"SentBy", + (xmlChar*)vformat_attribute_param_get_nth_value(param, 0)); } static xmlNode *handle_unknown_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling unknown attribute %s", vformat_attribute_get_name(attr)); - xmlNode *current = xmlNewChild(root, NULL, "UnknownNode", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"UnknownNode", NULL); osxml_node_add(current, "NodeName", vformat_attribute_get_name(attr)); GList *values = vformat_attribute_get_values_decoded(attr); for (; values; values = values->next) { @@ -133,7 +151,7 @@ static xmlNode *handle_prodid_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling prodid attribute"); - xmlNode *current = xmlNewChild(root, NULL, "ProductID", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"ProductID", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -141,7 +159,7 @@ static xmlNode *handle_method_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling method attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Method", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Method", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -149,7 +167,7 @@ static xmlNode *handle_dtstamp_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling dtstamp attribute"); - xmlNode *current = xmlNewChild(root, NULL, "DateCalendarCreated", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"DateCalendarCreated", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -157,7 +175,7 @@ static xmlNode *handle_percent_complete_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling percent complete attribute"); - xmlNode *current = xmlNewChild(root, NULL, "PercentComplete", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"PercentComplete", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -165,7 +183,7 @@ static xmlNode *handle_created_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling created attribute"); - xmlNode *current = xmlNewChild(root, NULL, "DateCreated", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"DateCreated", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -173,7 +191,7 @@ static xmlNode *handle_dtstart_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling dtstart attribute"); - xmlNode *current = xmlNewChild(root, NULL, "DateStarted", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"DateStarted", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -181,7 +199,7 @@ static xmlNode *handle_rrule_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling rrule attribute"); - xmlNode *current = xmlNewChild(root, NULL, "RecurrenceRule", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"RecurrenceRule", NULL); GList *values = vformat_attribute_get_values_decoded(attr); for (; values; values = values->next) { @@ -196,7 +214,7 @@ static xmlNode *handle_description_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling description attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Description", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Description", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -204,7 +222,7 @@ static xmlNode *handle_summary_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling summary attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Summary", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Summary", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -212,7 +230,7 @@ static xmlNode *handle_categories_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling Categories attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Categories", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Categories", NULL); GList *values = vformat_attribute_get_values_decoded(attr); for (; values; values = values->next) { @@ -227,7 +245,7 @@ static xmlNode *handle_class_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling Class attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Class", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Class", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -235,7 +253,7 @@ static xmlNode *handle_due_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling due attribute"); - xmlNode *current = xmlNewChild(root, NULL, "DateDue", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"DateDue", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -243,7 +261,7 @@ static xmlNode *handle_url_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling Url attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Url", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Url", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -251,7 +269,7 @@ /*static xmlNode *handle_uid_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling Uid attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Uid", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Uid", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; }*/ @@ -259,7 +277,7 @@ static xmlNode *handle_priority_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling priority attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Priority", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Priority", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -267,7 +285,7 @@ static xmlNode *handle_sequence_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling sequence attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Sequence", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Sequence", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -275,7 +293,7 @@ static xmlNode *handle_last_modified_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling last_modified attribute"); - xmlNode *current = xmlNewChild(root, NULL, "LastModified", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"LastModified", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -283,7 +301,7 @@ /*static xmlNode *handle_rrule_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling last_modified attribute"); - xmlNode *current = xmlNewChild(root, NULL, "RecurrenceRule", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"RecurrenceRule", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; }*/ @@ -291,7 +309,7 @@ static xmlNode *handle_rdate_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling last_modified attribute"); - xmlNode *current = xmlNewChild(root, NULL, "RecurrenceDate", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"RecurrenceDate", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -299,7 +317,7 @@ static xmlNode *handle_location_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling last_modified attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Location", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Location", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -307,7 +325,7 @@ static xmlNode *handle_geo_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling geo attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Geo", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Geo", NULL); osxml_node_add(current, "Latitude", vformat_attribute_get_nth_value(attr, 0)); osxml_node_add(current, "Longitude", vformat_attribute_get_nth_value(attr, 1)); return current; @@ -316,7 +334,7 @@ static xmlNode *handle_completed_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling last_modified attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Completed", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Completed", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -324,7 +342,7 @@ static xmlNode *handle_organizer_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling last_modified attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Organizer", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Organizer", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -332,7 +350,7 @@ static xmlNode *handle_recurid_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling last_modified attribute"); - xmlNode *current = xmlNewChild(root, NULL, "RecurrenceID", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"RecurrenceID", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -340,7 +358,7 @@ static xmlNode *handle_status_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling last_modified attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Status", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Status", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -348,7 +366,7 @@ static xmlNode *handle_duration_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling last_modified attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Duration", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Duration", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -356,7 +374,7 @@ static xmlNode *handle_attach_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling last_modified attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Attach", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Attach", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -364,7 +382,7 @@ static xmlNode *handle_attendee_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling last_modified attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Attendee", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Attendee", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -372,7 +390,7 @@ static xmlNode *handle_contact_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling last_modified attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Contact", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Contact", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -380,7 +398,7 @@ static xmlNode *handle_exdate_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling last_modified attribute"); - xmlNode *current = xmlNewChild(root, NULL, "ExclusionDate", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"ExclusionDate", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -388,7 +406,7 @@ static xmlNode *handle_exrule_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling last_modified attribute"); - xmlNode *current = xmlNewChild(root, NULL, "ExclusionRule", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"ExclusionRule", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -396,7 +414,7 @@ static xmlNode *handle_rstatus_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling last_modified attribute"); - xmlNode *current = xmlNewChild(root, NULL, "RStatus", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"RStatus", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -404,7 +422,7 @@ static xmlNode *handle_related_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling last_modified attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Related", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Related", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -412,7 +430,7 @@ static xmlNode *handle_resources_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling last_modified attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Resources", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Resources", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -420,7 +438,7 @@ static xmlNode *handle_dtend_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling last_modified attribute"); - xmlNode *current = xmlNewChild(root, NULL, "DateEnd", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"DateEnd", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -428,7 +446,7 @@ static xmlNode *handle_transp_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling last_modified attribute"); - xmlNode *current = xmlNewChild(root, NULL, "Transparency", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Transparency", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -436,7 +454,7 @@ static xmlNode *handle_calscale_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling last_modified attribute"); - xmlNode *current = xmlNewChild(root, NULL, "CalendarScale", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"CalendarScale", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -444,43 +462,49 @@ static xmlNode *handle_tzid_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling tzid attribute"); - return xmlNewChild(root, NULL, "TimezoneID", vformat_attribute_get_nth_value(attr, 0)); + return xmlNewChild(root, NULL, (xmlChar*)"TimezoneID", + (xmlChar*)vformat_attribute_get_nth_value(attr, 0)); } static xmlNode *handle_tz_location_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling tz location attribute"); - return xmlNewChild(root, NULL, "Location", vformat_attribute_get_nth_value(attr, 0)); + return xmlNewChild(root, NULL, (xmlChar*)"Location", + (xmlChar*)vformat_attribute_get_nth_value(attr, 0)); } static xmlNode *handle_tzoffsetfrom_location_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling tzoffsetfrom attribute"); - return xmlNewChild(root, NULL, "TZOffsetFrom", vformat_attribute_get_nth_value(attr, 0)); + return xmlNewChild(root, NULL, (xmlChar*)"TZOffsetFrom", + (xmlChar*)vformat_attribute_get_nth_value(attr, 0)); } static xmlNode *handle_tzoffsetto_location_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling tzoffsetto attribute"); - return xmlNewChild(root, NULL, "TZOffsetTo", vformat_attribute_get_nth_value(attr, 0)); + return xmlNewChild(root, NULL, (xmlChar*)"TZOffsetTo", + (xmlChar*)vformat_attribute_get_nth_value(attr, 0)); } static xmlNode *handle_tzname_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling tzname attribute"); - return xmlNewChild(root, NULL, "TimezoneName", vformat_attribute_get_nth_value(attr, 0)); + return xmlNewChild(root, NULL, (xmlChar*)"TimezoneName", + (xmlChar*)vformat_attribute_get_nth_value(attr, 0)); } static xmlNode *handle_tzdtstart_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling tzdtstart attribute"); - return xmlNewChild(root, NULL, "DateStarted", vformat_attribute_get_nth_value(attr, 0)); + return xmlNewChild(root, NULL, (xmlChar*)"DateStarted", + (xmlChar*)vformat_attribute_get_nth_value(attr, 0)); } static xmlNode *handle_tzrrule_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling tzrrule attribute"); - xmlNode *current = xmlNewChild(root, NULL, "RecurrenceRule", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"RecurrenceRule", NULL); GList *values = vformat_attribute_get_values_decoded(attr); for (; values; values = values->next) { @@ -495,25 +519,28 @@ static xmlNode *handle_tz_last_modified_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling tzdtstart attribute"); - return xmlNewChild(root, NULL, "LastModified", vformat_attribute_get_nth_value(attr, 0)); + return xmlNewChild(root, NULL, (xmlChar*)"LastModified", + (xmlChar*)vformat_attribute_get_nth_value(attr, 0)); } static xmlNode *handle_tzurl_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling tzdtstart attribute"); - return xmlNewChild(root, NULL, "TimezoneUrl", vformat_attribute_get_nth_value(attr, 0)); + return xmlNewChild(root, NULL, (xmlChar*)"TimezoneUrl", + (xmlChar*)vformat_attribute_get_nth_value(attr, 0)); } static xmlNode *handle_tzrdate_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling tzdtstart attribute"); - return xmlNewChild(root, NULL, "TimezoneDate", vformat_attribute_get_nth_value(attr, 0)); + return xmlNewChild(root, NULL, (xmlChar*)"TimezoneDate", + (xmlChar*)vformat_attribute_get_nth_value(attr, 0)); } static xmlNode *handle_atrigger_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling tzdtstart attribute"); - xmlNode *current = xmlNewChild(root, NULL, "AlarmTrigger", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"AlarmTrigger", NULL); osxml_node_add(current, "Content", vformat_attribute_get_nth_value(attr, 0)); return current; } @@ -521,43 +548,50 @@ static xmlNode *handle_arepeat_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling tzdtstart attribute"); - return xmlNewChild(root, NULL, "AlarmRepeat", vformat_attribute_get_nth_value(attr, 0)); + return xmlNewChild(root, NULL, (xmlChar*)"AlarmRepeat", + (xmlChar*)vformat_attribute_get_nth_value(attr, 0)); } static xmlNode *handle_aduration_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling tzdtstart attribute"); - return xmlNewChild(root, NULL, "AlarmDuration", vformat_attribute_get_nth_value(attr, 0)); + return xmlNewChild(root, NULL, (xmlChar*)"AlarmDuration", + (xmlChar*)vformat_attribute_get_nth_value(attr, 0)); } static xmlNode *handle_aaction_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling tzdtstart attribute"); - return xmlNewChild(root, NULL, "AlarmAction", vformat_attribute_get_nth_value(attr, 0)); + return xmlNewChild(root, NULL, (xmlChar*)"AlarmAction", + (xmlChar*)vformat_attribute_get_nth_value(attr, 0)); } static xmlNode *handle_aattach_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling tzdtstart attribute"); - return xmlNewChild(root, NULL, "AlarmAttach", vformat_attribute_get_nth_value(attr, 0)); + return xmlNewChild(root, NULL, (xmlChar*)"AlarmAttach", + (xmlChar*)vformat_attribute_get_nth_value(attr, 0)); } static xmlNode *handle_adescription_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling tzdtstart attribute"); - return xmlNewChild(root, NULL, "AlarmDescription", vformat_attribute_get_nth_value(attr, 0)); + return xmlNewChild(root, NULL, (xmlChar*)"AlarmDescription", + (xmlChar*)vformat_attribute_get_nth_value(attr, 0)); } static xmlNode *handle_aattendee_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling tzdtstart attribute"); - return xmlNewChild(root, NULL, "AlarmAttendee", vformat_attribute_get_nth_value(attr, 0)); + return xmlNewChild(root, NULL, (xmlChar*)"AlarmAttendee", + (xmlChar*)vformat_attribute_get_nth_value(attr, 0)); } static xmlNode *handle_asummary_attribute(xmlNode *root, VFormatAttribute *attr) { osync_trace(TRACE_INTERNAL, "Handling tzdtstart attribute"); - return xmlNewChild(root, NULL, "AlarmSummary", vformat_attribute_get_nth_value(attr, 0)); + return xmlNewChild(root, NULL, (xmlChar*)"AlarmSummary", + (xmlChar*)vformat_attribute_get_nth_value(attr, 0)); } static void vcard_handle_parameter(GHashTable *hooks, xmlNode *current, VFormatParam *param) @@ -636,25 +670,25 @@ //Handling supcomponent a = a->next; if (!strcmp(vformat_attribute_get_nth_value(attr, 0), "VTIMEZONE")) { - xmlNode *current = xmlNewChild(root, NULL, "Timezone", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Timezone", NULL); vcal_parse_attributes(hooks, hooks->tztable, &a, current); } else if (!strcmp(vformat_attribute_get_nth_value(attr, 0), "DAYLIGHT")) { - xmlNode *current = xmlNewChild(root, NULL, "DaylightSavings", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"DaylightSavings", NULL); vcal_parse_attributes(hooks, hooks->tztable, &a, current); } else if (!strcmp(vformat_attribute_get_nth_value(attr, 0), "STANDARD")) { - xmlNode *current = xmlNewChild(root, NULL, "Standard", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Standard", NULL); vcal_parse_attributes(hooks, hooks->tztable, &a, current); } else if (!strcmp(vformat_attribute_get_nth_value(attr, 0), "VTODO")) { - xmlNode *current = xmlNewChild(root, NULL, "Todo", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Todo", NULL); vcal_parse_attributes(hooks, hooks->comptable, &a, current); } else if (!strcmp(vformat_attribute_get_nth_value(attr, 0), "VEVENT")) { - xmlNode *current = xmlNewChild(root, NULL, "Event", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Event", NULL); vcal_parse_attributes(hooks, hooks->comptable, &a, current); } else if (!strcmp(vformat_attribute_get_nth_value(attr, 0), "VJOURNAL")) { - xmlNode *current = xmlNewChild(root, NULL, "Journal", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Journal", NULL); vcal_parse_attributes(hooks, hooks->comptable, &a, current); } else if (!strcmp(vformat_attribute_get_nth_value(attr, 0), "VALARM")) { - xmlNode *current = xmlNewChild(root, NULL, "Alarm", NULL); + xmlNode *current = xmlNewChild(root, NULL, (xmlChar*)"Alarm", NULL); vcal_parse_attributes(hooks, hooks->alarmtable, &a, current); } } else if (!strcmp(vformat_attribute_get_name(attr), "END")) { @@ -681,7 +715,7 @@ osync_trace(TRACE_INTERNAL, "Creating xml doc"); //Create a new xml document - xmlDoc *doc = xmlNewDoc("1.0"); + xmlDoc *doc = xmlNewDoc((xmlChar*)"1.0"); xmlNode *root = osxml_node_add_root(doc, "vcal"); osync_trace(TRACE_INTERNAL, "parsing attributes"); @@ -709,7 +743,7 @@ i++; } } else { - return !g_utf8_validate(tmp, -1, NULL); + return !g_utf8_validate((gchar*)tmp, -1, NULL); } return FALSE; } @@ -729,18 +763,18 @@ { char *tmp = NULL; if (!name) - tmp = xmlNodeGetContent(parent); + tmp = (char*)xmlNodeGetContent(parent); else tmp = osxml_find_node(parent, name); if (!tmp) return; - if (needs_charset(tmp)) + if (needs_charset((unsigned char*)tmp)) if (!vformat_attribute_has_param (attr, "CHARSET")) vformat_attribute_add_param_with_value(attr, "CHARSET", "UTF-8"); - if (needs_encoding(tmp, encoding)) { + if (needs_encoding((unsigned char*)tmp, encoding)) { if (!vformat_attribute_has_param (attr, "ENCODING")) vformat_attribute_add_param_with_value(attr, "ENCODING", encoding); vformat_attribute_add_value_decoded(attr, tmp, strlen(tmp) + 1); @@ -752,133 +786,133 @@ static void xml_handle_unknown_parameter(VFormatAttribute *attr, xmlNode *current) { osync_trace(TRACE_INTERNAL, "Handling unknown xml parameter %s", current->name); - char *content = xmlNodeGetContent(current); - vformat_attribute_add_param_with_value(attr, current->name, content); + char *content = (char*)xmlNodeGetContent(current); + vformat_attribute_add_param_with_value(attr, (char*)current->name, content); g_free(content); } static void handle_xml_category_parameter(VFormatAttribute *attr, xmlNode *current) { - char *content = xmlNodeGetContent(current); + char *content = (char*)xmlNodeGetContent(current); vformat_attribute_add_value(attr, content); g_free(content); } static void handle_xml_rule_parameter(VFormatAttribute *attr, xmlNode *current) { - char *content = xmlNodeGetContent(current); + char *content = (char*)xmlNodeGetContent(current); vformat_attribute_add_value(attr, content); g_free(content); } static void handle_xml_value_parameter(VFormatAttribute *attr, xmlNode *current) { - char *content = xmlNodeGetContent(current); + char *content = (char*)xmlNodeGetContent(current); vformat_attribute_add_param_with_value(attr, "VALUE", content); g_free(content); } static void handle_xml_altrep_parameter(VFormatAttribute *attr, xmlNode *current) { - char *content = xmlNodeGetContent(current); + char *content = (char*)xmlNodeGetContent(current); vformat_attribute_add_param_with_value(attr, "ALTREP", content); g_free(content); } static void handle_xml_cn_parameter(VFormatAttribute *attr, xmlNode *current) { - char *content = xmlNodeGetContent(current); + char *content = (char*)xmlNodeGetContent(current); vformat_attribute_add_param_with_value(attr, "CN", content); g_free(content); } static void handle_xml_delegated_from_parameter(VFormatAttribute *attr, xmlNode *current) { - char *content = xmlNodeGetContent(current); + char *content = (char*)xmlNodeGetContent(current); vformat_attribute_add_param_with_value(attr, "DELEGATED-FROM", content); g_free(content); } static void handle_xml_delegated_to_parameter(VFormatAttribute *attr, xmlNode *current) { - char *content = xmlNodeGetContent(current); + char *content = (char*)xmlNodeGetContent(current); vformat_attribute_add_param_with_value(attr, "DELEGATED-TO", content); g_free(content); } static void handle_xml_dir_parameter(VFormatAttribute *attr, xmlNode *current) { - char *content = xmlNodeGetContent(current); + char *content = (char*)xmlNodeGetContent(current); vformat_attribute_add_param_with_value(attr, "DIR", content); g_free(content); } static void handle_xml_format_type_parameter(VFormatAttribute *attr, xmlNode *current) { - char *content = xmlNodeGetContent(current); + char *content = (char*)xmlNodeGetContent(current); vformat_attribute_add_param_with_value(attr, "FMTTYPE", content); g_free(content); } static void handle_xml_fb_type_parameter(VFormatAttribute *attr, xmlNode *current) { - char *content = xmlNodeGetContent(current); + char *content = (char*)xmlNodeGetContent(current); vformat_attribute_add_param_with_value(attr, "FBTYPE", content); g_free(content); } static void handle_xml_member_parameter(VFormatAttribute *attr, xmlNode *current) { - char *content = xmlNodeGetContent(current); + char *content = (char*)xmlNodeGetContent(current); vformat_attribute_add_param_with_value(attr, "MEMBER", content); g_free(content); } static void handle_xml_partstat_parameter(VFormatAttribute *attr, xmlNode *current) { - char *content = xmlNodeGetContent(current); + char *content = (char*)xmlNodeGetContent(current); vformat_attribute_add_param_with_value(attr, "PARTSTAT", content); g_free(content); } static void handle_xml_range_parameter(VFormatAttribute *attr, xmlNode *current) { - char *content = xmlNodeGetContent(current); + char *content = (char*)xmlNodeGetContent(current); vformat_attribute_add_param_with_value(attr, "RANGE", content); g_free(content); } static void handle_xml_reltype_parameter(VFormatAttribute *attr, xmlNode *current) { - char *content = xmlNodeGetContent(curre... [truncated message content] |
From: <svn...@op...> - 2005-03-21 16:47:16
|
Author: azrael Date: 2005-03-21 17:47:55 +0100 (Mon, 21 Mar 2005) New Revision: 383 Added: trunk/misc/opensync.spec trunk/misc/opensync.spec.in Modified: trunk/Makefile.am trunk/configure.in trunk/osengine/Makefile.am trunk/tools/Makefile.am Log: Made opensync compatible with rpm building. Thanks to Pierre for the patch. Modified: trunk/Makefile.am =================================================================== --- trunk/Makefile.am 2005-03-21 16:32:18 UTC (rev 382) +++ trunk/Makefile.am 2005-03-21 16:47:55 UTC (rev 383) @@ -1,6 +1,6 @@ ## Process this file with automake to produce Makefile.in -SUBDIRS = opensync $(enginedir) formats $(toolsdir) $(testdir) +SUBDIRS = opensync osengine formats tests tools if BUILD_ENGINE OSENGINE_PC = osengine-1.0.pc @@ -20,6 +20,8 @@ plugins \ opensync-1.0.pc.in \ osengine-1.0.pc.in \ + misc/opensync.spec.in \ + misc/opensync.spec \ misc/buildtest.sh \ misc/doxygen.css Modified: trunk/configure.in =================================================================== --- trunk/configure.in 2005-03-21 16:32:18 UTC (rev 382) +++ trunk/configure.in 2005-03-21 16:47:55 UTC (rev 383) @@ -42,11 +42,7 @@ ENABLE_ENGINE=$enableval) if test "x${ENABLE_ENGINE}" = "xyes"; then AC_DEFINE(BUILD_ENGINE,1,[Stress Testing]) - enginedir="osengine" -else - enginedir="" fi -AC_SUBST(enginedir) AC_SUBST(BUILD_ENGINE) AM_CONDITIONAL(BUILD_ENGINE, test x$ENABLE_ENGINE = xyes) @@ -83,12 +79,7 @@ AC_ARG_ENABLE(tools, AS_HELP_STRING([--enable-tools], [enables building of the tools]), WITH_TOOLS=$enableval) -if test "x${WITH_TOOLS}" = "xyes"; then - toolsdir="tools" -else - toolsdir="" -fi -AC_SUBST(toolsdir) +AM_CONDITIONAL(ENABLE_TOOLS, test "x${WITH_TOOLS}" = "xyes") #### Check for libxml #### PKG_CHECK_MODULES(XML, [libxml-2.0]) @@ -105,10 +96,8 @@ AC_CHECK_HEADER(check.h,HAVE_CHECK=1,HAVE_CHECK=0) if test "x${HAVE_CHECK}" = "x1"; then AM_PATH_CHECK(0.9.0) - testdir="tests" fi fi -AC_SUBST(testdir) AM_CONDITIONAL(ENABLE_TESTS, test x$HAVE_CHECK = x1) #### Check for BDB (obsolete now) #### @@ -183,6 +172,7 @@ osengine-1.0.pc osengine-1.0-uninstalled.pc Doxyfile +misc/opensync.spec ]) Added: trunk/misc/opensync.spec =================================================================== --- trunk/misc/opensync.spec 2005-03-21 16:32:18 UTC (rev 382) +++ trunk/misc/opensync.spec 2005-03-21 16:47:55 UTC (rev 383) @@ -0,0 +1,70 @@ +Summary: Synchronisation framework. +Name: opensync +Version: 0.14 +Release: 1 +License: LGPL +Group: Development/Libraries +Source: %{name}-%{version}.tar.gz +BuildRoot: %{_tmppath}/%{name}-%{version} +Requires: libxml2 glib2 sqlite >= 3.0.0 +BuildRequires: libxml2-devel glib2-devel sqlite-devel >= 3.0.0 + +%description +OpenSync is a synchronization framework that is platform and distribution independent. +It consists of several plugins that can be used to connect to devices, a powerfull sync-engine and the framework itself. +OpenSync is platform and distribution independent has no dependencies on X related libraries. + +%package devel +Summary: Header files, libraries and development documentation for %{name} +Group: Development/Libraries +Requires: %{name} = %{version} + +%description devel +This package contains the header files, static libraries and development +documentation for %{name}. If you like to develop programs using %{name}, +you will need to install %{name}-devel. + +%package tools +Summary: Tools for %{name} +Group: Development/Tools +Requires: %{name} + +%description tools +Tools to test and debug %{name}. + +%prep +%setup -q + +%build +%configure --enable-engine --disable-debug --disable-tracing --disable-profiling --enable-tools --disable-unit-tests --disable-python + +%install +rm -rf %{buildroot} +make install DESTDIR=%{buildroot} +rm -f %{buildroot}%{_libdir}/*.la +rm -f %{buildroot}%{_libdir}/opensync/formats/*.la + +%clean +rm -rf %{buildroot} + +%files +%defattr(-,root,root) +%{_libdir}/libopensync-xml.so* +%{_libdir}/libopensync.so* +%{_libdir}/libosengine.so* +%{_libdir}/opensync + +%files devel +%defattr(-,root,root) +%{_includedir}/opensync-1.0 +%{_libdir}/pkgconfig/*.pc + +%files tools +%defattr(-,root,root) +%{_bindir}/osyncdump +%{_bindir}/osyncplugin +%{_bindir}/osyncstress + +%changelog +* Fri Mar 18 2005 Pierre Ossman <dr...@dr...> 0.13-1 +- Initial package Added: trunk/misc/opensync.spec.in =================================================================== --- trunk/misc/opensync.spec.in 2005-03-21 16:32:18 UTC (rev 382) +++ trunk/misc/opensync.spec.in 2005-03-21 16:47:55 UTC (rev 383) @@ -0,0 +1,70 @@ +Summary: Synchronisation framework. +Name: @PACKAGE@ +Version: @VERSION@ +Release: 1 +License: LGPL +Group: Development/Libraries +Source: %{name}-%{version}.tar.gz +BuildRoot: %{_tmppath}/%{name}-%{version} +Requires: libxml2 glib2 sqlite >= 3.0.0 +BuildRequires: libxml2-devel glib2-devel sqlite-devel >= 3.0.0 + +%description +OpenSync is a synchronization framework that is platform and distribution independent. +It consists of several plugins that can be used to connect to devices, a powerfull sync-engine and the framework itself. +OpenSync is platform and distribution independent has no dependencies on X related libraries. + +%package devel +Summary: Header files, libraries and development documentation for %{name} +Group: Development/Libraries +Requires: %{name} = %{version} + +%description devel +This package contains the header files, static libraries and development +documentation for %{name}. If you like to develop programs using %{name}, +you will need to install %{name}-devel. + +%package tools +Summary: Tools for %{name} +Group: Development/Tools +Requires: %{name} + +%description tools +Tools to test and debug %{name}. + +%prep +%setup -q + +%build +%configure --enable-engine --disable-debug --disable-tracing --disable-profiling --enable-tools --disable-unit-tests --disable-python + +%install +rm -rf %{buildroot} +make install DESTDIR=%{buildroot} +rm -f %{buildroot}%{_libdir}/*.la +rm -f %{buildroot}%{_libdir}/opensync/formats/*.la + +%clean +rm -rf %{buildroot} + +%files +%defattr(-,root,root) +%{_libdir}/libopensync-xml.so* +%{_libdir}/libopensync.so* +%{_libdir}/libosengine.so* +%{_libdir}/opensync + +%files devel +%defattr(-,root,root) +%{_includedir}/opensync-1.0 +%{_libdir}/pkgconfig/*.pc + +%files tools +%defattr(-,root,root) +%{_bindir}/osyncdump +%{_bindir}/osyncplugin +%{_bindir}/osyncstress + +%changelog +* Fri Mar 18 2005 Pierre Ossman <dr...@dr...> 0.13-1 +- Initial package Modified: trunk/osengine/Makefile.am =================================================================== --- trunk/osengine/Makefile.am 2005-03-21 16:32:18 UTC (rev 382) +++ trunk/osengine/Makefile.am 2005-03-21 16:47:55 UTC (rev 383) @@ -4,8 +4,11 @@ INCLUDES = -I$(top_srcdir) @PACKAGE_CFLAGS@ +if BUILD_ENGINE lib_LTLIBRARIES = libosengine.la +endif +if BUILD_ENGINE osengineincludedir = @OPENSYNC_ENGINEHEADERDIR@ osengineinclude_HEADERS = \ engine.h \ @@ -13,6 +16,7 @@ osengine_engine.h \ osengine_status.h \ osengine_debug.h +endif libosengine_la_SOURCES = \ osengine_message.c \ Modified: trunk/tools/Makefile.am =================================================================== --- trunk/tools/Makefile.am 2005-03-21 16:32:18 UTC (rev 382) +++ trunk/tools/Makefile.am 2005-03-21 16:47:55 UTC (rev 383) @@ -4,7 +4,9 @@ INCLUDES = -I$(top_srcdir) @PACKAGE_CFLAGS@ @XML_CFLAGS@ -I$(top_srcdir)/osengine +if ENABLE_TOOLS bin_PROGRAMS = osyncdump osyncstress osyncplugin +endif osyncdump_SOURCES = osyncdump.c osyncdump_LDFLAGS = @PACKAGE_LIBS@ @XML_LIBS@ -R $(libdir) @GCOV_LDFLAGS@ |