diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 2f22ec7b..00000000 --- a/.gitignore +++ /dev/null @@ -1,133 +0,0 @@ -# general -*.la -*.lo -*.o -*.pyc -*~ -.deps -.dirstamp -.libs -Makefile -Makefile.in - -# top level -/INSTALL -/autom4te.cache -/aclocal.m4 -/compile -/config.guess -/config.h -/config.h.in -/config.log -/config.status -/config.sub -/configure -/depcomp -/INSTALL -/install-sh -/libtool -/ltmain.sh -/m4 -/missing -/mkinstalldirs -/README -/README.html -/stamp-h1 -/syncevolution.1 -/syncevolution-*.tar.gz -/test-driver - -# for Maemo build -/libsynthesis - -# po -/po/*.gmo -/po/.intltool-merge-cache -/po/LINGUAS -/po/Makefile.in.in -/po/POTFILES -/po/stamp-it - -# src -/src/autotroll.mk -/src/Client_Source_*.log -/src/Client_Sync_*.log -/src/Client_Sync_*.A -/src/client-test -/src/LogDirTest -/src/LogRedirectTest_glib.out -/src/N7SyncEvo*.log -/src/synccompare -/src/syncevo-dbus-server -/src/syncevo-http-server -/src/syncevolution -/src/testcases/ - -# src/backends -/src/backends/backends.am - -# src/backends/webdav -/src/backends/webdav/syncevo-webdav-lookup - -# src/dbus/glib -/src/dbus/glib/stamp-syncevo-connection-bindings.h -/src/dbus/glib/stamp-syncevo-connection-glue.h -/src/dbus/glib/stamp-syncevo-server-bindings.h -/src/dbus/glib/stamp-syncevo-server-glue.h -/src/dbus/glib/stamp-syncevo-session-bindings.h -/src/dbus/glib/stamp-syncevo-session-glue.h -/src/dbus/glib/syncevo-connection-glue.h -/src/dbus/glib/syncevo-connection-bindings.h -/src/dbus/glib/syncevo-connection.xml -/src/dbus/glib/syncevo-dbus.pc -/src/dbus/glib/syncevo-marshal.c -/src/dbus/glib/syncevo-marshal.h -/src/dbus/glib/syncevo-server-glue.h -/src/dbus/glib/syncevo-server-bindings.h -/src/dbus/glib/syncevo-server.xml -/src/dbus/glib/syncevo-session-glue.h -/src/dbus/glib/syncevo-session-bindings.h -/src/dbus/glib/syncevo-session.xml -/src/dbus/glib/test-syncevo-dbus - -# src/dbus/interfaces -/src/dbus/interfaces/syncevo-connection-doc.xml -/src/dbus/interfaces/syncevo-dbus-api-doc.html -/src/dbus/interfaces/syncevo-dbus-api-doc.xml -/src/dbus/interfaces/syncevo-server-doc.xml -/src/dbus/interfaces/syncevo-session-doc.xml - -# src/dbus/qt -/src/dbus/qt/autotroll.mk -/src/dbus/qt/syncevolution-qt-dbus.pc -/src/dbus/qt/stamp-connection -/src/dbus/qt/stamp-server -/src/dbus/qt/stamp-session -/src/dbus/qt/syncevo-connection-full.cpp -/src/dbus/qt/syncevo-connection-full.h -/src/dbus/qt/syncevo-connection-full.moc.cpp -/src/dbus/qt/syncevo-server-full.cpp -/src/dbus/qt/syncevo-server-full.h -/src/dbus/qt/syncevo-server-full.moc.cpp -/src/dbus/qt/syncevo-session-full.cpp -/src/dbus/qt/syncevo-session-full.h -/src/dbus/qt/syncevo-session-full.moc.cpp - -# src/dbus/server -/src/dbus/server/org.syncevolution.service -/src/dbus/server/syncevo-dbus-server-startup.sh -/src/dbus/server/syncevo-dbus-server.desktop - -# src/gdbus -/src/gdbus/example - -# src/gtk-ui -/src/gtk-ui/sync-ui -/src/gtk-ui/sync.desktop -/src/gtk-ui/ui.xml - -# src/syncevo -/src/syncevo-phone-config -/src/syncevo/CmdlineHelp.c -/src/syncevo/SyncEvolutionXML.c -/src/syncevo/syncevolution.pc diff --git a/HACKING b/HACKING index 3504206a..b0a45e07 100644 --- a/HACKING +++ b/HACKING @@ -44,9 +44,10 @@ The test framework also requires CPPUnit: For the GUI and its D-Bus based service backend: apt-get install xsltproc \ + libdbus-glib-1-dev \ libglib2.0-dev \ libgtk2.0-dev libglade2-dev \ - libgnome-keyring-dev \ + libsecret-1-dev \ libgconf2-dev libgnomevfs2-dev Optional packages for GUI: diff --git a/Makefile.am b/Makefile.am index be40ddbb..faa74db9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -132,7 +132,7 @@ TYPE_rpm = -R # - same for kdepimlibs5 -> libakonadi-kde4 # - kdebase-runtime became kde-runtime in Debian Wheezy REQUIRES_SED_KDE = -e 's/kdelibs5 ([^,]*),/kdelibs5 | libkdeui5,/g' -e 's/kdepimlibs5 ([^,]*),/kdepimlibs5 | libakonadi-kde4,/g' -e 's/kdebase-runtime/kdebase-runtime | kde-runtime/g' -REQUIRES_deb = --requires="'$(shell set -x; cd checkinstall/dist; LD_LIBRARY_PATH=$(distdir)/usr/lib:$(distdir)/usr/lib/syncevolution dpkg-shlibdeps -L$(srcdir)/src/shlibs.local --ignore-missing-info -O $$(for i in $$(find $(distdir) -type f -perm /u+x | grep -v -e client-test -e lib/syncevolution/backends/); do if file $$i | grep ELF >/dev/null; then echo $$i; fi; done) | sed $(REQUIRES_SED_KDE) -e 's/[^=]*=//')$(REQUIRES_deb_neon)$(REQUIRES_deb_ical)'" +REQUIRES_deb = --requires="'$(shell set -x; cd checkinstall/dist; LD_LIBRARY_PATH=$(distdir)/usr/lib:$(distdir)/usr/lib/syncevolution dpkg-shlibdeps -L$(EXTRA_SHLIBS_LOCAL) --ignore-missing-info -O $$(for i in $$(find $(distdir) -type f -perm /u+x | grep -v -e client-test -e lib/syncevolution/backends/); do if file $$i | grep ELF >/dev/null; then echo $$i; fi; done) | sed $(REQUIRES_SED_KDE) -e 's/[^=]*=//')$(REQUIRES_deb_neon)$(REQUIRES_deb_ical)'" if NEON_COMPATIBILITY # --enable-neon-compatibility in src/backends/webdav: # replace dependencies from linking with hard-coded dlopen() dependencies @@ -238,7 +238,7 @@ syncevolution-%-deb: checkinstall/dist/$(distdir) checkinstall/dist/debian/contr $(SYNCEVOLUTION_$*_DEB_ARGS) \ --pkgname=syncevolution-$* \ --pkgarch=all \ - --requires="'$(shell set -x; cd checkinstall/dist; LD_LIBRARY_PATH=$(distdir)/usr/lib:$(distdir)/usr/lib/syncevolution dpkg-shlibdeps -L$(srcdir)/src/shlibs.local --ignore-missing-info -O $$(for i in $(patsubst %,$(distdir)/usr/lib/syncevolution/backends/%.so,$(PLATFORM_FILES_$*)); do if file $$i | grep ELF >/dev/null; then echo $$i; fi; done) | sed $(REQUIRES_SED_KDE) -e 's/[^=]*=//'), $(PKGNAME) (= $(VERSION_deb)-$(RELEASE))$(SYNCEVOLUTION_$*_DEB_REQUIRES)'" \ + --requires="'$(shell set -x; cd checkinstall/dist; LD_LIBRARY_PATH=$(distdir)/usr/lib:$(distdir)/usr/lib/syncevolution dpkg-shlibdeps -L$(EXTRA_SHLIBS_LOCAL) --ignore-missing-info -O $$(for i in $(patsubst %,$(distdir)/usr/lib/syncevolution/backends/%.so,$(PLATFORM_FILES_$*)); do if file $$i | grep ELF >/dev/null; then echo $$i; fi; done) | sed $(REQUIRES_SED_KDE) -e 's/[^=]*=//'), $(PKGNAME) (= $(VERSION_deb)-$(RELEASE))$(SYNCEVOLUTION_$*_DEB_REQUIRES)'" \ --maintainer="'Patrick Ohly '" \ --pkgsource='http://syncevolution.org' \ --pkggroup='$*' \ @@ -351,6 +351,7 @@ RUN_SYNCEVOLUTION_CHECK=die if $$?; return $$buffer; endif # patch README.rst properties on-the-fly +if COND_CMDLINE README.patched.rst: README.rst src/syncevolution $(AM_V_GEN)perl -e '$$syncfound=0; $$sourcefound=0; $$res=0;' \ -e 'sub run { $$cmd = shift; $$buffer = `env LD_LIBRARY_PATH=src/syncevo/.libs:src/gdbus/.libs:src/gdbusxx/.libs:src/build-synthesis/src/.libs:$$ENV{LD_LIBRARY_PATH} $$cmd`; $(RUN_SYNCEVOLUTION_CHECK) }' \ @@ -365,6 +366,14 @@ README.patched.rst: README.rst src/syncevolution -e 'die "<> tag not in README.rst?!" unless $$sourcefound;' \ -e 'exit $$res;' \ $< >$@ +else +# Simpler version without inserting the actual sync and datastore properties. +README.patched.rst: README.rst + $(AM_V_GEN)perl -p \ + -e 's/^:Version: .*/:Version: $(VERSION)/;' \ + -e 's/:Date: .*/":Date: " . `date +%Y-%m-%d`/e;' \ + $< >$@ +endif CLEANFILES += README.patched.rst # produce man pages diff --git a/NEWS b/NEWS index bd37f2de..502108cc 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,63 @@ +SyncEvolution 1.5.2 -> 1.5.3, 03.01.2018 +======================================== + +Maintenance release. syncevolution.org binaries are now getting +compiled for distros >= Ubuntu Xenial 16.04 LTS. Usage of deprecated +libraries (GNOME keyring) and APIs (SoupAsyncSession) was +replaced. libical v3 is supported. + +The code now compiles more cleanly with recent compilers and depends +on C++11 support. + +Details: + +* EDS: more generic open retry handling + + Recent EDS started to exhibit race conditions when opening a database (for + example, https://bugzilla.gnome.org/show_bug.cgi?id=791306). Opening was + already tried again for a certain known error in some old EDS version. Now it + is tried five times with a delay of one second for all errors. + +* SoupTransportAgent: require libsoup 2.42, no deprecated methods + + This allows us to get rid of deprecated function calls. We no longer + need to set a default proxy either, the newer libsoup does that itself + by default. + +* C++: replace auto_ptr with unique_ptr, require C++11 + + auto_ptr has been deprecated for a while now. unique_ptr can + be taken for granted now, so use that instead. + +* testing: work around Google CalDAV RECURRENCE-ID + + Stand-alone events with RECURRENCE-ID get mangled by the server: + it converts the RECURRENCE-ID time to UTC. Reported in: + https://stackoverflow.com/questions/47811670/detached-recurrence-without-parent-event + +* GNOME: replace gnome-keyring with libsecret (FDO #104219) + + The GNOME keyring library has been obsoleted for a long time now, + long enough that the replacement libsecret is available on all + supported distros. Therefore we can switch unconditionally. + +* libical: support libical v3 (FDO #104220) + + libical v3 removes some deprecated functions (like icaltime_from_timet) + and removes the "is_utc" member from icaltimetype. The replacement + code works with old and new libical and thus needs no ifdefs. + + Original author: Milan Crha + +* syncevolution.org: fixed packaging (FDO #98014, FDO #100549) + + The activesyncd package missing dependencies on libgnome-keyring0 and + libglib2.0-bin and therefore failed to work when installed on a minimal + system without those. + +* various build and test fixes/workarounds + + SyncEvolution 1.5.1 -> 1.5.2, 08.11.2016 ======================================== diff --git a/configure.ac b/configure.ac index 849872fa..cc479eea 100644 --- a/configure.ac +++ b/configure.ac @@ -8,7 +8,7 @@ dnl Invoke autogen.sh to produce a configure script. # # Starting with the 1.1 release cycle, the rpm-style # .99 pseudo-version number is used to mark a pre-release. -AC_INIT([syncevolution], [m4_esyscmd([build/gen-git-version.sh 1.5.2])]) +AC_INIT([syncevolution], [m4_esyscmd([build/gen-git-version.sh 1.5.3])]) # STABLE_VERSION=1.0.1+ AC_SUBST(STABLE_VERSION) @@ -62,6 +62,14 @@ dnl check for programs. AC_PROG_CXX AC_PROG_MAKE_SET +dnl Use the most recent C++ standard that is supported by the code. +dnl We can fall back to older versions, but not below C++11. +dnl Akonadi/Qt don't work with C++17 yet, so we can't enable that. +AX_CXX_COMPILE_STDCXX_14(noext, optional) +if test "$HAVE_CXX14" -ne 1; then + AX_CXX_COMPILE_STDCXX_11(noext, mandatory) +fi + # Boost headers: boost/foreach.hpp is needed (1.33/Debian Etch # doesn't have it, 1.34/Ubuntu 8.10 Hardy does). 1.35 is available # as Debian Etch backport. @@ -70,8 +78,13 @@ AX_BOOST_BASE(1.34) # TODO: Fix code to pass with -pedantic -Wextra. # -Wno-unknown-pragmas needed because icalstrdup.h # currently uses the "#pragma }" trick. Should remove that. -# Fix code to work without deprecated methods: G GDK GDK_PIXBUF CAIRO PANGO GTK DK_ARG_ENABLE_WARNINGS([SYNCEVO_WFLAGS], + [-Wall -Wno-unknown-pragmas], + [-Wall -Wno-unknown-pragmas], + []) + +# Fix code to work without deprecated methods: G GDK GDK_PIXBUF CAIRO PANGO GTK +DK_ARG_ENABLE_WARNINGS([SYNCEVO_WFLAGS_DEPRECATED], [-Wall -Wno-unknown-pragmas -Wno-deprecated-declarations], [-Wall -Wno-unknown-pragmas -Wno-deprecated-declarations], []) @@ -223,12 +236,9 @@ else have_libcurl="no" fi -PKG_CHECK_MODULES(LIBSOUP, libsoup-gnome-2.4, - [have_libsoup="yes" - AC_DEFINE(HAVE_LIBSOUP_SOUP_GNOME_FEATURES_H, 1, [enable GNOME specific libsoup])], - [PKG_CHECK_MODULES(LIBSOUP, libsoup-2.4, - have_libsoup="yes", - have_libsoup="no")]) +PKG_CHECK_MODULES(LIBSOUP, libsoup-2.4 >= 2.42, + have_libsoup="yes", + have_libsoup="no") PKG_CHECK_MODULES(LIBOPENOBEX, openobex, have_obex="yes", have_obex="no") have_bluetooth="no" @@ -477,6 +487,18 @@ AC_ARG_ENABLE(core, enable_core="$enableval", enable_core="yes") AM_CONDITIONAL([COND_CORE], [test "$enable_core" = "yes"]) +AC_ARG_ENABLE(cmdline, + AS_HELP_STRING([--enable-cmdline], + [enables building the SyncEvolution command line tool, syncevolution]), + enable_cmdline="$enableval", + enable_cmdline="yes") +AM_CONDITIONAL([COND_CMDLINE], [test "$enable_cmdline" = "yes"]) +AC_ARG_ENABLE(local-sync, + AS_HELP_STRING([--enable-local-sync], + [enables building the local synchronization support, in particular syncevo-local-sync]), + enable_local_sync="$enableval", + enable_local_sync="yes") +AM_CONDITIONAL([COND_LOCAL_SYNC], [test "$enable_local_sync" = "yes"]) AC_ARG_ENABLE(dbus-service, AS_HELP_STRING([--enable-dbus-service=args], diff --git a/m4-repo/ax_cxx_compile_stdcxx.m4 b/m4-repo/ax_cxx_compile_stdcxx.m4 new file mode 100644 index 00000000..5032bba8 --- /dev/null +++ b/m4-repo/ax_cxx_compile_stdcxx.m4 @@ -0,0 +1,982 @@ +# =========================================================================== +# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx.html +# =========================================================================== +# +# SYNOPSIS +# +# AX_CXX_COMPILE_STDCXX(VERSION, [ext|noext], [mandatory|optional]) +# +# DESCRIPTION +# +# Check for baseline language coverage in the compiler for the specified +# version of the C++ standard. If necessary, add switches to CXX and +# CXXCPP to enable support. VERSION may be '11' (for the C++11 standard) +# or '14' (for the C++14 standard). +# +# The second argument, if specified, indicates whether you insist on an +# extended mode (e.g. -std=gnu++11) or a strict conformance mode (e.g. +# -std=c++11). If neither is specified, you get whatever works, with +# preference for an extended mode. +# +# The third argument, if specified 'mandatory' or if left unspecified, +# indicates that baseline support for the specified C++ standard is +# required and that the macro should error out if no mode with that +# support is found. If specified 'optional', then configuration proceeds +# regardless, after defining HAVE_CXX${VERSION} if and only if a +# supporting mode is found. +# +# LICENSE +# +# Copyright (c) 2008 Benjamin Kosnik +# Copyright (c) 2012 Zack Weinberg +# Copyright (c) 2013 Roy Stogner +# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov +# Copyright (c) 2015 Paul Norman +# Copyright (c) 2015 Moritz Klammler +# Copyright (c) 2016 Krzesimir Nowak +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 7 + +dnl This macro is based on the code from the AX_CXX_COMPILE_STDCXX_11 macro +dnl (serial version number 13). + +AX_REQUIRE_DEFINED([AC_MSG_WARN]) +AC_DEFUN([AX_CXX_COMPILE_STDCXX], [dnl + m4_if([$1], [11], [ax_cxx_compile_alternatives="11 0x"], + [$1], [14], [ax_cxx_compile_alternatives="14 1y"], + [$1], [17], [ax_cxx_compile_alternatives="17 1z"], + [m4_fatal([invalid first argument `$1' to AX_CXX_COMPILE_STDCXX])])dnl + m4_if([$2], [], [], + [$2], [ext], [], + [$2], [noext], [], + [m4_fatal([invalid second argument `$2' to AX_CXX_COMPILE_STDCXX])])dnl + m4_if([$3], [], [ax_cxx_compile_cxx$1_required=true], + [$3], [mandatory], [ax_cxx_compile_cxx$1_required=true], + [$3], [optional], [ax_cxx_compile_cxx$1_required=false], + [m4_fatal([invalid third argument `$3' to AX_CXX_COMPILE_STDCXX])]) + AC_LANG_PUSH([C++])dnl + ac_success=no + AC_CACHE_CHECK(whether $CXX supports C++$1 features by default, + ax_cv_cxx_compile_cxx$1, + [AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], + [ax_cv_cxx_compile_cxx$1=yes], + [ax_cv_cxx_compile_cxx$1=no])]) + if test x$ax_cv_cxx_compile_cxx$1 = xyes; then + ac_success=yes + fi + + m4_if([$2], [noext], [], [dnl + if test x$ac_success = xno; then + for alternative in ${ax_cxx_compile_alternatives}; do + switch="-std=gnu++${alternative}" + cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) + AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, + $cachevar, + [ac_save_CXX="$CXX" + CXX="$CXX $switch" + AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], + [eval $cachevar=yes], + [eval $cachevar=no]) + CXX="$ac_save_CXX"]) + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break + fi + done + fi]) + + m4_if([$2], [ext], [], [dnl + if test x$ac_success = xno; then + dnl HP's aCC needs +std=c++11 according to: + dnl http://h21007.www2.hp.com/portal/download/files/unprot/aCxx/PDF_Release_Notes/769149-001.pdf + dnl Cray's crayCC needs "-h std=c++11" + for alternative in ${ax_cxx_compile_alternatives}; do + for switch in -std=c++${alternative} +std=c++${alternative} "-h std=c++${alternative}"; do + cachevar=AS_TR_SH([ax_cv_cxx_compile_cxx$1_$switch]) + AC_CACHE_CHECK(whether $CXX supports C++$1 features with $switch, + $cachevar, + [ac_save_CXX="$CXX" + CXX="$CXX $switch" + AC_COMPILE_IFELSE([AC_LANG_SOURCE([_AX_CXX_COMPILE_STDCXX_testbody_$1])], + [eval $cachevar=yes], + [eval $cachevar=no]) + CXX="$ac_save_CXX"]) + if eval test x\$$cachevar = xyes; then + CXX="$CXX $switch" + if test -n "$CXXCPP" ; then + CXXCPP="$CXXCPP $switch" + fi + ac_success=yes + break + fi + done + if test x$ac_success = xyes; then + break + fi + done + fi]) + AC_LANG_POP([C++]) + if test x$ax_cxx_compile_cxx$1_required = xtrue; then + if test x$ac_success = xno; then + AC_MSG_ERROR([*** A compiler with support for C++$1 language features is required.]) + fi + fi + if test x$ac_success = xno; then + HAVE_CXX$1=0 + AC_MSG_NOTICE([No compiler with C++$1 support was found]) + else + HAVE_CXX$1=1 + AC_DEFINE(HAVE_CXX$1,1, + [define if the compiler supports basic C++$1 syntax]) + fi + AC_SUBST(HAVE_CXX$1) + m4_if([$1], [17], [AC_MSG_WARN([C++17 is not yet standardized, so the checks may change in incompatible ways anytime])]) +]) + + +dnl Test body for checking C++11 support + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_11], + _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 +) + + +dnl Test body for checking C++14 support + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_14], + _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 +) + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_17], + _AX_CXX_COMPILE_STDCXX_testbody_new_in_11 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_14 + _AX_CXX_COMPILE_STDCXX_testbody_new_in_17 +) + +dnl Tests for new features in C++11 + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_11], [[ + +// If the compiler admits that it is not ready for C++11, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201103L + +#error "This is not a C++11 compiler" + +#else + +namespace cxx11 +{ + + namespace test_static_assert + { + + template + struct check + { + static_assert(sizeof(int) <= sizeof(T), "not big enough"); + }; + + } + + namespace test_final_override + { + + struct Base + { + virtual void f() {} + }; + + struct Derived : public Base + { + virtual void f() override {} + }; + + } + + namespace test_double_right_angle_brackets + { + + template < typename T > + struct check {}; + + typedef check single_type; + typedef check> double_type; + typedef check>> triple_type; + typedef check>>> quadruple_type; + + } + + namespace test_decltype + { + + int + f() + { + int a = 1; + decltype(a) b = 2; + return a + b; + } + + } + + namespace test_type_deduction + { + + template < typename T1, typename T2 > + struct is_same + { + static const bool value = false; + }; + + template < typename T > + struct is_same + { + static const bool value = true; + }; + + template < typename T1, typename T2 > + auto + add(T1 a1, T2 a2) -> decltype(a1 + a2) + { + return a1 + a2; + } + + int + test(const int c, volatile int v) + { + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == false, ""); + auto ac = c; + auto av = v; + auto sumi = ac + av + 'x'; + auto sumf = ac + av + 1.0; + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == true, ""); + static_assert(is_same::value == false, ""); + static_assert(is_same::value == true, ""); + return (sumf > 0.0) ? sumi : add(c, v); + } + + } + + namespace test_noexcept + { + + int f() { return 0; } + int g() noexcept { return 0; } + + static_assert(noexcept(f()) == false, ""); + static_assert(noexcept(g()) == true, ""); + + } + + namespace test_constexpr + { + + template < typename CharT > + unsigned long constexpr + strlen_c_r(const CharT *const s, const unsigned long acc) noexcept + { + return *s ? strlen_c_r(s + 1, acc + 1) : acc; + } + + template < typename CharT > + unsigned long constexpr + strlen_c(const CharT *const s) noexcept + { + return strlen_c_r(s, 0UL); + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("1") == 1UL, ""); + static_assert(strlen_c("example") == 7UL, ""); + static_assert(strlen_c("another\0example") == 7UL, ""); + + } + + namespace test_rvalue_references + { + + template < int N > + struct answer + { + static constexpr int value = N; + }; + + answer<1> f(int&) { return answer<1>(); } + answer<2> f(const int&) { return answer<2>(); } + answer<3> f(int&&) { return answer<3>(); } + + void + test() + { + int i = 0; + const int c = 0; + static_assert(decltype(f(i))::value == 1, ""); + static_assert(decltype(f(c))::value == 2, ""); + static_assert(decltype(f(0))::value == 3, ""); + } + + } + + namespace test_uniform_initialization + { + + struct test + { + static const int zero {}; + static const int one {1}; + }; + + static_assert(test::zero == 0, ""); + static_assert(test::one == 1, ""); + + } + + namespace test_lambdas + { + + void + test1() + { + auto lambda1 = [](){}; + auto lambda2 = lambda1; + lambda1(); + lambda2(); + } + + int + test2() + { + auto a = [](int i, int j){ return i + j; }(1, 2); + auto b = []() -> int { return '0'; }(); + auto c = [=](){ return a + b; }(); + auto d = [&](){ return c; }(); + auto e = [a, &b](int x) mutable { + const auto identity = [](int y){ return y; }; + for (auto i = 0; i < a; ++i) + a += b--; + return x + identity(a + b); + }(0); + return a + b + c + d + e; + } + + int + test3() + { + const auto nullary = [](){ return 0; }; + const auto unary = [](int x){ return x; }; + using nullary_t = decltype(nullary); + using unary_t = decltype(unary); + const auto higher1st = [](nullary_t f){ return f(); }; + const auto higher2nd = [unary](nullary_t f1){ + return [unary, f1](unary_t f2){ return f2(unary(f1())); }; + }; + return higher1st(nullary) + higher2nd(nullary)(unary); + } + + } + + namespace test_variadic_templates + { + + template + struct sum; + + template + struct sum + { + static constexpr auto value = N0 + sum::value; + }; + + template <> + struct sum<> + { + static constexpr auto value = 0; + }; + + static_assert(sum<>::value == 0, ""); + static_assert(sum<1>::value == 1, ""); + static_assert(sum<23>::value == 23, ""); + static_assert(sum<1, 2>::value == 3, ""); + static_assert(sum<5, 5, 11>::value == 21, ""); + static_assert(sum<2, 3, 5, 7, 11, 13>::value == 41, ""); + + } + + // http://stackoverflow.com/questions/13728184/template-aliases-and-sfinae + // Clang 3.1 fails with headers of libstd++ 4.8.3 when using std::function + // because of this. + namespace test_template_alias_sfinae + { + + struct foo {}; + + template + using member = typename T::member_type; + + template + void func(...) {} + + template + void func(member*) {} + + void test(); + + void test() { func(0); } + + } + +} // namespace cxx11 + +#endif // __cplusplus >= 201103L + +]]) + + +dnl Tests for new features in C++14 + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_14], [[ + +// If the compiler admits that it is not ready for C++14, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus < 201402L + +#error "This is not a C++14 compiler" + +#else + +namespace cxx14 +{ + + namespace test_polymorphic_lambdas + { + + int + test() + { + const auto lambda = [](auto&&... args){ + const auto istiny = [](auto x){ + return (sizeof(x) == 1UL) ? 1 : 0; + }; + const int aretiny[] = { istiny(args)... }; + return aretiny[0]; + }; + return lambda(1, 1L, 1.0f, '1'); + } + + } + + namespace test_binary_literals + { + + constexpr auto ivii = 0b0000000000101010; + static_assert(ivii == 42, "wrong value"); + + } + + namespace test_generalized_constexpr + { + + template < typename CharT > + constexpr unsigned long + strlen_c(const CharT *const s) noexcept + { + auto length = 0UL; + for (auto p = s; *p; ++p) + ++length; + return length; + } + + static_assert(strlen_c("") == 0UL, ""); + static_assert(strlen_c("x") == 1UL, ""); + static_assert(strlen_c("test") == 4UL, ""); + static_assert(strlen_c("another\0test") == 7UL, ""); + + } + + namespace test_lambda_init_capture + { + + int + test() + { + auto x = 0; + const auto lambda1 = [a = x](int b){ return a + b; }; + const auto lambda2 = [a = lambda1(x)](){ return a; }; + return lambda2(); + } + + } + + namespace test_digit_separators + { + + constexpr auto ten_million = 100'000'000; + static_assert(ten_million == 100000000, ""); + + } + + namespace test_return_type_deduction + { + + auto f(int& x) { return x; } + decltype(auto) g(int& x) { return x; } + + template < typename T1, typename T2 > + struct is_same + { + static constexpr auto value = false; + }; + + template < typename T > + struct is_same + { + static constexpr auto value = true; + }; + + int + test() + { + auto x = 0; + static_assert(is_same::value, ""); + static_assert(is_same::value, ""); + return x; + } + + } + +} // namespace cxx14 + +#endif // __cplusplus >= 201402L + +]]) + + +dnl Tests for new features in C++17 + +m4_define([_AX_CXX_COMPILE_STDCXX_testbody_new_in_17], [[ + +// If the compiler admits that it is not ready for C++17, why torture it? +// Hopefully, this will speed up the test. + +#ifndef __cplusplus + +#error "This is not a C++ compiler" + +#elif __cplusplus <= 201402L + +#error "This is not a C++17 compiler" + +#else + +#if defined(__clang__) + #define REALLY_CLANG +#else + #if defined(__GNUC__) + #define REALLY_GCC + #endif +#endif + +#include +#include +#include + +namespace cxx17 +{ + +#if !defined(REALLY_CLANG) + namespace test_constexpr_lambdas + { + + // TODO: test it with clang++ from git + + constexpr int foo = [](){return 42;}(); + + } +#endif // !defined(REALLY_CLANG) + + namespace test::nested_namespace::definitions + { + + } + + namespace test_fold_expression + { + + template + int multiply(Args... args) + { + return (args * ... * 1); + } + + template + bool all(Args... args) + { + return (args && ...); + } + + } + + namespace test_extended_static_assert + { + + static_assert (true); + + } + + namespace test_auto_brace_init_list + { + + auto foo = {5}; + auto bar {5}; + + static_assert(std::is_same, decltype(foo)>::value); + static_assert(std::is_same::value); + } + + namespace test_typename_in_template_template_parameter + { + + template typename X> struct D; + + } + + namespace test_fallthrough_nodiscard_maybe_unused_attributes + { + + int f1() + { + return 42; + } + + [[nodiscard]] int f2() + { + [[maybe_unused]] auto unused = f1(); + + switch (f1()) + { + case 17: + f1(); + [[fallthrough]]; + case 42: + f1(); + } + return f1(); + } + + } + + namespace test_extended_aggregate_initialization + { + + struct base1 + { + int b1, b2 = 42; + }; + + struct base2 + { + base2() { + b3 = 42; + } + int b3; + }; + + struct derived : base1, base2 + { + int d; + }; + + derived d1 {{1, 2}, {}, 4}; // full initialization + derived d2 {{}, {}, 4}; // value-initialized bases + + } + + namespace test_general_range_based_for_loop + { + + struct iter + { + int i; + + int& operator* () + { + return i; + } + + const int& operator* () const + { + return i; + } + + iter& operator++() + { + ++i; + return *this; + } + }; + + struct sentinel + { + int i; + }; + + bool operator== (const iter& i, const sentinel& s) + { + return i.i == s.i; + } + + bool operator!= (const iter& i, const sentinel& s) + { + return !(i == s); + } + + struct range + { + iter begin() const + { + return {0}; + } + + sentinel end() const + { + return {5}; + } + }; + + void f() + { + range r {}; + + for (auto i : r) + { + [[maybe_unused]] auto v = i; + } + } + + } + + namespace test_lambda_capture_asterisk_this_by_value + { + + struct t + { + int i; + int foo() + { + return [*this]() + { + return i; + }(); + } + }; + + } + + namespace test_enum_class_construction + { + + enum class byte : unsigned char + {}; + + byte foo {42}; + + } + + namespace test_constexpr_if + { + + template + int f () + { + if constexpr(cond) + { + return 13; + } + else + { + return 42; + } + } + + } + + namespace test_selection_statement_with_initializer + { + + int f() + { + return 13; + } + + int f2() + { + if (auto i = f(); i > 0) + { + return 3; + } + + switch (auto i = f(); i + 4) + { + case 17: + return 2; + + default: + return 1; + } + } + + } + +#if !defined(REALLY_CLANG) + namespace test_template_argument_deduction_for_class_templates + { + + // TODO: test it with clang++ from git + + template + struct pair + { + pair (T1 p1, T2 p2) + : m1 {p1}, + m2 {p2} + {} + + T1 m1; + T2 m2; + }; + + void f() + { + [[maybe_unused]] auto p = pair{13, 42u}; + } + + } +#endif // !defined(REALLY_CLANG) + + namespace test_non_type_auto_template_parameters + { + + template + struct B + {}; + + B<5> b1; + B<'a'> b2; + + } + +#if !defined(REALLY_CLANG) + namespace test_structured_bindings + { + + // TODO: test it with clang++ from git + + int arr[2] = { 1, 2 }; + std::pair pr = { 1, 2 }; + + auto f1() -> int(&)[2] + { + return arr; + } + + auto f2() -> std::pair& + { + return pr; + } + + struct S + { + int x1 : 2; + volatile double y1; + }; + + S f3() + { + return {}; + } + + auto [ x1, y1 ] = f1(); + auto& [ xr1, yr1 ] = f1(); + auto [ x2, y2 ] = f2(); + auto& [ xr2, yr2 ] = f2(); + const auto [ x3, y3 ] = f3(); + + } +#endif // !defined(REALLY_CLANG) + +#if !defined(REALLY_CLANG) + namespace test_exception_spec_type_system + { + + // TODO: test it with clang++ from git + + struct Good {}; + struct Bad {}; + + void g1() noexcept; + void g2(); + + template + Bad + f(T*, T*); + + template + Good + f(T1*, T2*); + + static_assert (std::is_same_v); + + } +#endif // !defined(REALLY_CLANG) + + namespace test_inline_variables + { + + template void f(T) + {} + + template inline T g(T) + { + return T{}; + } + + template<> inline void f<>(int) + {} + + template<> int g<>(int) + { + return 5; + } + + } + +} // namespace cxx17 + +#endif // __cplusplus <= 201402L + +]]) diff --git a/m4-repo/ax_cxx_compile_stdcxx_11.m4 b/m4-repo/ax_cxx_compile_stdcxx_11.m4 new file mode 100644 index 00000000..1733fd85 --- /dev/null +++ b/m4-repo/ax_cxx_compile_stdcxx_11.m4 @@ -0,0 +1,39 @@ +# ============================================================================= +# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_11.html +# ============================================================================= +# +# SYNOPSIS +# +# AX_CXX_COMPILE_STDCXX_11([ext|noext], [mandatory|optional]) +# +# DESCRIPTION +# +# Check for baseline language coverage in the compiler for the C++11 +# standard; if necessary, add switches to CXX and CXXCPP to enable +# support. +# +# This macro is a convenience alias for calling the AX_CXX_COMPILE_STDCXX +# macro with the version set to C++11. The two optional arguments are +# forwarded literally as the second and third argument respectively. +# Please see the documentation for the AX_CXX_COMPILE_STDCXX macro for +# more information. If you want to use this macro, you also need to +# download the ax_cxx_compile_stdcxx.m4 file. +# +# LICENSE +# +# Copyright (c) 2008 Benjamin Kosnik +# Copyright (c) 2012 Zack Weinberg +# Copyright (c) 2013 Roy Stogner +# Copyright (c) 2014, 2015 Google Inc.; contributed by Alexey Sokolov +# Copyright (c) 2015 Paul Norman +# Copyright (c) 2015 Moritz Klammler +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 18 + +AX_REQUIRE_DEFINED([AX_CXX_COMPILE_STDCXX]) +AC_DEFUN([AX_CXX_COMPILE_STDCXX_11], [AX_CXX_COMPILE_STDCXX([11], [$1], [$2])]) diff --git a/m4-repo/ax_cxx_compile_stdcxx_14.m4 b/m4-repo/ax_cxx_compile_stdcxx_14.m4 new file mode 100644 index 00000000..094db0d0 --- /dev/null +++ b/m4-repo/ax_cxx_compile_stdcxx_14.m4 @@ -0,0 +1,34 @@ +# ============================================================================= +# https://www.gnu.org/software/autoconf-archive/ax_cxx_compile_stdcxx_14.html +# ============================================================================= +# +# SYNOPSIS +# +# AX_CXX_COMPILE_STDCXX_14([ext|noext], [mandatory|optional]) +# +# DESCRIPTION +# +# Check for baseline language coverage in the compiler for the C++14 +# standard; if necessary, add switches to CXX and CXXCPP to enable +# support. +# +# This macro is a convenience alias for calling the AX_CXX_COMPILE_STDCXX +# macro with the version set to C++14. The two optional arguments are +# forwarded literally as the second and third argument respectively. +# Please see the documentation for the AX_CXX_COMPILE_STDCXX macro for +# more information. If you want to use this macro, you also need to +# download the ax_cxx_compile_stdcxx.m4 file. +# +# LICENSE +# +# Copyright (c) 2015 Moritz Klammler +# +# Copying and distribution of this file, with or without modification, are +# permitted in any medium without royalty provided the copyright notice +# and this notice are preserved. This file is offered as-is, without any +# warranty. + +#serial 5 + +AX_REQUIRE_DEFINED([AX_CXX_COMPILE_STDCXX]) +AC_DEFUN([AX_CXX_COMPILE_STDCXX_14], [AX_CXX_COMPILE_STDCXX([14], [$1], [$2])]) diff --git a/src/backends/activesync/ActiveSyncSourceRegister.cpp b/src/backends/activesync/ActiveSyncSourceRegister.cpp index aab77ccc..2526e5cb 100644 --- a/src/backends/activesync/ActiveSyncSourceRegister.cpp +++ b/src/backends/activesync/ActiveSyncSourceRegister.cpp @@ -188,7 +188,7 @@ static TestingSyncSource *createEASSource(const ClientTestConfig::createsource_t const std::string &clientID, int source, bool isSourceA) { - std::auto_ptr res(create(client, clientID, source, isSourceA)); + std::unique_ptr res(create(client, clientID, source, isSourceA)); // Mangle username: if the base username in the config is account // "foo", then source B uses "foo_B", because otherwise it'll end diff --git a/src/backends/akonadi/akonadi.am b/src/backends/akonadi/akonadi.am index 271bb8d3..8f471534 100644 --- a/src/backends/akonadi/akonadi.am +++ b/src/backends/akonadi/akonadi.am @@ -16,6 +16,6 @@ src_backends_akonadi_syncakonadi_la_SOURCES = \ src/backends/akonadi/akonadisyncsource.cpp src_backends_akonadi_syncakonadi_la_LIBADD = $(KDEPIM_LIBS) $(SYNCEVOLUTION_LIBS) src_backends_akonadi_syncakonadi_la_LDFLAGS = -module -avoid-version -src_backends_akonadi_syncakonadi_la_CXXFLAGS = $(SYNCEVOLUTION_CXXFLAGS) $(SYNCEVO_WFLAGS) +src_backends_akonadi_syncakonadi_la_CXXFLAGS = $(SYNCEVOLUTION_CXXFLAGS) $(SYNCEVO_WFLAGS_DEPRECATED) src_backends_akonadi_syncakonadi_la_CPPFLAGS = $(SYNCEVOLUTION_CFLAGS) -I$(top_srcdir)/test $(BACKEND_CPPFLAGS) src_backends_akonadi_syncakonadi_la_DEPENDENCIES = src/syncevo/libsyncevolution.la diff --git a/src/backends/akonadi/akonadisyncsource.cpp b/src/backends/akonadi/akonadisyncsource.cpp index ac238769..ba82020f 100644 --- a/src/backends/akonadi/akonadisyncsource.cpp +++ b/src/backends/akonadi/akonadisyncsource.cpp @@ -56,7 +56,7 @@ using namespace Akonadi; * * To avoid double frees, we need to disable auto-deletion. * This method does that. Use like this: - * std::auto_ptr statisticsJob(DisableAutoDelete(new CollectionStatisticsJob(m_collection))); + * std::unique_ptr statisticsJob(DisableAutoDelete(new CollectionStatisticsJob(m_collection))); */ template J *DisableAutoDelete(J *job) { job->setAutoDelete(false); return job; } @@ -80,7 +80,7 @@ bool AkonadiSyncSource::isEmpty() } //To Check if the respective collection is Empty, without actually loading the collections - std::auto_ptr statisticsJob(DisableAutoDelete(new CollectionStatisticsJob(m_collection))); + std::unique_ptr statisticsJob(DisableAutoDelete(new CollectionStatisticsJob(m_collection))); if (!statisticsJob->exec()) { throwError(SE_HERE, "Error fetching the collection stats"); } @@ -129,8 +129,8 @@ SyncSource::Databases AkonadiSyncSource::getDatabases() // as the default one used by the source. // res.push_back("Contacts", "some-KDE-specific-ID", isDefault); - std::auto_ptr fetchJob(DisableAutoDelete(new CollectionFetchJob(Collection::root(), - CollectionFetchJob::Recursive))); + std::unique_ptr fetchJob(DisableAutoDelete(new CollectionFetchJob(Collection::root(), + CollectionFetchJob::Recursive))); fetchJob->fetchScope().setContentMimeTypes(m_mimeTypes); @@ -193,8 +193,8 @@ void AkonadiSyncSource::open() // Verify that the collection exists and ensure that // m_collection.contentMimeTypes() returns valid information. The // collection constructed so far only contains the collection ID. - std::auto_ptr fetchJob(DisableAutoDelete(new CollectionFetchJob(m_collection, - CollectionFetchJob::Base))); + std::unique_ptr fetchJob(DisableAutoDelete(new CollectionFetchJob(m_collection, + CollectionFetchJob::Base))); if (!fetchJob->exec()) { throwError(SE_HERE, StringPrintf("cannot fetch collection %s", id.c_str())); } @@ -228,7 +228,7 @@ void AkonadiSyncSource::listAllItems(SyncSourceRevisions::RevisionMap_t &revisio } // copy all local IDs and the corresponding revision - std::auto_ptr fetchJob(DisableAutoDelete(new ItemFetchJob(m_collection))); + std::unique_ptr fetchJob(DisableAutoDelete(new ItemFetchJob(m_collection))); if (!fetchJob->exec()) { throwError(SE_HERE, "listing items"); } @@ -260,7 +260,7 @@ TrackingSyncSource::InsertItemResult AkonadiSyncSource::insertItem(const std::st if (luid.empty()) { item.setMimeType(m_mimeTypes.front()); item.setPayloadFromData(QByteArray(data.c_str())); - std::auto_ptr createJob(DisableAutoDelete(new ItemCreateJob(item, m_collection))); + std::unique_ptr createJob(DisableAutoDelete(new ItemCreateJob(item, m_collection))); if (!createJob->exec()) { throwError(SE_HERE, string("storing new item ") + luid); return InsertItemResult("", "", ITEM_OKAY); @@ -268,13 +268,13 @@ TrackingSyncSource::InsertItemResult AkonadiSyncSource::insertItem(const std::st item = createJob->item(); } else { Entity::Id syncItemId = QByteArray(luid.c_str()).toLongLong(); - std::auto_ptr fetchJob(DisableAutoDelete(new ItemFetchJob(Item(syncItemId)))); + std::unique_ptr fetchJob(DisableAutoDelete(new ItemFetchJob(Item(syncItemId)))); if (!fetchJob->exec()) { throwError(SE_HERE, string("checking item ") + luid); } item = fetchJob->items().first(); item.setPayloadFromData(QByteArray(data.c_str())); - std::auto_ptr modifyJob(DisableAutoDelete(new ItemModifyJob(item))); + std::unique_ptr modifyJob(DisableAutoDelete(new ItemModifyJob(item))); // TODO: SyncEvolution must pass the known revision that // we are updating. // TODO: check that the item has not been updated in the meantime @@ -304,7 +304,7 @@ void AkonadiSyncSource::removeItem(const string &luid) // Delete the item from our collection // TODO: check that the revision is right (need revision from SyncEvolution) - std::auto_ptr deleteJob(DisableAutoDelete(new ItemDeleteJob(Item(syncItemId)))); + std::unique_ptr deleteJob(DisableAutoDelete(new ItemDeleteJob(Item(syncItemId)))); if (!deleteJob->exec()) { throwError(SE_HERE, string("deleting item " ) + luid); } @@ -319,7 +319,7 @@ void AkonadiSyncSource::readItem(const std::string &luid, std::string &data, boo Entity::Id syncItemId = QByteArray(luid.c_str()).toLongLong(); - std::auto_ptr fetchJob(DisableAutoDelete(new ItemFetchJob(Item(syncItemId)))); + std::unique_ptr fetchJob(DisableAutoDelete(new ItemFetchJob(Item(syncItemId)))); fetchJob->fetchScope().fetchFullPayload(); if (fetchJob->exec()) { if (fetchJob->items().empty()) { diff --git a/src/backends/evolution/EvolutionSyncSource.cpp b/src/backends/evolution/EvolutionSyncSource.cpp index 57f20e40..8643b56d 100644 --- a/src/backends/evolution/EvolutionSyncSource.cpp +++ b/src/backends/evolution/EvolutionSyncSource.cpp @@ -66,7 +66,6 @@ EClientCXX EvolutionSyncSource::openESource(const char *extension, ESourceListCXX sources(e_source_registry_list_sources(registry, extension)); string id = getDatabaseID(); ESource *source = findSource(sources, id); - bool created = false; if (!source) { if (refBuiltin && (id.empty() || id == "<>")) { @@ -78,7 +77,6 @@ EClientCXX EvolutionSyncSource::openESource(const char *extension, } else { throwError(SE_HERE, string("database not found: '") + id + "'"); } - created = true; } else { client = EClientCXX::steal(newClient(source, gerror)); } @@ -95,19 +93,19 @@ EClientCXX EvolutionSyncSource::openESource(const char *extension, (void *)"Evolution Data Server has died unexpectedly."); + int retries = 0; while (true) { // Always allow EDS to create the database. "only-if-exists = // true" does not make sense. if (!e_client_open_sync(client, false, NULL, gerror)) { - if (gerror && g_error_matches(gerror, E_CLIENT_ERROR, E_CLIENT_ERROR_BUSY)) { + if (retries < 5) { + // EDS 3.18 and 3.26 have various race conditions during startup. + // Try a few times. + // https://bugzilla.gnome.org/show_bug.cgi?id=791306 + SE_LOG_DEBUG(NULL, "Opening EDS source: ignoring error, trying again: %s", gerror->message); gerror.clear(); sleep(1); - } else if (created) { - // Opening newly created address books often failed in - // old EDS releases - try again. Probably covered by - // more recently added E_CLIENT_ERROR_BUSY check above. - gerror.clear(); - sleep(5); + retries++; } else { throwError(SE_HERE, "opening database", gerror); } diff --git a/src/backends/gnome/GNOMEPlatform.cpp b/src/backends/gnome/GNOMEPlatform.cpp index f2f7a1d3..deff896f 100644 --- a/src/backends/gnome/GNOMEPlatform.cpp +++ b/src/backends/gnome/GNOMEPlatform.cpp @@ -22,7 +22,7 @@ #ifdef USE_GNOME_KEYRING extern "C" { -#include +#include } #include "GNOMEPlatform.h" @@ -30,46 +30,11 @@ extern "C" { #include #include #include +#include #include SE_BEGIN_CXX -// Occasionally, libgnome-keyring fails with the following error messages: -// Gkr: received an invalid, unencryptable, or non-utf8 secret -// Gkr: call to daemon returned an invalid response: (null).(null) -// -// We work around that by retrying the operation a few times, for at -// most this period of time. Didn't really help, so disable it for now -// by using a zero duration. -static const double GNOMEKeyringRetryDuration = 2; // seconds -static const double GNOMEKeyringRetryInterval = 0.1; // seconds - -/** - * libgnome-keyring has an internal gkr_reset_session() - * method which gets called when the "org.freedesktop.secrets" - * disconnects from the D-Bus session bus. - * - * We cannot call that method directly, but we can get it called by - * faking the "disconnect" signal. That works because - * on_connection_filter() in gkr-operation.c doesn't check who the - * sender of the signal is. - * - * Once gkr_reset_session() got called, the next operation will - * re-establish the connection. After the failure above, the second - * attempt usually works. - * - * Any other client using libgnome-keyring will also be tricked into - * disconnecting temporarily. That should be fine, any running - * operation will continue to run and complete (?). - */ -static void FlushGNOMEKeyring() -{ - // Invoking dbus-send is easier than writing this in C++. - // Besides, it ensures that the signal comes from some other - // process. Not sure whether signals are sent back to the sender. - system("dbus-send --session --type=signal /org/freedesktop/DBus org.freedesktop.DBus.NameOwnerChanged string:'org.freedesktop.secrets' string:':9.99' string:''"); -} - /** * GNOME keyring distinguishes between empty and unset * password keys. This function returns NULL for an @@ -97,6 +62,56 @@ static bool UseGNOMEKeyring(const InitStateTri &keyring) return true; } +class LibSecretHash : public GHashTableCXX +{ + std::list m_buffer; + +public: + LibSecretHash(const ConfigPasswordKey &key) : + GHashTableCXX(g_hash_table_new(g_str_hash, g_str_equal), TRANSFER_REF) + { + // see https://developer.gnome.org/libsecret/0.16/libsecret-SecretSchema.html#SECRET-SCHEMA-COMPAT-NETWORK:CAPS + insert("user", key.user); + insert("domain", key.domain); + insert("server", key.server); + insert("object", key.object); + insert("protocol", key.protocol); + insert("authtype", key.authtype); + if (key.port) { + std::string value = StringPrintf("%d", key.port); + insert("port", value); + } + } + + /** Keys are expected to be constants and not copied. Values are copied. */ + void insert(const char *key, const std::string &value) + { + if (!value.empty()) { + m_buffer.push_back(value); + g_hash_table_insert(get(), + const_cast(key), + const_cast(m_buffer.back().c_str())); + } + } +}; + +/** + * Sometimes libsecret and GNOME Keyring fail to initialize + * the encryption: https://bugzilla.gnome.org/show_bug.cgi?id=778357 + * If that happens, then trying with a new SecretService instance + * may work. + * + * When libsecret detects that, we get a well-defined error. + * When GNOME Keyring detects it, the error is less obvious. + */ +static bool IsSharedSecretError(const GErrorCXX &gerror) +{ + bool result = gerror.matches(SECRET_ERROR, SECRET_ERROR_PROTOCOL) /* = "received an invalid or unencryptable secret" */ || + strstr(gerror->message, "The secret was transferred or encrypted in an invalid way"); + SE_LOG_DEBUG(NULL, "IsSharedSecretError: %d/%d/%s: %s", (int)gerror->domain, (int)gerror->code, gerror->message, result ? "yes" : "no"); + return result; +} + bool GNOMELoadPasswordSlot(const InitStateTri &keyring, const std::string &passwordName, const std::string &descr, @@ -108,46 +123,49 @@ bool GNOMELoadPasswordSlot(const InitStateTri &keyring, return false; } - GnomeKeyringResult result = GNOME_KEYRING_RESULT_OK; - GList* list; - Timespec start = Timespec::monotonic(); - double sleepSecs = 0; - do { - if (sleepSecs != 0) { - SE_LOG_DEBUG(NULL, "%s: previous attempt to load password '%s' from GNOME keyring failed, will try again: %s", - key.description.c_str(), - key.toString().c_str(), - gnome_keyring_result_to_message(result)); - FlushGNOMEKeyring(); - Sleep(sleepSecs); - } - result = gnome_keyring_find_network_password_sync(passwdStr(key.user), - passwdStr(key.domain), - passwdStr(key.server), - passwdStr(key.object), - passwdStr(key.protocol), - passwdStr(key.authtype), - key.port, - &list); - sleepSecs = GNOMEKeyringRetryInterval; - } while (result != GNOME_KEYRING_RESULT_OK && - (Timespec::monotonic() - start).duration() < GNOMEKeyringRetryDuration); + LibSecretHash hash(key); + for (int i = 0; ; i++ ) { + GErrorCXX gerror; + PlainGStr result(secret_password_lookupv_sync(SECRET_SCHEMA_COMPAT_NETWORK, + hash, + NULL, + gerror)); - // if find password stored in gnome keyring - if(result == GNOME_KEYRING_RESULT_OK && list && list->data ) { - GnomeKeyringNetworkPasswordData *key_data; - key_data = (GnomeKeyringNetworkPasswordData*)list->data; - password = std::string(key_data->password); - gnome_keyring_network_password_list_free(list); - SE_LOG_DEBUG(NULL, "%s: loaded password from GNOME keyring using %s", - key.description.c_str(), - key.toString().c_str()); - } else { - SE_LOG_DEBUG(NULL, "password not in GNOME keyring using %s: %s", - key.toString().c_str(), - result == GNOME_KEYRING_RESULT_NO_MATCH ? "no match" : - result != GNOME_KEYRING_RESULT_OK ? gnome_keyring_result_to_message(result) : - "empty result list"); + // if find password stored in gnome keyring + if (gerror) { + /* It is uncertain whether we end up here at all when such + an error occurs. Check just in case. */ + if (IsSharedSecretError(gerror) && + i < 3) { + SE_LOG_DEBUG(NULL, "disconnecting secret service: %u/%d = %s", gerror->domain, gerror->code, gerror->message); + secret_service_disconnect(); + } else { + gerror.throwError(SE_HERE, StringPrintf("looking up password '%s'", descr.c_str())); + } + } else if (result.get()) { + SE_LOG_DEBUG(NULL, "%s: loaded password from GNOME keyring using %s", + key.description.c_str(), + key.toString().c_str()); + password = result; + break; + } else { + /* + * There have been cases where "received an invalid or + * unencryptable secret" was printed to the console right + * before we end up here. Apparently the error doesn't + * get propagated properly to us. + * + * To cope with that, we try to disconnect and check again. + */ + if (i < 3) { + SE_LOG_DEBUG(NULL, "disconnecting secret service: password not found"); + secret_service_disconnect(); + } else { + SE_LOG_DEBUG(NULL, "password not in GNOME keyring using %s", + key.toString().c_str()); + break; + } + } } return true; @@ -173,40 +191,38 @@ bool GNOMESavePasswordSlot(const InitStateTri &keyring, key.toString().c_str())); } - guint32 itemId; - GnomeKeyringResult result = GNOME_KEYRING_RESULT_OK; - // write password to keyring - Timespec start = Timespec::monotonic(); - double sleepSecs = 0; - do { - if (sleepSecs != 0) { - SE_LOG_DEBUG(NULL, "%s: previous attempt to save password '%s' in GNOME keyring failed, will try again: %s", - key.description.c_str(), - key.toString().c_str(), - gnome_keyring_result_to_message(result)); - FlushGNOMEKeyring(); - Sleep(sleepSecs); - } - result = gnome_keyring_set_network_password_sync(NULL, - passwdStr(key.user), - passwdStr(key.domain), - passwdStr(key.server), - passwdStr(key.object), - passwdStr(key.protocol), - passwdStr(key.authtype), - key.port, - password.c_str(), - &itemId); - sleepSecs = GNOMEKeyringRetryInterval; - } while (result != GNOME_KEYRING_RESULT_OK && - (Timespec::monotonic() - start).duration() < GNOMEKeyringRetryDuration); - if (result != GNOME_KEYRING_RESULT_OK) { - Exception::throwError(SE_HERE, StringPrintf("%s: saving password '%s' in GNOME keyring failed: %s", - key.description.c_str(), - key.toString().c_str(), - gnome_keyring_result_to_message(result))); + LibSecretHash hash(key); + std::string label; + if (!key.user.empty() && !key.server.empty()) { + // This emulates the behavior of libgnomekeyring. + label = key.user + "@" + key.server; + } else { + label = passwordName; + } + for (int i = 0; ; i++) { + GErrorCXX gerror; + gboolean result = secret_password_storev_sync(SECRET_SCHEMA_COMPAT_NETWORK, + hash, + NULL, + label.c_str(), + password.c_str(), + NULL, + gerror); + if (result) { + SE_LOG_DEBUG(NULL, "saved password in GNOME keyring using %s", key.toString().c_str()); + break; + } + + if (IsSharedSecretError(gerror) && + i < 3) { + SE_LOG_DEBUG(NULL, "disconnecting secret service: %u/%d = %s", gerror->domain, gerror->code, gerror->message); + secret_service_disconnect(); + } else { + gerror.throwError(SE_HERE, StringPrintf("%s: saving password '%s' in GNOME keyring", + key.description.c_str(), + key.toString().c_str())); + } } - SE_LOG_DEBUG(NULL, "saved password in GNOME keyring using %s", key.toString().c_str()); // handled return true; diff --git a/src/backends/gnome/configure-sub.in b/src/backends/gnome/configure-sub.in index 199989e8..d02d52a6 100644 --- a/src/backends/gnome/configure-sub.in +++ b/src/backends/gnome/configure-sub.in @@ -1,10 +1,13 @@ -PKG_CHECK_MODULES(KEYRING, [gnome-keyring-1 >= 2.20], HAVE_KEYRING=yes, HAVE_KEYRING=no) +# According to https://developer.gnome.org/libsecret/0.16/libsecret-Password-storage.html#secret-password-store-sync +# the simple API was still considered unstable. All supported distros +# now have 0.18 where the API is stable. +PKG_CHECK_MODULES(KEYRING, [libsecret-1 >= 0.18], HAVE_KEYRING=yes, HAVE_KEYRING=no) AC_ARG_ENABLE(gnome-keyring, AS_HELP_STRING([--enable-gnome-keyring], - [enables or disables support for the GNOME keyring; default is on if development files are available]), + [enables or disables support for the GNOME keyring via libsecret; default is on if development files are available]), [enable_gnome_keyring="$enableval" test "$enable_gnome_keyring" = "yes" || test "$enable_gnome_keyring" = "no" || AC_MSG_ERROR([invalid value for --enable-gnome-keyring: $enable_gnome_keyring]) - test "$enable_gnome_keyring" = "no" || test "$HAVE_KEYRING" = "yes" || AC_MSG_ERROR([gnome-keyring-1 pkg >= 2.20 not found, needed for --enable-gnome-keyring])], + test "$enable_gnome_keyring" = "no" || test "$HAVE_KEYRING" = "yes" || AC_MSG_ERROR([libsecret-1 >= 0.18 not found, needed for --enable-gnome-keyring])], enable_gnome_keyring="$HAVE_KEYRING") if test $enable_gnome_keyring = "yes"; then have_keyring=yes diff --git a/src/backends/oauth2/oauth2.cpp b/src/backends/oauth2/oauth2.cpp index 087fe52d..47d0bc18 100644 --- a/src/backends/oauth2/oauth2.cpp +++ b/src/backends/oauth2/oauth2.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include @@ -54,10 +55,10 @@ public: m_refreshToken(refreshToken) { #ifdef ENABLE_LIBSOUP - boost::shared_ptr agent(new SoupTransportAgent(static_cast(NULL))); - m_agent = agent; + m_agent = SoupTransportAgent::create(static_cast(NULL)); #elif defined(ENABLE_LIBCURL) - m_agent = new CurlTransportAgent(); + boost::shared_ptr agent(new CurlTransportAgent()); + m_agent = agent; #endif } diff --git a/src/backends/pbap/PbapSyncSource.cpp b/src/backends/pbap/PbapSyncSource.cpp index dab5bf56..15317d1f 100644 --- a/src/backends/pbap/PbapSyncSource.cpp +++ b/src/backends/pbap/PbapSyncSource.cpp @@ -291,7 +291,7 @@ private: PbapSyncSource &m_parent; boost::weak_ptr m_self; - std::auto_ptr m_client; + std::unique_ptr m_client; bool m_frozen; enum { OBEXD_OLD, // obexd < 0.47 @@ -333,14 +333,14 @@ private: Transfers m_transfers; std::string m_currentTransfer; - std::auto_ptr > + std::unique_ptr > m_errorSignal; void errorCb(const GDBusCXX::Path_t &path, const std::string &error, const std::string &msg); // Bluez 5 typedef GDBusCXX::SignalWatch4 > PropChangedSignal_t; - std::auto_ptr m_propChangedSignal; + std::unique_ptr m_propChangedSignal; void propChangedCb(const GDBusCXX::Path_t &path, const std::string &interface, const Params &changed, @@ -348,13 +348,13 @@ private: // new obexd API typedef GDBusCXX::SignalWatch1 CompleteSignal_t; - std::auto_ptr m_completeSignal; + std::unique_ptr m_completeSignal; void completeCb(const GDBusCXX::Path_t &path); typedef GDBusCXX::SignalWatch3 > PropertyChangedSignal_t; - std::auto_ptr m_propertyChangedSignal; + std::unique_ptr m_propertyChangedSignal; void propertyChangedCb(const GDBusCXX::Path_t &path, const std::string &name, const boost::variant &value); - std::auto_ptr m_session; + std::unique_ptr m_session; }; PbapSession::PbapSession(PbapSyncSource &parent) : diff --git a/src/backends/tdepim/TDEPIMNotesSource.h b/src/backends/tdepim/TDEPIMNotesSource.h index cd1c972d..8c623407 100644 --- a/src/backends/tdepim/TDEPIMNotesSource.h +++ b/src/backends/tdepim/TDEPIMNotesSource.h @@ -66,7 +66,6 @@ private: TQString appId; KNotesIface_stub *kn_iface; - DCOPClient *kn_dcop; /** Ugly hack to restart KNotes if it was running */ bool knotesWasRunning; diff --git a/src/backends/webdav/CalDAVSource.cpp b/src/backends/webdav/CalDAVSource.cpp index fa16935a..9c4a1c8d 100644 --- a/src/backends/webdav/CalDAVSource.cpp +++ b/src/backends/webdav/CalDAVSource.cpp @@ -721,8 +721,7 @@ SubSyncSource::SubItemResult CalDAVSource::insertSubItem(const std::string &luid eptr fullcal = event.m_calendar; loadItem(event); event.m_sequence++; - lastmodtime = icaltime_from_timet(event.m_lastmodtime, false); - lastmodtime.is_utc = 1; + lastmodtime = icaltime_from_timet_with_zone(event.m_lastmodtime, false, icaltimezone_get_utc_timezone()); event.m_calendar = fullcal; for (icalcomponent *comp = icalcomponent_get_first_component(event.m_calendar, ICAL_VEVENT_COMPONENT); comp; diff --git a/src/client-test-app.cpp b/src/client-test-app.cpp index b64a0734..ceea1f07 100644 --- a/src/client-test-app.cpp +++ b/src/client-test-app.cpp @@ -436,7 +436,7 @@ public: private: bool m_initialized; string m_clientID; - std::auto_ptr m_clientB; + std::unique_ptr m_clientB; const TestRegistry &m_configs; /** prefix, username, password to be used for local databases */ diff --git a/src/dbus/glib/glib.am b/src/dbus/glib/glib.am index 3335e42f..272b6d00 100644 --- a/src/dbus/glib/glib.am +++ b/src/dbus/glib/glib.am @@ -24,7 +24,7 @@ noinst_PROGRAMS += src/dbus/glib/test-syncevo-dbus src_dbus_glib_test_syncevo_dbus_SOURCES = src/dbus/glib/test.c src_dbus_glib_test_syncevo_dbus_LDADD = $(DBUS_GLIB_LIBS) $(src_dbus_glib_lib) -src_dbus_glib_test_syncevo_dbus_CFLAGS = $(DBUS_GLIB_CFLAGS) $(SYNCEVO_WFLAGS) +src_dbus_glib_test_syncevo_dbus_CFLAGS = $(DBUS_GLIB_CFLAGS) $(SYNCEVO_WFLAGS_DEPRECATED) src_dbus_glib_test_syncevo_dbus_CPPFLAGS = $(src_dbus_glib_cppflags) src_dbus_glib_built_sources = \ @@ -89,7 +89,7 @@ src_dbus_glib_libsyncevo_dbus_la_CFLAGS = \ -I$(top_srcdir) \ -I$(top_builddir) \ $(DBUS_GLIB_CFLAGS) \ - $(SYNCEVO_WFLAGS) + $(SYNCEVO_WFLAGS_DEPRECATED) src_dbus_glib_libsyncevo_dbus_la_LIBADD = \ $(DBUS_GLIB_LIBS) diff --git a/src/dbus/server/auto-sync-manager.h b/src/dbus/server/auto-sync-manager.h index 37db2016..5df72e84 100644 --- a/src/dbus/server/auto-sync-manager.h +++ b/src/dbus/server/auto-sync-manager.h @@ -29,9 +29,9 @@ #include #include #include +#include #include "notification-manager-factory.h" -#include "timeout.h" SE_BEGIN_CXX diff --git a/src/dbus/server/info-req.h b/src/dbus/server/info-req.h index b2e6a1fc..a5d4ce67 100644 --- a/src/dbus/server/info-req.h +++ b/src/dbus/server/info-req.h @@ -20,10 +20,11 @@ #ifndef INFO_REQ_H #define INFO_REQ_H +#include + #include #include "gdbus-cxx-bridge.h" -#include "timeout.h" #include diff --git a/src/dbus/server/pim/folks.h b/src/dbus/server/pim/folks.h index bf2f9dcf..83483f5c 100644 --- a/src/dbus/server/pim/folks.h +++ b/src/dbus/server/pim/folks.h @@ -146,6 +146,12 @@ class IndividualDataCompare : public std::binary_functioncompare(a.m_criteria, b.m_criteria); } + + IndividualDataCompare & operator = (const IndividualDataCompare &other) + { + m_compare = other.m_compare; + return *this; + } }; /** diff --git a/src/dbus/server/pim/individual-traits.cpp b/src/dbus/server/pim/individual-traits.cpp index 03e558a0..71cd2822 100644 --- a/src/dbus/server/pim/individual-traits.cpp +++ b/src/dbus/server/pim/individual-traits.cpp @@ -26,6 +26,8 @@ #include "persona-details.h" #include "folks.h" +#include + SE_GLIB_TYPE(GDateTime, g_date_time) SE_GOBJECT_TYPE(GTimeZone) SE_GOBJECT_TYPE(GObject) @@ -396,7 +398,7 @@ static void DBus2AbstractField(GDBusCXX::ExtractArgs &context, typedef std::vector< std::pair< std::string, std::vector > > Details_t; Details_t value; - GDBusCXX::dbus_traits::get(context, valueIter, value); + GDBusCXX::dbus_traits::get(context, valueIter, value); GeeHashSetCXX set(gee_hash_set_new(detailType, g_object_ref, g_object_unref, @@ -435,7 +437,7 @@ static void DBus2SimpleAbstractField(GDBusCXX::ExtractArgs &context, typedef std::vector Details_t; Details_t value; - GDBusCXX::dbus_traits::get(context, valueIter, value); + GDBusCXX::dbus_traits::get(context, valueIter, value); GeeHashSetCXX set(gee_hash_set_new(detailType, g_object_ref, g_object_unref, @@ -463,7 +465,7 @@ static void DBus2Role(GDBusCXX::ExtractArgs &context, typedef std::vector Details_t; Details_t value; - GDBusCXX::dbus_traits::get(context, valueIter, value); + GDBusCXX::dbus_traits::get(context, valueIter, value); GeeHashSetCXX set(gee_hash_set_new(FOLKS_TYPE_ROLE_FIELD_DETAILS, g_object_ref, g_object_unref, @@ -502,7 +504,7 @@ static void DBus2Groups(GDBusCXX::ExtractArgs &context, PersonaDetails &details) { std::list value; - GDBusCXX::dbus_traits::get(context, valueIter, value); + GDBusCXX::dbus_traits::get(context, valueIter, value); GeeHashSetCXX set(gee_hash_set_new(G_TYPE_STRING, (GBoxedCopyFunc)g_strdup, g_free, NULL, NULL, NULL, NULL, NULL, NULL), TRANSFER_REF); BOOST_FOREACH(const std::string &entry, value) { gee_collection_add(GEE_COLLECTION(set.get()), @@ -524,7 +526,7 @@ static void DBus2Addr(GDBusCXX::ExtractArgs &context, typedef std::vector< std::pair< StringMap, std::vector > > Details_t; Details_t value; - GDBusCXX::dbus_traits::get(context, valueIter, value); + GDBusCXX::dbus_traits::get(context, valueIter, value); GeeHashSetCXX set(gee_hash_set_new(FOLKS_TYPE_POSTAL_ADDRESS_FIELD_DETAILS, g_object_ref, g_object_unref, @@ -612,7 +614,7 @@ void DBus2PersonaDetails(GDBusCXX::ExtractArgs &context, new GValueObjectCXX(g_file_icon_new(file.get()), TRANSFER_REF)); } else if (key == CONTACT_HASH_BIRTHDAY) { boost::tuple value; - GDBusCXX::dbus_traits::get(context, valueIter, value); + GDBusCXX::dbus_traits::get(context, valueIter, value); GDateTimeCXX local(g_date_time_new_local(value.get<0>(), value.get<1>(), value.get<2>(), @@ -623,7 +625,7 @@ void DBus2PersonaDetails(GDBusCXX::ExtractArgs &context, new GValueDateTimeCXX(g_date_time_to_utc(local.get()), TRANSFER_REF)); } else if (key == CONTACT_HASH_LOCATION) { boost::tuple value; - GDBusCXX::dbus_traits::get(context, valueIter, value); + GDBusCXX::dbus_traits::get(context, valueIter, value); FolksLocationCXX location(folks_location_new(value.get<0>(), value.get<1>()), TRANSFER_REF); diff --git a/src/dbus/server/pim/locale-factory-boost.cpp b/src/dbus/server/pim/locale-factory-boost.cpp index a04dd9ed..2a3e6905 100644 --- a/src/dbus/server/pim/locale-factory-boost.cpp +++ b/src/dbus/server/pim/locale-factory-boost.cpp @@ -65,7 +65,7 @@ static const boost::locale::collator_base::level_type DEFAULT_COLLATION_LEVEL = class CompareBoost : public IndividualCompare, private boost::noncopyable { std::locale m_locale; const boost::locale::collator &m_collator; - std::auto_ptr m_trans; + std::unique_ptr m_trans; public: CompareBoost(const std::locale &locale); diff --git a/src/dbus/server/read-operations.cpp b/src/dbus/server/read-operations.cpp index 6bd57d97..65133908 100644 --- a/src/dbus/server/read-operations.cpp +++ b/src/dbus/server/read-operations.cpp @@ -295,7 +295,7 @@ void ReadOperations::checkSource(const std::string &sourceName) try { // this can already throw exceptions when the config is invalid SyncSourceParams params(sourceName, config->getSyncSourceNodes(sourceName), config); - auto_ptr syncSource(SyncSource::createSource(params, false, config.get())); + unique_ptr syncSource(SyncSource::createSource(params, false, config.get())); if (syncSource.get()) { syncSource->open(); @@ -318,7 +318,7 @@ void ReadOperations::getDatabases(const string &sourceName, SourceDatabases_t &d SyncSourceParams params(sourceName, config->getSyncSourceNodes(sourceName), config); const SourceRegistry ®istry(SyncSource::getSourceRegistry()); BOOST_FOREACH(const RegisterSyncSource *sourceInfo, registry) { - auto_ptr source(sourceInfo->m_create(params)); + unique_ptr source(sourceInfo->m_create(params)); if (!source.get()) { continue; } else if (source->isInactive()) { diff --git a/src/dbus/server/server.am b/src/dbus/server/server.am index 18c631fe..aab2d806 100644 --- a/src/dbus/server/server.am +++ b/src/dbus/server/server.am @@ -46,7 +46,6 @@ src_dbus_server_server_h_files = \ src/dbus/server/session-common.h \ src/dbus/server/source-progress.h \ src/dbus/server/source-status.h \ - src/dbus/server/timeout.h \ src/dbus/server/timer.h src_dbus_server_libsyncevodbusserver_la_SOURCES = \ diff --git a/src/dbus/server/server.cpp b/src/dbus/server/server.cpp index 8bcc6b4e..543cd7f1 100644 --- a/src/dbus/server/server.cpp +++ b/src/dbus/server/server.cpp @@ -23,13 +23,13 @@ #include #include +#include #include "server.h" #include "info-req.h" #include "connection.h" #include "bluez-manager.h" #include "session.h" -#include "timeout.h" #include "restart.h" #include "client.h" #include "auto-sync-manager.h" diff --git a/src/dbus/server/server.h b/src/dbus/server/server.h index 0b225912..8bda3e9b 100644 --- a/src/dbus/server/server.h +++ b/src/dbus/server/server.h @@ -27,10 +27,10 @@ #include #include +#include #include "exceptions.h" #include "auto-term.h" -#include "timeout.h" #include "dbus-callbacks.h" #include "read-operations.h" diff --git a/src/dbus/server/session.h b/src/dbus/server/session.h index f3bb2ce9..f9dae3d4 100644 --- a/src/dbus/server/session.h +++ b/src/dbus/server/session.h @@ -27,6 +27,7 @@ #include #include +#include #include "session-common.h" #include "read-operations.h" @@ -34,7 +35,6 @@ #include "source-progress.h" #include "source-status.h" #include "timer.h" -#include "timeout.h" #include "resource.h" #include "dbus-callbacks.h" diff --git a/src/gdbus/gdbus-cxx-bridge.h b/src/gdbus/gdbus-cxx-bridge.h index c3a0c910..82fbdf9f 100644 --- a/src/gdbus/gdbus-cxx-bridge.h +++ b/src/gdbus/gdbus-cxx-bridge.h @@ -1977,7 +1977,7 @@ class DBusResult : virtual public Result virtual Watch *createWatch(const boost::function &callback) { - std::auto_ptr watch(new Watch(m_conn, callback)); + std::unique_ptr watch(new Watch(m_conn, callback)); watch->activate(dbus_message_get_sender(m_msg.get())); return watch.release(); } diff --git a/src/gdbus/test/example.cpp b/src/gdbus/test/example.cpp index 32e09f15..be155759 100644 --- a/src/gdbus/test/example.cpp +++ b/src/gdbus/test/example.cpp @@ -65,7 +65,7 @@ class Test { static gboolean method_idle(gpointer data) { - std::auto_ptr mydata(static_cast(data)); + std::unique_ptr mydata(static_cast(data)); std::cout << "replying to method_async" << std::endl; mydata->m_result->done("Hello World, asynchronous and delayed"); return false; @@ -269,7 +269,7 @@ int main(int argc, char *argv[]) exit(1); } - std::auto_ptr test(new DBusTest(conn)); + std::unique_ptr test(new DBusTest(conn)); test->activate(); test->signal(42, "hello world", std::map()); test->deactivate(); diff --git a/src/gdbusxx/.gitignore b/src/gdbusxx/.gitignore deleted file mode 100644 index 6f30a3ab..00000000 --- a/src/gdbusxx/.gitignore +++ /dev/null @@ -1 +0,0 @@ -/example diff --git a/src/gdbusxx/gdbus-cxx-bridge.cpp b/src/gdbusxx/gdbus-cxx-bridge.cpp index 238b52f0..a170b264 100644 --- a/src/gdbusxx/gdbus-cxx-bridge.cpp +++ b/src/gdbusxx/gdbus-cxx-bridge.cpp @@ -484,7 +484,7 @@ Watch::~Watch() void getWatch(ExtractArgs &context, boost::shared_ptr &value) { - std::auto_ptr watch(new Watch(context.m_conn)); + std::unique_ptr watch(new Watch(context.m_conn)); watch->activate((context.m_msg && *context.m_msg) ? g_dbus_message_get_sender(*context.m_msg) : context.m_sender); diff --git a/src/gdbusxx/gdbus-cxx-bridge.h b/src/gdbusxx/gdbus-cxx-bridge.h index 131478ba..0656f77d 100644 --- a/src/gdbusxx/gdbus-cxx-bridge.h +++ b/src/gdbusxx/gdbus-cxx-bridge.h @@ -60,6 +60,7 @@ #include #include +#include #include #include @@ -111,8 +112,14 @@ typedef GDBusMessage message_type; typedef GVariantBuilder builder_type; typedef GVariantIter reader_type; +struct GDBusMessageUnref +{ + void operator () (GDBusMessage *ptr) const { g_object_unref(ptr); } +}; +typedef std::unique_ptr GDBusMessageUnique; + /** - * Simple auto_ptr for GVariant. + * Simple unique_ptr for GVariant. */ class GVariantCXX : boost::noncopyable { @@ -197,6 +204,13 @@ class DBusConnectionPtr : public boost::intrusive_ptr m_name(other.m_name) {} + DBusConnectionPtr & operator = (const DBusConnectionPtr &other) + { + *static_cast *>(this) = static_cast &>(other); + m_name = other.m_name; + return *this; + } + GDBusConnection *reference(void) throw() { GDBusConnection *conn = get(); @@ -436,7 +450,7 @@ struct AppendArgs { GDBusMessage *m_msg; GVariantBuilder m_builder; - AppendArgs(const std::auto_ptr &msg) { + AppendArgs(const GDBusMessageUnique &msg) { m_msg = msg.get(); if (!m_msg) { throw std::runtime_error("NULL GDBusMessage reply"); @@ -2718,7 +2732,7 @@ class DBusResult : virtual public Result virtual Watch *createWatch(const boost::function &callback) { - std::auto_ptr watch(new Watch(m_conn, callback)); + std::unique_ptr watch(new Watch(m_conn, callback)); watch->activate(g_dbus_message_get_sender(m_msg.get())); return watch.release(); } @@ -3175,7 +3189,7 @@ struct MakeMethodEntry< boost::function reply; + GDBusMessageUnique reply; typename dbus_traits::host_type a1; typename dbus_traits::host_type a2; typename dbus_traits::host_type a3; @@ -3268,7 +3282,7 @@ struct MakeMethodEntry< boost::function GDBusMessage *msg, void *data) { try { - std::auto_ptr reply; + GDBusMessageUnique reply; typename dbus_traits::host_type r; typename dbus_traits::host_type a1; typename dbus_traits::host_type a2; @@ -3359,7 +3373,7 @@ struct MakeMethodEntry< boost::function reply; + GDBusMessageUnique reply; typename dbus_traits::host_type a1; typename dbus_traits::host_type a2; typename dbus_traits::host_type a3; @@ -3448,7 +3462,7 @@ struct MakeMethodEntry< boost::function > GDBusMessage *msg, void *data) { try { - std::auto_ptr reply; + GDBusMessageUnique reply; typename dbus_traits::host_type r; typename dbus_traits::host_type a1; typename dbus_traits::host_type a2; @@ -3536,7 +3550,7 @@ struct MakeMethodEntry< boost::function > GDBusMessage *msg, void *data) { try { - std::auto_ptr reply; + GDBusMessageUnique reply; typename dbus_traits::host_type a1; typename dbus_traits::host_type a2; typename dbus_traits::host_type a3; @@ -3622,7 +3636,7 @@ struct MakeMethodEntry< boost::function > GDBusMessage *msg, void *data) { try { - std::auto_ptr reply; + GDBusMessageUnique reply; typename dbus_traits::host_type r; typename dbus_traits::host_type a1; typename dbus_traits::host_type a2; @@ -3706,7 +3720,7 @@ struct MakeMethodEntry< boost::function > GDBusMessage *msg, void *data) { try { - std::auto_ptr reply; + GDBusMessageUnique reply; typename dbus_traits::host_type a1; typename dbus_traits::host_type a2; typename dbus_traits::host_type a3; @@ -3789,7 +3803,7 @@ struct MakeMethodEntry< boost::function > GDBusMessage *msg, void *data) { try { - std::auto_ptr reply; + GDBusMessageUnique reply; typename dbus_traits::host_type r; typename dbus_traits::host_type a1; typename dbus_traits::host_type a2; @@ -3871,7 +3885,7 @@ struct MakeMethodEntry< boost::function > GDBusMessage *msg, void *data) { try { - std::auto_ptr reply; + GDBusMessageUnique reply; typename dbus_traits::host_type a1; typename dbus_traits::host_type a2; typename dbus_traits::host_type a3; @@ -3950,7 +3964,7 @@ struct MakeMethodEntry< boost::function > GDBusMessage *msg, void *data) { try { - std::auto_ptr reply; + GDBusMessageUnique reply; typename dbus_traits::host_type r; typename dbus_traits::host_type a1; typename dbus_traits::host_type a2; @@ -4027,7 +4041,7 @@ struct MakeMethodEntry< boost::function > GDBusMessage *msg, void *data) { try { - std::auto_ptr reply; + GDBusMessageUnique reply; typename dbus_traits::host_type a1; typename dbus_traits::host_type a2; typename dbus_traits::host_type a3; @@ -4103,7 +4117,7 @@ struct MakeMethodEntry< boost::function > GDBusMessage *msg, void *data) { try { - std::auto_ptr reply; + GDBusMessageUnique reply; typename dbus_traits::host_type r; typename dbus_traits::host_type a1; typename dbus_traits::host_type a2; @@ -4175,7 +4189,7 @@ struct MakeMethodEntry< boost::function > GDBusMessage *msg, void *data) { try { - std::auto_ptr reply; + GDBusMessageUnique reply; typename dbus_traits::host_type a1; typename dbus_traits::host_type a2; typename dbus_traits::host_type a3; @@ -4246,7 +4260,7 @@ struct MakeMethodEntry< boost::function > GDBusMessage *msg, void *data) { try { - std::auto_ptr reply; + GDBusMessageUnique reply; typename dbus_traits::host_type r; typename dbus_traits::host_type a1; typename dbus_traits::host_type a2; @@ -4315,7 +4329,7 @@ struct MakeMethodEntry< boost::function > GDBusMessage *msg, void *data) { try { - std::auto_ptr reply; + GDBusMessageUnique reply; typename dbus_traits::host_type a1; typename dbus_traits::host_type a2; typename dbus_traits::host_type a3; @@ -4383,7 +4397,7 @@ struct MakeMethodEntry< boost::function > GDBusMessage *msg, void *data) { try { - std::auto_ptr reply; + GDBusMessageUnique reply; typename dbus_traits::host_type r; typename dbus_traits::host_type a1; typename dbus_traits::host_type a2; @@ -4449,7 +4463,7 @@ struct MakeMethodEntry< boost::function > GDBusMessage *msg, void *data) { try { - std::auto_ptr reply; + GDBusMessageUnique reply; typename dbus_traits::host_type a1; typename dbus_traits::host_type a2; @@ -4514,7 +4528,7 @@ struct MakeMethodEntry< boost::function > GDBusMessage *msg, void *data) { try { - std::auto_ptr reply; + GDBusMessageUnique reply; typename dbus_traits::host_type r; typename dbus_traits::host_type a1; @@ -4577,7 +4591,7 @@ struct MakeMethodEntry< boost::function > GDBusMessage *msg, void *data) { try { - std::auto_ptr reply; + GDBusMessageUnique reply; typename dbus_traits::host_type a1; try { @@ -4636,7 +4650,7 @@ struct MakeMethodEntry< boost::function > GDBusMessage *msg, void *data) { try { - std::auto_ptr reply; + GDBusMessageUnique reply; typename dbus_traits::host_type r; try { diff --git a/src/gtk3-ui/gtk-ui.am b/src/gtk3-ui/gtk-ui.am index 523d5f82..097a919f 100644 --- a/src/gtk3-ui/gtk-ui.am +++ b/src/gtk3-ui/gtk-ui.am @@ -79,7 +79,7 @@ src_gtk3_ui_sync_ui_CFLAGS = \ -DTHEMEDIR=\""$(src_gtk3_ui_themercdir)"\" \ -DLIBEXECDIR=\"@libexecdir@\" \ -DSYNCEVOLUTION_LOCALEDIR=\"${SYNCEVOLUTION_LOCALEDIR}\" \ - $(SYNCEVO_WFLAGS) + $(SYNCEVO_WFLAGS_DEPRECATED) src_gtk3_ui_sync_ui_CPPFLAGS = \ -I$(top_builddir) \ -I$(top_srcdir) \ diff --git a/src/shlibs.local b/src/shlibs.local deleted file mode 100644 index ae955d3c..00000000 --- a/src/shlibs.local +++ /dev/null @@ -1,7 +0,0 @@ -# Evolution 3.10 -libebook-1.2 14 -libebook-contacts-1.2 0 -libecal-1.2 16 -libedataserver-1.2 18 -# libical v1 -libical 1 diff --git a/src/src.am b/src/src.am index 2cfbaf0d..6fd23a36 100644 --- a/src/src.am +++ b/src/src.am @@ -18,12 +18,14 @@ include $(top_srcdir)/src/syncevo/syncevo.am src_cppflags += -I$(top_srcdir)/src/syncevo include $(top_srcdir)/src/backends/backends.am src_cppflags += $(addprefix -I$(top_srcdir)/,$(BACKENDS)) -I$(SYNTHESIS_SUBDIR) -bin_PROGRAMS += src/syncevolution bin_SCRIPTS += src/synccompare include $(top_srcdir)/src/templates/templates.am else src_cppflags += -I$(top_srcdir)/$(SYNTHESIS_SUBDIR_INCLUDES) endif +if COND_CMDLINE +bin_PROGRAMS += src/syncevolution +endif include $(top_srcdir)/src/dbus/dbus.am src_cppflags += -I$(top_srcdir)/src/dbus @@ -55,7 +57,6 @@ SYNCEVOLUTION_LDADD += @SYNCSOURCES@ SYNCEVOLUTION_DEP += @SYNCSOURCES@ endif dist_noinst_DATA += \ - src/shlibs.local \ src/synthesis-includes/Makefile.am \ src/synthesis-includes/Makefile.in @@ -182,8 +183,8 @@ distclean-local: rm -rf $(SYNTHESIS_SUBDIR) rm -rf $(CLEAN_CLIENT_SRC) -# Local sync helper executable. Built unconditionally at the moment, -# thus creating a hard dependency on D-Bus. +# Local sync helper executable. Depends on D-Bus for internal communication. +if COND_LOCAL_SYNC libexec_PROGRAMS += src/syncevo-local-sync src_syncevo_local_sync_SOURCES = \ src/syncevo-local-sync.cpp \ @@ -196,7 +197,7 @@ src_syncevo_local_sync_CPPFLAGS = -DHAVE_CONFIG_H -I$(gdbus_dir) $(src_cppflags) src_syncevo_local_sync_CXXFLAGS = $(PCRECPP_CFLAGS) $(SYNCEVOLUTION_CXXFLAGS) $(CORE_CXXFLAGS) $(GLIB_CFLAGS) $(DBUS_CFLAGS) $(LIBSOUP_CFLAGS) $(SYNCEVO_WFLAGS) src_syncevo_local_sync_LDFLAGS = $(PCRECPP_LIBS) $(CORE_LD_FLAGS) $(LIBSOUP_LIBS) src_syncevo_local_sync_DEPENDENCIES = $(top_builddir)/$(gdbus_build_dir)/libgdbussyncevo.la $(EXTRA_LTLIBRARIES) $(CORE_DEP) $(SYNTHESIS_DEP) - +endif # Do the linking here, as with all SyncEvolution executables. # Sources are compiled in dbus/server. diff --git a/src/syncevo/Cmdline.cpp b/src/syncevo/Cmdline.cpp index c416cc22..f7b6d25e 100644 --- a/src/syncevo/Cmdline.cpp +++ b/src/syncevo/Cmdline.cpp @@ -810,7 +810,7 @@ bool Cmdline::run() { if (!m_server.empty() || backend != sourceFilter.end()) { // list for specific backend params.m_name = sourceName; - auto_ptr source(SyncSource::createSource(params, false, NULL)); + unique_ptr source(SyncSource::createSource(params, false, NULL)); if (source.get() != NULL) { if (!m_server.empty() && nodes) { // ensure that we have passwords for this config @@ -836,7 +836,7 @@ bool Cmdline::run() { // don't have a source name, so let's fall // back to the backend instead. params.m_name = type.m_backend; - auto_ptr source(SyncSource::createSource(params, false)); + unique_ptr source(SyncSource::createSource(params, false)); (this->*operation)(source.get(), header); } catch (...) { SE_LOG_ERROR(NULL, "%s:\naccessing databases failed", header.c_str()); @@ -1250,7 +1250,7 @@ bool Cmdline::run() { PasswordConfigProperty::CHECK_PASSWORD_RESOLVE_USERNAME, boost::assign::list_of(source)); SyncSourceParams params(source, to->getSyncSourceNodes(source), to); - auto_ptr syncSource(SyncSource::createSource(params, false, to.get())); + unique_ptr syncSource(SyncSource::createSource(params, false, to.get())); if (syncSource.get() == NULL) { disable = "no backend available"; } else { diff --git a/src/syncevo/GLibSupport.h b/src/syncevo/GLibSupport.h index 2567e1ac..694d379b 100644 --- a/src/syncevo/GLibSupport.h +++ b/src/syncevo/GLibSupport.h @@ -43,6 +43,7 @@ typedef void *GMainLoop; #include #include #include +#include #include #include @@ -407,7 +408,7 @@ struct GErrorCXX { GError *release() { GError *gerror = m_gerror; m_gerror = NULL; return gerror; } /** checks whether the current error is the one passed as parameters */ - bool matches(GQuark domain, gint code) { return g_error_matches(m_gerror, domain, code); } + bool matches(GQuark domain, gint code) const { return g_error_matches(m_gerror, domain, code); } /** * Use this when passing GErrorCXX instance to C functions which need to set it. @@ -730,7 +731,7 @@ template st A5_t retval3 = boost::value_initialized(); T t = finish(reinterpret_cast(sourceObject), result, &retval1, &retval2, &retval3); - std::auto_ptr cb(static_cast(userData)); + std::unique_ptr cb(static_cast(userData)); (*cb)(t, retval1, retval2, retval3); } catch (...) { // called from C, must not let exception escape @@ -755,7 +756,7 @@ template struct GAsyn A4_t retval2 = boost::value_initialized(); T t = finish(reinterpret_cast(sourceObject), result, &retval1, &retval2, gerror); - std::auto_ptr cb(static_cast(userData)); + std::unique_ptr cb(static_cast(userData)); (*cb)(t, retval1, retval2, gerror); } catch (...) { // called from C, must not let exception escape @@ -779,7 +780,7 @@ template struct GAsyn A4_t retval2 = boost::value_initialized(); T t = finish(reinterpret_cast(sourceObject), result, &retval1, &retval2); - std::auto_ptr cb(static_cast(userData)); + std::unique_ptr cb(static_cast(userData)); (*cb)(t, retval1, retval2); } catch (...) { // called from C, must not let exception escape @@ -802,7 +803,7 @@ template struct GAsyncReady4(); T t = finish(reinterpret_cast(sourceObject), result, &retval, gerror); - std::auto_ptr cb(static_cast(userData)); + std::unique_ptr cb(static_cast(userData)); (*cb)(t, retval, gerror); } catch (...) { // called from C, must not let exception escape @@ -822,7 +823,7 @@ template struct GAsyncReady3(sourceObject), result, gerror); - std::auto_ptr cb(static_cast(userData)); + std::unique_ptr cb(static_cast(userData)); (*cb)(t, gerror); } catch (...) { // called from C, must not let exception escape @@ -843,7 +844,7 @@ template struct GAsyncReady3(sourceObject), result, gerror); - std::auto_ptr cb(static_cast(userData)); + std::unique_ptr cb(static_cast(userData)); (*cb)(gerror); } catch (...) { // called from C, must not let exception escape @@ -863,7 +864,7 @@ template struct GAsyncReady2(sourceObject), result); - std::auto_ptr cb(static_cast(userData)); + std::unique_ptr cb(static_cast(userData)); (*cb)(t); } catch (...) { // called from C, must not let exception escape @@ -883,7 +884,7 @@ template struct GAsyncReady2 cb(static_cast(userData)); + std::unique_ptr cb(static_cast(userData)); (*cb)(t, gerror); } catch (...) { // called from C, must not let exception escape @@ -903,7 +904,7 @@ template struct GAsyncReady2(sourceObject), result); - std::auto_ptr cb(static_cast(userData)); + std::unique_ptr cb(static_cast(userData)); (*cb)(); } catch (...) { // called from C, must not let exception escape @@ -923,7 +924,7 @@ template struct GAsyncReady2 cb(static_cast(userData)); + std::unique_ptr cb(static_cast(userData)); (*cb)(gerror); } catch (...) { // called from C, must not let exception escape @@ -937,9 +938,9 @@ template struct GAsyncReady2::type, \ + GAsyncReadyCXX< boost::remove_pointer::type, \ & _prepare ## _finish, \ - boost::function_traits::type>::arity > + boost::function_traits::type>::arity > /** * Macro for asynchronous methods which use a GAsyncReadyCallback to @@ -1042,7 +1043,7 @@ template<> class GAsyncReadyDoneCXX do { \ bool done = false; \ SYNCEVO_GLIB_CALL_ASYNC(_prepare, \ - GAsyncReadyDoneCXX::result_type>::createCB(_res, _gerror, done), \ + GAsyncReadyDoneCXX::result_type>::createCB(_res, _gerror, done), \ _args); \ GRunWhile(! boost::lambda::var(done)); \ } while (false); \ diff --git a/src/syncevo/LocalTransportAgent.cpp b/src/syncevo/LocalTransportAgent.cpp index 1922e8f1..6c26254a 100644 --- a/src/syncevo/LocalTransportAgent.cpp +++ b/src/syncevo/LocalTransportAgent.cpp @@ -699,7 +699,7 @@ public: class ChildLogger : public Logger { - std::auto_ptr m_parentLogger; + std::unique_ptr m_parentLogger; boost::weak_ptr m_child; public: diff --git a/src/syncevo/SoupTransportAgent.cpp b/src/syncevo/SoupTransportAgent.cpp index fb5d2bd0..9dd7f581 100644 --- a/src/syncevo/SoupTransportAgent.cpp +++ b/src/syncevo/SoupTransportAgent.cpp @@ -25,28 +25,28 @@ #include #include -#ifdef HAVE_LIBSOUP_SOUP_GNOME_FEATURES_H -#include -#endif - #include SE_BEGIN_CXX +boost::shared_ptr SoupTransportAgent::create(GMainLoop *loop) +{ + boost::shared_ptr self(new SoupTransportAgent(loop)); + self->m_self = self; + return self; +} + SoupTransportAgent::SoupTransportAgent(GMainLoop *loop) : m_verifySSL(false), - m_session(soup_session_async_new()), + m_session(soup_session_new_with_options("timeout", 0, (void *)NULL)), m_loop(loop ? g_main_loop_ref(loop) : g_main_loop_new(NULL, TRUE), "Soup main loop"), m_status(INACTIVE), + m_message(NULL), m_timeoutSeconds(0), m_response(0) { -#ifdef HAVE_LIBSOUP_SOUP_GNOME_FEATURES_H - // use default GNOME proxy settings - soup_session_add_feature_by_type(m_session.get(), SOUP_TYPE_PROXY_RESOLVER_GNOME); -#endif } SoupTransportAgent::~SoupTransportAgent() @@ -138,12 +138,14 @@ void SoupTransportAgent::send(const char *data, size_t len) soup_message_set_request(message.get(), m_contentType.c_str(), SOUP_MEMORY_TEMPORARY, data, len); m_status = ACTIVE; + // We just keep a pointer for the timeout, without owning the message. + m_message = message.get(); if (m_timeoutSeconds) { - m_message = message.get(); - m_timeoutEventSource = g_timeout_add_seconds(m_timeoutSeconds, TimeoutCallback, static_cast (this)); + m_timeout.runOnce(m_timeoutSeconds, + boost::bind(&SoupTransportAgent::handleTimeoutWrapper, m_self)); } soup_session_queue_message(m_session.get(), message.release(), - SessionCallback, static_cast(this)); + SessionCallback, new boost::weak_ptr(m_self)); } void SoupTransportAgent::cancel() @@ -188,7 +190,6 @@ TransportAgent::Status SoupTransportAgent::wait(bool noReply) SE_THROW_EXCEPTION(TransportException, failure); } - m_timeoutEventSource.set(0); return m_status; } @@ -208,18 +209,29 @@ void SoupTransportAgent::SessionCallback(SoupSession *session, SoupMessage *msg, gpointer user_data) { - static_cast(user_data)->HandleSessionCallback(session, msg); + // A copy of the weak_ptr was created for us, which we need to delete now. + boost::weak_ptr *self = static_cast< boost::weak_ptr *>(user_data); + boost::shared_ptr agent(self->lock()); + delete self; + + if (agent.get()) { + agent->HandleSessionCallback(session, msg); + } } void SoupTransportAgent::HandleSessionCallback(SoupSession *session, SoupMessage *msg) { + // Message is no longer pending, so timeout no longer needed either. + m_message = NULL; + m_timeout.deactivate(); + // keep a reference to the data m_responseContentType = ""; if (msg->response_body) { m_response = soup_message_body_flatten(msg->response_body); - const char *soupContentType = soup_message_headers_get(msg->response_headers, - "Content-Type"); + const char *soupContentType = soup_message_headers_get_one(msg->response_headers, + "Content-Type"); if (soupContentType) { m_responseContentType = soupContentType; } @@ -246,19 +258,24 @@ void SoupTransportAgent::HandleSessionCallback(SoupSession *session, g_main_loop_quit(m_loop.get()); } -gboolean SoupTransportAgent::processCallback() +void SoupTransportAgent::handleTimeout() { - //stop the message processing and mark status as timeout - guint message_status = SOUP_STATUS_CANCELLED; - soup_session_cancel_message(m_session.get(), m_message, message_status); - m_status = TIME_OUT; - return FALSE; + // Stop the message processing and mark status as timeout, if message is really still + // pending. + if (m_message) { + guint message_status = SOUP_STATUS_CANCELLED; + soup_session_cancel_message(m_session.get(), m_message, message_status); + g_main_loop_quit(m_loop.get()); + m_status = TIME_OUT; + } } -gboolean SoupTransportAgent::TimeoutCallback(gpointer transport) +void SoupTransportAgent::handleTimeoutWrapper(const boost::weak_ptr &agent) { - SoupTransportAgent * sTransport = static_cast(transport); - return sTransport->processCallback(); + boost::shared_ptr self(agent.lock()); + if (self.get()) { + self->handleTimeout(); + } } SE_END_CXX diff --git a/src/syncevo/SoupTransportAgent.h b/src/syncevo/SoupTransportAgent.h index b4eba8ae..d43fd408 100644 --- a/src/syncevo/SoupTransportAgent.h +++ b/src/syncevo/SoupTransportAgent.h @@ -26,9 +26,12 @@ #include #include +#include #include #include +#include + #include SE_BEGIN_CXX @@ -55,7 +58,7 @@ class SoupTransportAgent : public HTTPTransportAgent * transport will increase the reference count; * if NULL a new loop in the default context is used */ - SoupTransportAgent(GMainLoop *loop = NULL); + static boost::shared_ptr create(GMainLoop *loop = NULL); ~SoupTransportAgent(); virtual void setURL(const std::string &url); @@ -72,8 +75,8 @@ class SoupTransportAgent : public HTTPTransportAgent virtual Status wait(bool noReply = false); virtual void getReply(const char *&data, size_t &len, std::string &contentType); virtual void setTimeout(int seconds); - gboolean processCallback(); private: + boost::weak_ptr m_self; std::string m_proxyUser; std::string m_proxyPassword; std::string m_cacerts; @@ -86,11 +89,10 @@ class SoupTransportAgent : public HTTPTransportAgent std::string m_failure; SoupMessage *m_message; - GLibEvent m_timeoutEventSource; + Timeout m_timeout; int m_timeoutSeconds; - /** This function is called regularly to detect timeout */ - static gboolean TimeoutCallback (gpointer data); + SoupTransportAgent(GMainLoop *loop); /** response, copied from SoupMessage */ eptr m_response; @@ -102,6 +104,8 @@ class SoupTransportAgent : public HTTPTransportAgent gpointer user_data); void HandleSessionCallback(SoupSession *session, SoupMessage *msg); + void handleTimeout(); + static void handleTimeoutWrapper(const boost::weak_ptr &agent); }; SE_END_CXX diff --git a/src/syncevo/SyncContext.cpp b/src/syncevo/SyncContext.cpp index 2d838105..3bef32f3 100644 --- a/src/syncevo/SyncContext.cpp +++ b/src/syncevo/SyncContext.cpp @@ -59,6 +59,7 @@ using namespace std; #include #include #include +#include #include #include @@ -1681,7 +1682,7 @@ boost::shared_ptr SyncContext::createTransportAgent(void *gmainl } else if (boost::starts_with(url, "http://") || boost::starts_with(url, "https://")) { #ifdef ENABLE_LIBSOUP - boost::shared_ptr agent(new SoupTransportAgent(static_cast(gmainloop))); + boost::shared_ptr agent(SoupTransportAgent::create(static_cast(gmainloop))); agent->setConfig(*this); InitializeTransport(agent, timeout); return agent; @@ -3284,8 +3285,8 @@ void SyncContext::initMain(const char *appname) typedef void (*LogFunc_t)(int level, const char *str); void (*set_log_function)(LogFunc_t func); - set_log_level = (typeof(set_log_level))dlsym(RTLD_DEFAULT, "gnutls_global_set_log_level"); - set_log_function = (typeof(set_log_function))dlsym(RTLD_DEFAULT, "gnutls_global_set_log_function"); + set_log_level = (BOOST_TYPEOF(set_log_level))dlsym(RTLD_DEFAULT, "gnutls_global_set_log_level"); + set_log_function = (BOOST_TYPEOF(set_log_function))dlsym(RTLD_DEFAULT, "gnutls_global_set_log_function"); if (set_log_level && set_log_function) { set_log_level(atoi(gnutlsdbg)); @@ -3969,7 +3970,7 @@ SyncMLStatus SyncContext::doSync() sysync::STEPCMD_CLIENTSTART; SharedSession session = m_engine.OpenSession(m_sessionID); SharedBuffer sendBuffer; - std::auto_ptr sessionSentinel(new SessionSentinel(*this, session)); + std::unique_ptr sessionSentinel(new SessionSentinel(*this, session)); if (m_serverMode && !m_localSync) { m_engine.WriteSyncMLBuffer(session, diff --git a/src/syncevo/SyncContext.h b/src/syncevo/SyncContext.h index b5e00ecf..f14b8d5f 100644 --- a/src/syncevo/SyncContext.h +++ b/src/syncevo/SyncContext.h @@ -608,7 +608,10 @@ class SyncContext : public SyncConfig { int32_t m_extra1, m_extra2, m_extra3; SyncSourceEvent() : - m_type(sysync::PEV_NOP) + m_type(sysync::PEV_NOP), + m_extra1(0), + m_extra2(0), + m_extra3(0) {} SyncSourceEvent(sysync::TProgressEventEnum type, diff --git a/src/syncevo/SyncSource.cpp b/src/syncevo/SyncSource.cpp index ebb70a5e..75b2fbdd 100644 --- a/src/syncevo/SyncSource.cpp +++ b/src/syncevo/SyncSource.cpp @@ -465,15 +465,15 @@ SyncSource *SyncSource::createSource(const SyncSourceParams ¶ms, bool error, } const SourceRegistry ®istry(getSourceRegistry()); - auto_ptr source; + unique_ptr source; BOOST_FOREACH(const RegisterSyncSource *sourceInfos, registry) { - auto_ptr nextSource(sourceInfos->m_create(params)); + unique_ptr nextSource(sourceInfos->m_create(params)); if (nextSource.get()) { if (source.get()) { Exception::throwError(SE_HERE, params.getDisplayName() + ": backend " + sourceType.m_backend + " is ambiguous, avoid the alias and pick a specific backend instead directly"); } - source = nextSource; + source = std::move(nextSource); } } if (source.get()) { @@ -1694,7 +1694,7 @@ void SyncSourceAdmin::entry2mapid(const string &key, const string &value, sysync void SyncSourceAdmin::init(SyncSource::Operations &ops, const boost::shared_ptr &config, - const std::string adminPropertyName, + const std::string &adminPropertyName, const boost::shared_ptr &mapping) { m_configNode = config; diff --git a/src/syncevo/SyncSource.h b/src/syncevo/SyncSource.h index 1d445198..5d2d1787 100644 --- a/src/syncevo/SyncSource.h +++ b/src/syncevo/SyncSource.h @@ -857,7 +857,6 @@ template class OperationWrapperSwitch PreSignal &getPreSignal() const { return const_cast(m_pre); } PostSignal &getPostSignal() const { return const_cast(m_post); } - OperationWrapperSwitch(SyncSourceName &source) : m_source(source), m_pre(OperationSlotInvoker(source)), @@ -2150,7 +2149,7 @@ class SyncSource : virtual public SyncSourceBase, public SyncSourceConfig, publi /* implementation of SyncSourceBase */ virtual std::string getName() const { return SyncSourceConfig::getName(); } - virtual std::string getDisplayName() const { return m_name.c_str(); } + virtual std::string getDisplayName() const { return m_name; } virtual void setDisplayName(const std::string &name) { m_name = name; } virtual long getNumDeleted() const { return m_numDeleted; } virtual void setNumDeleted(long num) { m_numDeleted = num; } @@ -2994,7 +2993,7 @@ class SyncSourceAdmin : public virtual SyncSourceBase /** flexible initialization */ void init(SyncSource::Operations &ops, const boost::shared_ptr &config, - const std::string adminPropertyName, + const std::string &adminPropertyName, const boost::shared_ptr &mapping); /** diff --git a/src/syncevo/SynthesisDBPlugin.cpp b/src/syncevo/SynthesisDBPlugin.cpp index 6d76c9b7..d61dbb7d 100644 --- a/src/syncevo/SynthesisDBPlugin.cpp +++ b/src/syncevo/SynthesisDBPlugin.cpp @@ -475,7 +475,7 @@ bool SyncEvolution_ReadNextMapItem( CContext aContext, MapID mID, bool aFirst ) { SyncSource *source = DBC( aContext ); if (!source) { - return LOCERR_WRONGUSAGE; + return false; } bool res = false; try { diff --git a/src/syncevo/eds_abi_wrapper.cpp b/src/syncevo/eds_abi_wrapper.cpp index 40d4e90a..6be2aa8a 100644 --- a/src/syncevo/eds_abi_wrapper.cpp +++ b/src/syncevo/eds_abi_wrapper.cpp @@ -26,6 +26,8 @@ #include #include +#include + #include namespace { static std::string &getLookupDebug() { static std::string lookupDebug; return lookupDebug; } @@ -100,10 +102,10 @@ dbus_connection_send_with_reply (void *connection, void **pending_return, int timeout_milliseconds) { - static typeof(dbus_connection_send_with_reply) *real_func; + static BOOST_TYPEOF(dbus_connection_send_with_reply) *real_func; if (!real_func) { - real_func = (typeof(dbus_connection_send_with_reply) *)dlsym(RTLD_NEXT, "dbus_connection_send_with_reply"); + real_func = (BOOST_TYPEOF(dbus_connection_send_with_reply) *)dlsym(RTLD_NEXT, "dbus_connection_send_with_reply"); } return real_func ? real_func(connection, message, pending_return, diff --git a/src/syncevo/icaltz-util.c b/src/syncevo/icaltz-util.c index 202a2cd9..3e4925c5 100644 --- a/src/syncevo/icaltz-util.c +++ b/src/syncevo/icaltz-util.c @@ -184,7 +184,7 @@ decode (const void *ptr) else { const unsigned char *p = ptr; - int result = *p & (1 << (CHAR_BIT - 1)) ? ~0 : 0; + unsigned result = *p & (1 << (CHAR_BIT - 1)) ? ~0 : 0; result = (result << 8) | *p++; result = (result << 8) | *p++; @@ -224,7 +224,7 @@ find_transidx (time_t *transitions, ttinfo *types, int *trans_idx, long int num_ struct icaltimetype itime; now = time (NULL); - itime = icaltime_from_timet (now, 0); + itime = icaltime_from_timet_with_zone (now, 0, NULL); itime.month = itime.day = 1; itime.hour = itime.minute = itime.second = 0; year_start = icaltime_as_timet(itime); @@ -304,13 +304,13 @@ adjust_dtstart_day_to_rrule (icalcomponent *comp, struct icalrecurrencetype rule icalrecur_iterator *iter; now = time (NULL); - itime = icaltime_from_timet (now, 0); + itime = icaltime_from_timet_with_zone (now, 0, NULL); itime.month = itime.day = 1; itime.hour = itime.minute = itime.second = 0; year_start = icaltime_as_timet(itime); comp_start = icalcomponent_get_dtstart (comp); - start = icaltime_from_timet (year_start, 0); + start = icaltime_from_timet_with_zone (year_start, 0, NULL); iter = icalrecur_iterator_new (rule, start); iter_start = icalrecur_iterator_next (iter); @@ -478,7 +478,7 @@ icaltzutil_fetch_timezone (const char *location) trans = transitions [stdidx] + types [zp_idx].gmtoff; else trans = types [zp_idx].gmtoff; - icaltime = icaltime_from_timet (trans, 0); + icaltime = icaltime_from_timet_with_zone (trans, 0, NULL); dtstart = icaltime; dtstart.year = 1970; dtstart.minute = dtstart.second = 0; @@ -520,7 +520,7 @@ icaltzutil_fetch_timezone (const char *location) trans = transitions [dstidx] + types [zp_idx].gmtoff; else trans = types [zp_idx].gmtoff; - icaltime = icaltime_from_timet (trans, 0); + icaltime = icaltime_from_timet_with_zone (trans, 0, NULL); dtstart = icaltime; dtstart.year = 1970; dtstart.minute = dtstart.second = 0; diff --git a/src/syncevo/syncevo.am b/src/syncevo/syncevo.am index 7720dc64..099d5ea5 100644 --- a/src/syncevo/syncevo.am +++ b/src/syncevo/syncevo.am @@ -210,6 +210,7 @@ src_syncevo_libsyncevolution_include_HEADERS = \ src/syncevo/IdentityProvider.h \ src/syncevo/GuardFD.h \ src/syncevo/util.h \ + src/syncevo/timeout.h \ src/syncevo/BoostHelper.h \ src/syncevo/SuspendFlags.h \ src/syncevo/SyncContext.h \ diff --git a/src/dbus/server/timeout.h b/src/syncevo/timeout.h similarity index 100% rename from src/dbus/server/timeout.h rename to src/syncevo/timeout.h diff --git a/src/syncevo/util.h b/src/syncevo/util.h index 20a8a452..41207f96 100644 --- a/src/syncevo/util.h +++ b/src/syncevo/util.h @@ -363,6 +363,7 @@ template class Init { Init() : m_value(boost::value_initialized()) {} Init(const Init &other) : m_value(other.m_value) {} Init & operator = (const T &val) { m_value = val; return *this; } + Init & operator = (const Init &other) { m_value = other.m_value; return *this; } operator const T & () const { return m_value; } operator T & () { return m_value; } private: diff --git a/src/syncevolution.cpp b/src/syncevolution.cpp index 801a5cf9..b768afca 100644 --- a/src/syncevolution.cpp +++ b/src/syncevolution.cpp @@ -54,6 +54,8 @@ using namespace GDBusCXX; #endif +#include + #include #include #include @@ -74,10 +76,10 @@ SE_BEGIN_CXX #undef e_contact_new_from_vcard extern "C" EContact *e_contact_new_from_vcard(const char *vcard) { - static typeof(e_contact_new_from_vcard) *impl; + static BOOST_TYPEOF(e_contact_new_from_vcard) *impl; if (!impl) { - impl = (typeof(impl))dlsym(RTLD_NEXT, "e_contact_new_from_vcard"); + impl = (BOOST_TYPEOF(impl))dlsym(RTLD_NEXT, "e_contact_new_from_vcard"); } // Old versions of EDS-DBus parse_changes_array() call diff --git a/test/ClientTest.cpp b/test/ClientTest.cpp index 0bf604d9..1ec4ff5b 100644 --- a/test/ClientTest.cpp +++ b/test/ClientTest.cpp @@ -69,6 +69,7 @@ #include #include #include +#include #include @@ -161,7 +162,7 @@ public: } virtual SyncContext *createSyncClient() { - std::auto_ptr context(new SyncContext(m_server, true)); + std::unique_ptr context(new SyncContext(m_server, true)); boost::shared_ptr ui(new SimpleUserInterface(context->getKeyring())); context->setUserInterface(ui); return context.release(); @@ -364,9 +365,9 @@ static void stripComponent(std::string &data, * is created for each source (see TestEvolution::createSource() and * SyncConfig::getSyncSourceNodes()). */ -class TestingSyncSourcePtr : public std::auto_ptr +class TestingSyncSourcePtr : public std::unique_ptr { - typedef std::auto_ptr base_t; + typedef std::unique_ptr base_t; bool m_active; static StringMap m_anchors; @@ -391,6 +392,9 @@ public: } } + // Not implemented, only declared to keep cppcheck happy. + TestingSyncSourcePtr &operator = (const TestingSyncSourcePtr &other); + enum Flags { SLOW, /**< erase anchor, start accessing database from scratch */ INCREMENTAL /**< allow source to do incremental data read */ @@ -1106,10 +1110,10 @@ void LocalTests::testOpen() { // check requirements CT_ASSERT(config.m_createSourceA); - // Intentionally use the plain auto_ptr here and + // Intentionally use the plain unique_ptr here and // call open directly. That way it is a bit more clear // what happens and where it fails, if it fails. - std::auto_ptr source; + std::unique_ptr source; CT_ASSERT_NO_THROW(source.reset(createSourceA())); // got a sync source? CT_ASSERT(source.get() != 0); @@ -1685,7 +1689,7 @@ void LocalTests::testRemoveProperties() { // compare TestingSyncSourcePtr copy; SOURCE_ASSERT_NO_FAILURE(copy.get(), copy.reset(createSourceA(), TestingSyncSourcePtr::SLOW)); - std::auto_ptr envProps; + std::unique_ptr envProps; if (currentServer() == "googlecontacts") { // Google CardDAV server does not remove X- properties when // they are not sent at all. TODO (?): send them as empty @@ -3163,8 +3167,6 @@ void SyncTests::refreshClient(SyncOptions options) { // delete all items, locally and on server using refresh-from-client sync void SyncTests::testDeleteAllRefresh() { - source_it it; - // start with clean local data CT_ASSERT_NO_THROW(allSourcesDeleteAll()); @@ -3177,7 +3179,7 @@ void SyncTests::testDeleteAllRefresh() { deleteAll(DELETE_ALL_REFRESH); // nothing stored locally? - for (it = sources.begin(); it != sources.end(); ++it) { + for (source_it it = sources.begin(); it != sources.end(); ++it) { TestingSyncSourcePtr source; SOURCE_ASSERT_NO_FAILURE(source.get(), source.reset(it->second->createSourceA())); SOURCE_ASSERT_EQUAL(source.get(), 0, countItems(source.get())); @@ -3189,7 +3191,7 @@ void SyncTests::testDeleteAllRefresh() { "check", SyncOptions(SYNC_SLOW, CheckSyncReport(0,0,0, 0,0,0, true, SYNC_SLOW))); - for (it = sources.begin(); it != sources.end(); ++it) { + for (source_it it = sources.begin(); it != sources.end(); ++it) { TestingSyncSourcePtr source; SOURCE_ASSERT_NO_FAILURE(source.get(), source.reset(it->second->createSourceA())); SOURCE_ASSERT_EQUAL(source.get(), 0, countItems(source.get())); @@ -3240,8 +3242,6 @@ void SyncTests::testDeleteAllSync() // test that a refresh sync from an empty server leads to an empty datatbase // and no changes are sent to server during next two-way sync void SyncTests::testRefreshFromServerSemantic() { - source_it it; - // clean client and server CT_ASSERT_NO_THROW(deleteAll()); @@ -3253,7 +3253,7 @@ void SyncTests::testRefreshFromServerSemantic() { CheckSyncReport(0,0,-1, 0,0,0, true, SYNC_REFRESH_FROM_REMOTE))); // check - for (it = sources.begin(); it != sources.end(); ++it) { + for (source_it it = sources.begin(); it != sources.end(); ++it) { TestingSyncSourcePtr source; SOURCE_ASSERT_NO_FAILURE(source.get(), source.reset(it->second->createSourceA())); SOURCE_ASSERT_EQUAL(source.get(), 0, countItems(source.get())); @@ -3268,8 +3268,6 @@ void SyncTests::testRefreshFromServerSemantic() { // test that a refresh sync from an empty client leads to an empty datatbase // and no changes are sent to server during next two-way sync void SyncTests::testRefreshFromClientSemantic() { - source_it it; - // clean client and server CT_ASSERT_NO_THROW(deleteAll()); @@ -3303,8 +3301,6 @@ void SyncTests::testRefreshFromClientSemantic() { // - refresh from client // => no items should now be listed as new, updated or deleted for this client during another sync void SyncTests::testRefreshStatus() { - source_it it; - CT_ASSERT_NO_THROW(allSourcesInsert(false)); CT_ASSERT_NO_THROW(allSourcesDeleteAll()); CT_ASSERT_NO_THROW(allSourcesInsert()); @@ -3406,15 +3402,15 @@ void SyncTests::doRestartSync(SyncMode mode) (boost::lambda::if_then(boost::lambda::var(needToConnect), (boost::lambda::var(needToConnect) = false, boost::lambda::bind(connectSourceSignal, + BOOST_TYPEOF(&SyncSource::Operations::StartDataRead_t::getPreSignal), + BOOST_TYPEOF(start)>, boost::lambda::_1, &SyncSource::Operations::m_startDataRead, &SyncSource::Operations::StartDataRead_t::getPreSignal, boost::cref(start)), boost::lambda::bind(connectSourceSignal, + BOOST_TYPEOF(&SyncSource::Operations::EndDataWrite_t::getPostSignal), + BOOST_TYPEOF(end)>, boost::lambda::_1, &SyncSource::Operations::m_endDataWrite, &SyncSource::Operations::EndDataWrite_t::getPostSignal, @@ -3753,8 +3749,8 @@ void SyncTests::testManyRestarts() (boost::lambda::if_then(boost::lambda::var(needToConnect), (boost::lambda::var(needToConnect) = false, boost::lambda::bind(connectSourceSignal, + BOOST_TYPEOF(&SyncSource::Operations::StartDataRead_t::getPreSignal), + BOOST_TYPEOF(start)>, boost::lambda::_1, &SyncSource::Operations::m_startDataRead, &SyncSource::Operations::StartDataRead_t::getPreSignal, @@ -3832,8 +3828,7 @@ void SyncTests::testUpdate() { // setup client A, B and server so that they all contain the same item CT_ASSERT_NO_THROW(doCopy()); - source_it it; - for (it = sources.begin(); it != sources.end(); ++it) { + for (source_it it = sources.begin(); it != sources.end(); ++it) { CT_ASSERT_NO_THROW(it->second->update(it->second->createSourceA, it->second->config.m_updateItem)); } @@ -3856,8 +3851,7 @@ void SyncTests::testComplexUpdate() { // setup client A, B and server so that they all contain the same item CT_ASSERT_NO_THROW(doCopy()); - source_it it; - for (it = sources.begin(); it != sources.end(); ++it) { + for (source_it it = sources.begin(); it != sources.end(); ++it) { it->second->update(it->second->createSourceA, /* this test might get executed with some sources which have a complex update item while others don't: use the normal update item @@ -3915,13 +3909,12 @@ void SyncTests::testMerge() { CT_ASSERT_NO_THROW(doCopy()); // update in client A - source_it it; - for (it = sources.begin(); it != sources.end(); ++it) { + for (source_it it = sources.begin(); it != sources.end(); ++it) { CT_ASSERT_NO_THROW(it->second->update(it->second->createSourceA, it->second->config.m_mergeItem1)); } // update in client B - for (it = accessClientB->sources.begin(); it != accessClientB->sources.end(); ++it) { + for (source_it it = accessClientB->sources.begin(); it != accessClientB->sources.end(); ++it) { CT_ASSERT_NO_THROW(it->second->update(it->second->createSourceA, it->second->config.m_mergeItem2)); } @@ -3941,7 +3934,7 @@ void SyncTests::testMerge() { CheckSyncReport(-1,-1,-1, -1,-1,-1, true, SYNC_TWO_WAY))); // figure out how the conflict during ".conflict" was handled - for (it = accessClientB->sources.begin(); it != accessClientB->sources.end(); ++it) { + for (source_it it = accessClientB->sources.begin(); it != accessClientB->sources.end(); ++it) { TestingSyncSourcePtr copy; SOURCE_ASSERT_NO_FAILURE(copy.get(), copy.reset(it->second->createSourceA())); int numItems = 0; @@ -3979,8 +3972,7 @@ void SyncTests::testTwinning() { CT_ASSERT_NO_THROW(deleteAll()); // import test data - source_it it; - for (it = sources.begin(); it != sources.end(); ++it) { + for (source_it it = sources.begin(); it != sources.end(); ++it) { CT_ASSERT_NO_THROW(it->second->testImport()); } @@ -4017,8 +4009,7 @@ void SyncTests::doOneWayFromRemote(SyncMode oneWayFromRemote) { // check that everything is empty, also resets change tracking // in second sources of each client - source_it it; - for (it = sources.begin(); it != sources.end(); ++it) { + for (source_it it = sources.begin(); it != sources.end(); ++it) { if (it->second->config.m_createSourceB) { TestingSyncSourcePtr source; SOURCE_ASSERT_NO_FAILURE(source.get(), source.reset(it->second->createSourceB())); @@ -4026,7 +4017,7 @@ void SyncTests::doOneWayFromRemote(SyncMode oneWayFromRemote) { CT_ASSERT_NO_THROW(source.reset()); } } - for (it = accessClientB->sources.begin(); it != accessClientB->sources.end(); ++it) { + for (source_it it = accessClientB->sources.begin(); it != accessClientB->sources.end(); ++it) { if (it->second->config.m_createSourceB) { TestingSyncSourcePtr source; SOURCE_ASSERT_NO_FAILURE(source.get(), source.reset(it->second->createSourceB())); @@ -4036,14 +4027,14 @@ void SyncTests::doOneWayFromRemote(SyncMode oneWayFromRemote) { } // add one item on first client, copy to server, and check change tracking via second source - for (it = sources.begin(); it != sources.end(); ++it) { + for (source_it it = sources.begin(); it != sources.end(); ++it) { CT_ASSERT_NO_THROW(it->second->insertManyItems(it->second->createSourceA, 200, 1)); } doSync(__FILE__, __LINE__, "send", SyncOptions(SYNC_TWO_WAY, CheckSyncReport(0,0,0, 1,0,0, true, SYNC_TWO_WAY))); - for (it = sources.begin(); it != sources.end(); ++it) { + for (source_it it = sources.begin(); it != sources.end(); ++it) { if (it->second->config.m_createSourceB) { TestingSyncSourcePtr source; SOURCE_ASSERT_NO_FAILURE(source.get(), source.reset(it->second->createSourceB())); @@ -4057,7 +4048,7 @@ void SyncTests::doOneWayFromRemote(SyncMode oneWayFromRemote) { // add a different item on second client, one-way-from-server // => one item added locally, none sent to server - for (it = accessClientB->sources.begin(); it != accessClientB->sources.end(); ++it) { + for (source_it it = accessClientB->sources.begin(); it != accessClientB->sources.end(); ++it) { CT_ASSERT_NO_THROW(it->second->insertManyItems(it->second->createSourceA, 2, 1)); if (it->second->config.m_createSourceB) { @@ -4074,7 +4065,7 @@ void SyncTests::doOneWayFromRemote(SyncMode oneWayFromRemote) { "recv", SyncOptions(oneWayFromRemote, CheckSyncReport(1,0,0, 0,0,0, true, SYNC_ONE_WAY_FROM_REMOTE))); - for (it = accessClientB->sources.begin(); it != accessClientB->sources.end(); ++it) { + for (source_it it = accessClientB->sources.begin(); it != accessClientB->sources.end(); ++it) { if (it->second->config.m_createSourceB) { TestingSyncSourcePtr source; SOURCE_ASSERT_NO_FAILURE(source.get(), source.reset(it->second->createSourceB())); @@ -4092,7 +4083,7 @@ void SyncTests::doOneWayFromRemote(SyncMode oneWayFromRemote) { "check", SyncOptions(SYNC_TWO_WAY, CheckSyncReport(0,0,0, 0,0,0, true, SYNC_TWO_WAY))); - for (it = sources.begin(); it != sources.end(); ++it) { + for (source_it it = sources.begin(); it != sources.end(); ++it) { if (it->second->config.m_createSourceB) { TestingSyncSourcePtr source; SOURCE_ASSERT_NO_FAILURE(source.get(), source.reset(it->second->createSourceB())); @@ -4105,7 +4096,7 @@ void SyncTests::doOneWayFromRemote(SyncMode oneWayFromRemote) { } // delete items on clientA, sync to server - for (it = sources.begin(); it != sources.end(); ++it) { + for (source_it it = sources.begin(); it != sources.end(); ++it) { CT_ASSERT_NO_THROW(it->second->deleteAll(it->second->createSourceA)); if (it->second->config.m_createSourceB) { @@ -4122,7 +4113,7 @@ void SyncTests::doOneWayFromRemote(SyncMode oneWayFromRemote) { "delete", SyncOptions(SYNC_TWO_WAY, CheckSyncReport(0,0,0, 0,0,1, true, SYNC_TWO_WAY))); - for (it = sources.begin(); it != sources.end(); ++it) { + for (source_it it = sources.begin(); it != sources.end(); ++it) { if (it->second->config.m_createSourceB) { TestingSyncSourcePtr source; SOURCE_ASSERT_NO_FAILURE(source.get(), source.reset(it->second->createSourceB())); @@ -4140,7 +4131,7 @@ void SyncTests::doOneWayFromRemote(SyncMode oneWayFromRemote) { "delete", SyncOptions(oneWayFromRemote, CheckSyncReport(0,0,1, 0,0,0, true, SYNC_ONE_WAY_FROM_REMOTE))); - for (it = accessClientB->sources.begin(); it != accessClientB->sources.end(); ++it) { + for (source_it it = accessClientB->sources.begin(); it != accessClientB->sources.end(); ++it) { if (it->second->config.m_createSourceB) { TestingSyncSourcePtr source; SOURCE_ASSERT_NO_FAILURE(source.get(), source.reset(it->second->createSourceB())); @@ -4181,8 +4172,7 @@ void SyncTests::doOneWayFromLocal(SyncMode oneWayFromLocal) { // check that everything is empty, also resets change tracking // in second sources of each client - source_it it; - for (it = sources.begin(); it != sources.end(); ++it) { + for (source_it it = sources.begin(); it != sources.end(); ++it) { if (it->second->config.m_createSourceB) { TestingSyncSourcePtr source; SOURCE_ASSERT_NO_FAILURE(source.get(), source.reset(it->second->createSourceB())); @@ -4190,7 +4180,7 @@ void SyncTests::doOneWayFromLocal(SyncMode oneWayFromLocal) { CT_ASSERT_NO_THROW(source.reset()); } } - for (it = accessClientB->sources.begin(); it != accessClientB->sources.end(); ++it) { + for (source_it it = accessClientB->sources.begin(); it != accessClientB->sources.end(); ++it) { if (it->second->config.m_createSourceB) { TestingSyncSourcePtr source; SOURCE_ASSERT_NO_FAILURE(source.get(), source.reset(it->second->createSourceB())); @@ -4200,14 +4190,14 @@ void SyncTests::doOneWayFromLocal(SyncMode oneWayFromLocal) { } // add one item on first client, copy to server, and check change tracking via second source - for (it = sources.begin(); it != sources.end(); ++it) { + for (source_it it = sources.begin(); it != sources.end(); ++it) { CT_ASSERT_NO_THROW(it->second->insertManyItems(it->second->createSourceA, 1, 1)); } doSync(__FILE__, __LINE__, "send", SyncOptions(SYNC_TWO_WAY, CheckSyncReport(0,0,0, 1,0,0, true, SYNC_TWO_WAY))); - for (it = sources.begin(); it != sources.end(); ++it) { + for (source_it it = sources.begin(); it != sources.end(); ++it) { if (it->second->config.m_createSourceB) { TestingSyncSourcePtr source; SOURCE_ASSERT_NO_FAILURE(source.get(), source.reset(it->second->createSourceB())); @@ -4221,7 +4211,7 @@ void SyncTests::doOneWayFromLocal(SyncMode oneWayFromLocal) { // add a different item on second client, one-way-from-client // => no item added locally, one sent to server - for (it = accessClientB->sources.begin(); it != accessClientB->sources.end(); ++it) { + for (source_it it = accessClientB->sources.begin(); it != accessClientB->sources.end(); ++it) { CT_ASSERT_NO_THROW(it->second->insertManyItems(it->second->createSourceA, 2, 1)); if (it->second->config.m_createSourceB) { @@ -4238,7 +4228,7 @@ void SyncTests::doOneWayFromLocal(SyncMode oneWayFromLocal) { "send", SyncOptions(oneWayFromLocal, CheckSyncReport(0,0,0, 1,0,0, true, SYNC_ONE_WAY_FROM_LOCAL))); - for (it = accessClientB->sources.begin(); it != accessClientB->sources.end(); ++it) { + for (source_it it = accessClientB->sources.begin(); it != accessClientB->sources.end(); ++it) { if (it->second->config.m_createSourceB) { TestingSyncSourcePtr source; SOURCE_ASSERT_NO_FAILURE(source.get(), source.reset(it->second->createSourceB())); @@ -4256,7 +4246,7 @@ void SyncTests::doOneWayFromLocal(SyncMode oneWayFromLocal) { "check", SyncOptions(SYNC_TWO_WAY, CheckSyncReport(1,0,0, 0,0,0, true, SYNC_TWO_WAY))); - for (it = sources.begin(); it != sources.end(); ++it) { + for (source_it it = sources.begin(); it != sources.end(); ++it) { if (it->second->config.m_createSourceB) { TestingSyncSourcePtr source; SOURCE_ASSERT_NO_FAILURE(source.get(), source.reset(it->second->createSourceB())); @@ -4269,7 +4259,7 @@ void SyncTests::doOneWayFromLocal(SyncMode oneWayFromLocal) { } // delete items on client B, sync to server - for (it = accessClientB->sources.begin(); it != accessClientB->sources.end(); ++it) { + for (source_it it = accessClientB->sources.begin(); it != accessClientB->sources.end(); ++it) { CT_ASSERT_NO_THROW(it->second->deleteAll(it->second->createSourceA)); if (it->second->config.m_createSourceB) { @@ -4286,7 +4276,7 @@ void SyncTests::doOneWayFromLocal(SyncMode oneWayFromLocal) { "delete", SyncOptions(oneWayFromLocal, CheckSyncReport(0,0,0, 0,0,1, true, SYNC_ONE_WAY_FROM_LOCAL))); - for (it = accessClientB->sources.begin(); it != accessClientB->sources.end(); ++it) { + for (source_it it = accessClientB->sources.begin(); it != accessClientB->sources.end(); ++it) { if (it->second->config.m_createSourceB) { TestingSyncSourcePtr source; SOURCE_ASSERT_NO_FAILURE(source.get(), source.reset(it->second->createSourceB())); @@ -4304,7 +4294,7 @@ void SyncTests::doOneWayFromLocal(SyncMode oneWayFromLocal) { "delete", SyncOptions(SYNC_TWO_WAY, CheckSyncReport(0,0,1, 0,0,0, true, SYNC_TWO_WAY))); - for (it = sources.begin(); it != sources.end(); ++it) { + for (source_it it = sources.begin(); it != sources.end(); ++it) { if (it->second->config.m_createSourceB) { TestingSyncSourcePtr source; SOURCE_ASSERT_NO_FAILURE(source.get(), source.reset(it->second->createSourceB())); @@ -4420,8 +4410,7 @@ void SyncTests::testItems() { CT_ASSERT_NO_THROW(deleteAll()); // import data - source_it it; - for (it = sources.begin(); it != sources.end(); ++it) { + for (source_it it = sources.begin(); it != sources.end(); ++it) { CT_ASSERT_NO_THROW(it->second->testImport()); } @@ -4439,8 +4428,7 @@ void SyncTests::testItemsXML() { CT_ASSERT_NO_THROW(deleteAll()); // import data - source_it it; - for (it = sources.begin(); it != sources.end(); ++it) { + for (source_it it = sources.begin(); it != sources.end(); ++it) { CT_ASSERT_NO_THROW(it->second->testImport()); } @@ -4460,8 +4448,7 @@ void SyncTests::testExtensions() { CT_ASSERT_NO_THROW(deleteAll()); // import data and create reference data - source_it it; - for (it = sources.begin(); it != sources.end(); ++it) { + for (source_it it = sources.begin(); it != sources.end(); ++it) { CT_ASSERT_NO_THROW(it->second->testImport()); string refDir = getCurrentTest() + "." + it->second->config.m_sourceName + ".ref.dat"; @@ -4488,7 +4475,7 @@ void SyncTests::testExtensions() { CT_ASSERT_NO_THROW(accessClientB->refreshClient(SyncOptions())); // update on client B - for (it = accessClientB->sources.begin(); it != accessClientB->sources.end(); ++it) { + for (source_it it = accessClientB->sources.begin(); it != accessClientB->sources.end(); ++it) { CT_ASSERT_NO_THROW(it->second->updateData(it->second->createSourceB)); } @@ -4497,7 +4484,7 @@ void SyncTests::testExtensions() { doSync(__FILE__, __LINE__, "patch", SyncOptions(SYNC_TWO_WAY)); bool equal = true; - for (it = sources.begin(); it != sources.end(); ++it) { + for (source_it it = sources.begin(); it != sources.end(); ++it) { string refDir = getCurrentTest() + "." + it->second->config.m_sourceName + ".ref.dat"; simplifyFilename(refDir); TestingSyncSourcePtr source; @@ -4538,8 +4525,7 @@ void SyncTests::testAddUpdate() { accessClientB->refreshClient(); // add item - source_it it; - for (it = sources.begin(); it != sources.end(); ++it) { + for (source_it it = sources.begin(); it != sources.end(); ++it) { CT_ASSERT_NO_THROW(it->second->insert(it->second->createSourceA, it->second->config.m_insertItem, false)); } doSync(__FILE__, __LINE__, @@ -4548,7 +4534,7 @@ void SyncTests::testAddUpdate() { CheckSyncReport(0,0,0, 1,0,0, true, SYNC_TWO_WAY))); // update it - for (it = sources.begin(); it != sources.end(); ++it) { + for (source_it it = sources.begin(); it != sources.end(); ++it) { CT_ASSERT_NO_THROW(it->second->update(it->second->createSourceB, it->second->config.m_updateItem)); } doSync(__FILE__, __LINE__, @@ -4592,9 +4578,8 @@ void SyncTests::testManyItems() { // import artificial data: make them large to generate some // real traffic and test buffer handling - source_it it; int num_items = defNumItems(); - for (it = sources.begin(); it != sources.end(); ++it) { + for (source_it it = sources.begin(); it != sources.end(); ++it) { CT_ASSERT_NO_THROW(it->second->insertManyItems(it->second->createSourceA, 0, num_items, 2000)); } @@ -4636,9 +4621,8 @@ void SyncTests::testManyDeletes() { // import artificial data: make them small, we just want // many of them - source_it it; int num_items = defNumItems(); - for (it = sources.begin(); it != sources.end(); ++it) { + for (source_it it = sources.begin(); it != sources.end(); ++it) { CT_ASSERT_NO_THROW(it->second->insertManyItems(it->second->createSourceA, 0, num_items, 100)); } @@ -4794,8 +4778,7 @@ void SyncTests::testDeleteBothSides() "delete-item-A", SyncOptions(SYNC_TWO_WAY, CheckSyncReport(0,0,0, 0,0,1, true, SYNC_TWO_WAY))); - source_it it; - for (it = sources.begin(); it != sources.end(); ++it) { + for (source_it it = sources.begin(); it != sources.end(); ++it) { if (it->second->config.m_createSourceB) { TestingSyncSourcePtr source; SOURCE_ASSERT_NO_FAILURE(source.get(), source.reset(it->second->createSourceB())); @@ -4811,7 +4794,7 @@ void SyncTests::testDeleteBothSides() "delete-item-B", SyncOptions(SYNC_TWO_WAY, CheckSyncReport(0,0,0, 0,0,-1, true, SYNC_TWO_WAY))); - for (it = accessClientB->sources.begin(); it != accessClientB->sources.end(); ++it) { + for (source_it it = accessClientB->sources.begin(); it != accessClientB->sources.end(); ++it) { if (it->second->config.m_createSourceB) { TestingSyncSourcePtr source; SOURCE_ASSERT_NO_FAILURE(source.get(), source.reset(it->second->createSourceB())); @@ -5086,14 +5069,12 @@ void SyncTests::testAddBothSidesRefresh() */ void SyncTests::testLinkedItemsParentChild() { - source_it it; - // clean server, client A and client B CT_ASSERT_NO_THROW(deleteAll()); accessClientB->refreshClient(); // create and copy parent item - for (it = sources.begin(); it != sources.end(); ++it) { + for (source_it it = sources.begin(); it != sources.end(); ++it) { CT_ASSERT(!it->second->config.m_linkedItems.empty()); CT_ASSERT(it->second->config.m_linkedItems[0].size() >= 2); TestingSyncSourcePtr source; @@ -5107,7 +5088,7 @@ void SyncTests::testLinkedItemsParentChild() CheckSyncReport(0,0,0, 1,0,0, true, SYNC_TWO_WAY))); // create independent item, refresh client B and server - for (it = accessClientB->sources.begin(); it != accessClientB->sources.end(); ++it) { + for (source_it it = accessClientB->sources.begin(); it != accessClientB->sources.end(); ++it) { CT_ASSERT_NO_THROW(it->second->insert(it->second->createSourceA, it->second->config.m_insertItem, false)); @@ -5118,7 +5099,7 @@ void SyncTests::testLinkedItemsParentChild() CheckSyncReport(1,0,0, 1,0,0, true, SYNC_TWO_WAY))); // add child on client A - for (it = sources.begin(); it != sources.end(); ++it) { + for (source_it it = sources.begin(); it != sources.end(); ++it) { CT_ASSERT(!it->second->config.m_linkedItems.empty()); CT_ASSERT(it->second->config.m_linkedItems[0].size() >= 2); TestingSyncSourcePtr source; @@ -5149,14 +5130,12 @@ void SyncTests::testLinkedItemsParentChild() */ void SyncTests::testLinkedItemsChild() { - source_it it; - // clean server, client A and client B CT_ASSERT_NO_THROW(deleteAll()); accessClientB->refreshClient(); // create and copy child item - for (it = sources.begin(); it != sources.end(); ++it) { + for (source_it it = sources.begin(); it != sources.end(); ++it) { CT_ASSERT(!it->second->config.m_linkedItems.empty()); CT_ASSERT(it->second->config.m_linkedItems[0].size() >= 2); TestingSyncSourcePtr source; @@ -5187,14 +5166,12 @@ void SyncTests::testLinkedItemsChild() */ void SyncTests::testLinkedItemsChildParent() { - source_it it; - // clean server, client A and client B CT_ASSERT_NO_THROW(deleteAll()); accessClientB->refreshClient(); // create and copy child item - for (it = sources.begin(); it != sources.end(); ++it) { + for (source_it it = sources.begin(); it != sources.end(); ++it) { CT_ASSERT(!it->second->config.m_linkedItems[0].empty()); CT_ASSERT(it->second->config.m_linkedItems[0].size() >= 2); TestingSyncSourcePtr source; @@ -5212,7 +5189,7 @@ void SyncTests::testLinkedItemsChildParent() CheckSyncReport(1,0,0, 0,0,0, true, SYNC_TWO_WAY))); // add parent on client A - for (it = sources.begin(); it != sources.end(); ++it) { + for (source_it it = sources.begin(); it != sources.end(); ++it) { CT_ASSERT(!it->second->config.m_linkedItems.empty()); CT_ASSERT(it->second->config.m_linkedItems[0].size() >= 2); TestingSyncSourcePtr source; @@ -5252,8 +5229,7 @@ void SyncTests::doVarSizes(bool withMaxMsgSize, CT_ASSERT_NO_THROW(deleteAll()); // insert items, doubling their size, then restart with small size - source_it it; - for (it = sources.begin(); it != sources.end(); ++it) { + for (source_it it = sources.begin(); it != sources.end(); ++it) { int item = 1; restoreStorage(it->second->config, client); TestingSyncSourcePtr source; @@ -6060,7 +6036,7 @@ static void UpdateLocal(const std::string &config, const std::string &source, // The local side also uses the Cmdline class because then we only // need to implement one way of updating items. But first we need to // get the actual data. - std::auto_ptr cmdline; + std::unique_ptr cmdline; rm_r(actualLocalData); mkdir_p(actualLocalData); @@ -6109,7 +6085,7 @@ void SyncTests::testUpload() std::string localSyncedTestdata = getPeerTestdata(config.m_sourceName, testname, "local-synced"); CT_ASSERT_MESSAGE(localSyncedTestdata, !access(localSyncedTestdata.c_str(), R_OK)); - std::auto_ptr cmdline; + std::unique_ptr cmdline; // Import locally into empty database. sources[0].second->deleteAll(sources[0].second->createSourceA); @@ -6195,7 +6171,7 @@ void SyncTests::testDownload() std::string remoteSyncedTestdata = getPeerTestdata(config.m_sourceName, testname, "remote-synced"); CT_ASSERT_MESSAGE(remoteSyncedTestdata, !access(remoteSyncedTestdata.c_str(), R_OK)); - std::auto_ptr cmdline; + std::unique_ptr cmdline; // Wipe remote directly, then import. cmdline.reset(new TestCmdline("--daemon=no", @@ -6301,7 +6277,7 @@ void SyncTests::doUpdateConflict(const std::string &testname, bool localWins) // Export from remote directly. std::string actualRemoteData = getCurrentTest() + ".remote.test.dat"; simplifyFilename(actualRemoteData); - std::auto_ptr cmdline; + std::unique_ptr cmdline; rm_r(actualRemoteData); mkdir_p(actualRemoteData); cmdline.reset(new TestCmdline("--daemon=no", @@ -8384,8 +8360,9 @@ void CheckSyncReport::check(const std::string &name, const SyncSourceReport &sou } } -/** @} */ -/** @endcond */ +SE_END_CXX + #endif // ENABLE_INTEGRATION_TESTS -SE_END_CXX +/** @} */ +/** @endcond */ diff --git a/test/gdb-dump-stack b/test/gdb-dump-stack new file mode 100644 index 00000000..b6205ec2 --- /dev/null +++ b/test/gdb-dump-stack @@ -0,0 +1,79 @@ +# Use this file with +# gdb --batch --return-child-result -x gdb-dump-stack +# to get full stack backtraces when the command or any of its +# children fails. + +# It is important that we keep processes running in parallel, +# otherwise we risk deadlocks once multiple processes are involved. +set non-stop on + +# Keep track also of child processes. +set detach-on-fork off +set follow-fork-mode parent + +python +class Exited (gdb.Function): + """Return 1 if current threat has exited, else 0.""" + + def __init__ (self): + super (Exited, self).__init__("exited") + + def invoke (self): + thread = gdb.selected_thread() + if thread is None or thread.is_exited(): + return 1 + else: + return 0 + +class FindStopped (gdb.Function): + """Dump stack backtrace of all stopped threads and continue them.""" + + def __init__ (self): + super (FindStopped, self).__init__("find_stopped") + + def invoke (self): + for inferior in gdb.inferiors(): + if inferior.is_valid(): + for thread in inferior.threads(): + if thread.is_valid() and thread.is_stopped(): + thread.switch() + return 1 + return 0 + +Exited() +FindStopped() +end + +# Start the command. Returns once something needs our attention. +run + +# Continously deal with events that normally require user intervention: +# - a process was stopped because of something (like a segfault) +# - a process has quit +while 1 + if $find_stopped() + # The stopped thread is now selected, so we can dump some information about + # it, then continue it. + info inferiors + bt + continue + else + inferior 1 + if $exited() + # No stopped thread, current thread has quit -> we are done. + loop_break + else + # We need to do something, otherwise we would busy-loop + # while all threads are running. Therefore we interrupt + # and restart the main thread. + # + # In (unlikely?) case that some other thread stops by + # itself while we do that, we continue all threads to + # avoid potential deadlocks (main thread running again but + # waiting for stopped thread that we don't know about). + # The downside is that we don't print a stack backtrace + # of such a thread. + interrupt + continue -a + end +end diff --git a/test/runtests.py b/test/runtests.py index 4d1d0c8f..30be2c81 100755 --- a/test/runtests.py +++ b/test/runtests.py @@ -1374,7 +1374,9 @@ if options.sourcedir: if options.nosourcedircopy: if options.cppcheck: sync = CppcheckSource("syncevolution", options.sourcedir, - "--enable=warning,performance,portability --inline-suppr") + "--enable=warning,performance,portability --inline-suppr " + + # bogus: cppcheck warning: uninitMemberVar - Member variable 'OperationWrapperSwitch::m_source' is not initialized in the constructor. + "--suppress=uninitMemberVar:*/SyncSource.h") else: sync = NopSource("syncevolution", options.sourcedir) else: @@ -1692,6 +1694,16 @@ test = SyncEvolutionTest("googlecalendar", compile, "Client::Source::google_caldav::LinkedItemsAllDayGoogle::testLinkedItemsInsertChildTwice," "Client::Source::google_caldav::LinkedItemsAllDayGoogle::testLinkedItemsUpdateChild," "Client::Source::google_caldav::LinkedItemsAllDayGoogle::testLinkedItemsUpdateChildNoIDs," + # A child without parent has its RECURRENCE-ID turned into UTC. + # https://stackoverflow.com/questions/47811670/detached-recurrence-without-parent-event + "Client::Source::google_caldav::LinkedItemsDefault::testLinkedItemsChild," + "Client::Source::google_caldav::LinkedItemsDefault::testLinkedItemsInsertChildTwice," + "Client::Source::google_caldav::LinkedItemsDefault::testLinkedItemsUpdateChild," + "Client::Source::google_caldav::LinkedItemsDefault::testLinkedItemsUpdateChildNoIDs," + "Client::Source::google_caldav::LinkedItemsWithVALARM::testLinkedItemsChild," + "Client::Source::google_caldav::LinkedItemsWithVALARM::testLinkedItemsInsertChildTwice," + "Client::Source::google_caldav::LinkedItemsWithVALARM::testLinkedItemsUpdateChild," + "Client::Source::google_caldav::LinkedItemsWithVALARM::testLinkedItemsUpdateChildNoIDs," , testPrefix=options.testprefix) context.add(test) diff --git a/test/sys.supp b/test/sys.supp index 74015aa6..4413942c 100644 --- a/test/sys.supp +++ b/test/sys.supp @@ -2362,3 +2362,53 @@ fun:g_get_charset fun:g_strerror } + +# ==7252== 32 bytes in 1 blocks are definitely lost in loss record 3,745 of 7,871 +# ==7252== at 0x99ABCFC: g_closure_new_simple (gclosure.c:211) +# ==7252== by 0x99AD31F: g_cclosure_new (gclosure.c:944) +# ==7252== by 0x99C63F8: g_signal_connect_data (gsignal.c:2510) +# ==7252== by 0x5C440D3: source_initable_init (e-source.c:2019) +# ==7252== by 0x9664246: g_initable_new_valist (ginitable.c:248) +# ==7252== by 0x96642F8: g_initable_new (ginitable.c:162) +# ==7252== by 0x5C41B4B: e_source_new (e-source.c:2506) +# ==7252== by 0x5C60187: source_registry_new_source (e-source-registry.c:706) +# ==7252== by 0x5C6033E: source_registry_object_manager_thread (e-source-registry.c:1124) +# ==7252== by 0x9C635F4: g_thread_proxy (gthread.c:784) +# ==7252== by 0x8605518: start_thread (pthread_create.c:456) +# ==7252== by 0xA89AA5E: clone (clone.S:97) +# ==7252== +{ + source_registry_new_source thread + closure + Memcheck:Leak + match-leak-kinds: definite + fun:g_closure_new_simple + fun:g_cclosure_new + fun:g_signal_connect_data + fun:source_initable_init + fun:g_initable_new_valist + fun:g_initable_new + fun:e_source_new + fun:source_registry_new_source + fun:source_registry_object_manager_thread + fun:g_thread_proxy +} + +# ==8315== Invalid write of size 4 +# ==8315== at 0x4009B42: check_match (dl-lookup.c:107) +# ==8315== Address 0xffeffbe70 is on thread 1's stack +# ==8315== +{ + dl-lookup 4 + Memcheck:Addr4 + fun:check_match +} + +# ==8315== Invalid read of size 1 +# ==8315== at 0x4009B42: check_match (dl-lookup.c:107) +# ==8315== Address 0xffeffbe70 is on thread 1's stack +# ==8315== +{ + dl-lookup 1 + Memcheck:Addr1 + fun:check_match +} diff --git a/test/test.am b/test/test.am index 4e436fd3..384ad824 100644 --- a/test/test.am +++ b/test/test.am @@ -72,7 +72,7 @@ if COND_DBUS noinst_PROGRAMS += test/dbus-client-server test_dbus_client_server_SOURCES = test/dbus-client-server.cpp test_dbus_client_server_CPPFLAGS = -I$(gdbus_dir) -I$(top_srcdir)/src -test_dbus_client_server_CXXFLAGS = $(CPPUNIT_CFLAGS) $(SYNCEVOLUTION_CXXFLAGS) $(BACKEND_CPPFLAGS) $(DBUS_CFLAGS) $(GLIB_CFLAGS) $(GOBJECT_CFLAGS) $(PCRECPP_CFLAGS) +test_dbus_client_server_CXXFLAGS = $(CPPUNIT_CFLAGS) $(SYNCEVOLUTION_CXXFLAGS) $(SYNCEVO_WFLAGS) $(BACKEND_CPPFLAGS) $(DBUS_CFLAGS) $(GLIB_CFLAGS) $(GOBJECT_CFLAGS) $(PCRECPP_CFLAGS) test_dbus_client_server_LDFLAGS = $(CPPUNIT_LIBS) test_dbus_client_server_LDADD = $(gdbus_build_dir)/libgdbussyncevo.la src/syncevo/libsyncevolution.la $(DBUS_LIBS) $(GLIB_LIBS) $(GOBJECT_LIBS) $(PCRECPP_LIBS) $(EXTRACORELDADD) test_dbus_client_server_DEPENDENCIES = $(gdbus_build_dir)/libgdbussyncevo.la src/syncevo/libsyncevolution.la diff --git a/test/testcases/eds_event.ics.googlecalendar.tem.patch b/test/testcases/eds_event.ics.googlecalendar.tem.patch index 3f5c47e0..f378dac5 100644 --- a/test/testcases/eds_event.ics.googlecalendar.tem.patch +++ b/test/testcases/eds_event.ics.googlecalendar.tem.patch @@ -255,7 +255,7 @@ -PRODID:-//Ximian//NONSGML Evolution Calendar//EN -VERSION:2.0 +BEGIN:VTIMEZONE -+TZID:/softwarestudio.org/Olson_20011030_5/Europe/Berlin ++TZID:Europe/Berlin +X-LIC-LOCATION:Europe/Berlin +BEGIN:DAYLIGHT +TZOFFSETFROM:+0100 @@ -277,8 +277,8 @@ DTSTAMP:20080407T193125Z -DTSTART:20080406T090000Z -DTEND:20080406T093000Z -+DTSTART;TZID=/softwarestudio.org/Olson_20011030_5/Europe/Berlin:20080406T110000 -+DTEND;TZID=/softwarestudio.org/Olson_20011030_5/Europe/Berlin:20080406T113000 ++DTSTART;TZID=Europe/Berlin:20080406T110000 ++DTEND;TZID=Europe/Berlin:20080406T113000 TRANSP:OPAQUE SEQUENCE:2 SUMMARY:Recurring @@ -287,7 +287,7 @@ PRODID:-//Ximian//NONSGML Evolution Calendar//EN VERSION:2.0 +BEGIN:VTIMEZONE -+TZID:/softwarestudio.org/Olson_20011030_5/Europe/Berlin ++TZID:Europe/Berlin +X-LIC-LOCATION:Europe/Berlin +BEGIN:DAYLIGHT +TZOFFSETFROM:+0100 @@ -309,8 +309,8 @@ DTSTAMP:20080407T193125Z -DTSTART:20080413T090000Z -DTEND:20080413T093000Z -+DTSTART;TZID=/softwarestudio.org/Olson_20011030_5/Europe/Berlin:20080413T110000 -+DTEND;TZID=/softwarestudio.org/Olson_20011030_5/Europe/Berlin:20080413T113000 ++DTSTART;TZID=Europe/Berlin:20080413T110000 ++DTEND;TZID=Europe/Berlin:20080413T113000 TRANSP:OPAQUE SEQUENCE:7 SUMMARY:Recurring: Modified @@ -318,7 +318,7 @@ CREATED:20080407T193241Z LAST-MODIFIED:20080407T193647 -RECURRENCE-ID:20080413T090000Z -+RECURRENCE-ID;TZID=/softwarestudio.org/Olson_20011030_5/Europe/Berlin:20080413T110000 ++RECURRENCE-ID;TZID=Europe/Berlin:20080413T110000 DESCRIPTION:second instance modified END:VEVENT END:VCALENDAR @@ -435,43 +435,7 @@ DESCRIPTION:second instance modified\, single detached recurrence END:VEVENT END:VCALENDAR -@@ -345,71 +520,36 @@ - BEGIN:VCALENDAR - PRODID:-//Ximian//NONSGML Evolution Calendar//EN - VERSION:2.0 -+BEGIN:VTIMEZONE -+TZID:/softwarestudio.org/Olson_20011030_5/Europe/Berlin -+X-LIC-LOCATION:Europe/Berlin -+BEGIN:DAYLIGHT -+TZOFFSETFROM:+0100 -+TZOFFSETTO:+0200 -+TZNAME:CEST -+DTSTART:19700329T020000 -+RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=3 -+END:DAYLIGHT -+BEGIN:STANDARD -+TZOFFSETFROM:+0200 -+TZOFFSETTO:+0100 -+TZNAME:CET -+DTSTART:19701025T030000 -+RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=10 -+END:STANDARD -+END:VTIMEZONE - BEGIN:VEVENT - UID:20080407T193125Z-19554-727-1-50-YY@gollum - DTSTAMP:20080407T193125Z --DTSTART:20080413T090000Z --DTEND:20080413T093000Z -+DTSTART;TZID=/softwarestudio.org/Olson_20011030_5/Europe/Berlin:20080413T110000 -+DTEND;TZID=/softwarestudio.org/Olson_20011030_5/Europe/Berlin:20080413T113000 - TRANSP:OPAQUE - SEQUENCE:7 - SUMMARY:Recurring 3: Modified - CLASS:PUBLIC - CREATED:20080407T193241Z - LAST-MODIFIED:20080407T193647 --RECURRENCE-ID:20080413T090000Z -+RECURRENCE-ID;TZID=/softwarestudio.org/Olson_20011030_5/Europe/Berlin:20080413T110000 +@@ -360,56 +535,3 @@ DESCRIPTION:second instance modified END:VEVENT END:VCALENDAR diff --git a/test/testcases/synctests/googlecontacts/eds_contact/testDownload/README b/test/testcases/synctests/googlecontacts/eds_contact/testDownload/README index de6eaeba..0b435f5a 100644 --- a/test/testcases/synctests/googlecontacts/eds_contact/testDownload/README +++ b/test/testcases/synctests/googlecontacts/eds_contact/testDownload/README @@ -14,3 +14,4 @@ The test data was adapted to cope with some bugs: finally the Google parser strips the trailing white space. - Google swallows one space before the \n in custom-label5. +- no PHOTO data because the server may re-encode the image diff --git a/test/testcases/synctests/googlecontacts/eds_contact/testDownload/local b/test/testcases/synctests/googlecontacts/eds_contact/testDownload/local index 93c5e0db..95f6c070 100644 --- a/test/testcases/synctests/googlecontacts/eds_contact/testDownload/local +++ b/test/testcases/synctests/googlecontacts/eds_contact/testDownload/local @@ -58,16 +58,6 @@ ADR;TYPE=WORK:;;work address;;;; ADR:;;custom address;;;; BDAY:19701230 NOTE:A test contact. -PHOTO;TYPE=png;ENCODING=b:iVBORw0KGgoAAAANSUhEUgAAACQAAAAXCAYAAABj7u2bAAAAB - mJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH1gEICjgdiWkBOQA - AAB10RVh0Q29tbWVudABDcmVhdGVkIHdpdGggVGhlIEdJTVDvZCVuAAABaElEQVRIx+3Wu0tcU - RAG8F98gRKTYGORRqwksJV/QOqFFIFgKgsRYbHV1larDQQCKQxpUscyhUmXJuCSNpYWPsAU6wP - xHW6aWbgsu+ve3RUs7geHc+fON3O+M4c5HHLkyHG/eISkg5heIGmUr++hVWigyY6THlejbWSt0 - Bv8QBXX2MF7jKU4IyjjJ45xg31sYKZuw7Xv9Gh6vvXO9QbBtbGNJ8Ert+AlTURkFjQX9g5e4yk - GUcBm+FaDexx2MUQOYhIL2Lpj09oV9CvsQgPuePj+hP037BL6M6yRSdDZHWVOcBHcEv7FvyN8x - xqmeynovA1Baf4UVvANhyn/Uq8E/Q57ssNufhvx1QZrDHfS9p9i3sQsnscdNowXWEQlOBXMYyI - 4j3EavqFUzpOYl4OTqUJ9+NzmkbXyb6Ryfumm7Wso4it2cYXL6K6PeBmcV8E5iEvxPDjv8CyVa - xQfsIfbqGIlf17k6Bb/Ae0cnahfg6KuAAAAAElFTkSuQmCC X-PHONETIC-FIRST-NAME:John X-PHONETIC-LAST-NAME:Doe -END:VCARD \ No newline at end of file +END:VCARD diff --git a/test/testcases/synctests/googlecontacts/eds_contact/testDownload/remote b/test/testcases/synctests/googlecontacts/eds_contact/testDownload/remote index 4a7f9f75..bfa9c1f5 100644 --- a/test/testcases/synctests/googlecontacts/eds_contact/testDownload/remote +++ b/test/testcases/synctests/googlecontacts/eds_contact/testDownload/remote @@ -24,16 +24,6 @@ EMAIL;TYPE=HOME,PREF:john.doe@home.com EMAIL;TYPE=WORK:doe@work.com item2.EMAIL:john@custom.com NOTE:A test contact. -PHOTO;ENCODING=b;TYPE=PNG:iVBORw0KGgoAAAANSUhEUgAAACQAAAAXCAYAAABj7u2bAAAAB - mJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH1gEICjgdiWkBO - QAAAB10RVh0Q29tbWVudABDcmVhdGVkIHdpdGggVGhlIEdJTVDvZCVuAAABaElEQVRIx+3Wu - 0tcURAG8F98gRKTYGORRqwksJV/QOqFFIFgKgsRYbHV1larDQQCKQxpUscyhUmXJuCSNpYWP - sAU6wPxHW6aWbgsu+ve3RUs7geHc+fON3O+M4c5HHLkyHG/eISkg5heIGmUr++hVWigyY6TH - lejbWSt0Bv8QBXX2MF7jKU4IyjjJ45xg31sYKZuw7Xv9Gh6vvXO9QbBtbGNJ8Ert+AlTURkF - jQX9g5e4ykGUcBm+FaDexx2MUQOYhIL2Lpj09oV9CvsQgPuePj+hP037BL6M6yRSdDZHWVOc - BHcEv7FvyN8xxqmeynovA1Baf4UVvANhyn/Uq8E/Q57ssNufhvx1QZrDHfS9p9i3sQsnscdN - owXWEQlOBXMYyI4j3EavqFUzpOYl4OTqUJ9+NzmkbXyb6Ryfumm7Wso4it2cYXL6K6PeBmcV - 8E5iEvxPDjv8CyVaxQfsIfbqGIlf17k6Bb/Ae0cnahfg6KuAAAAAElFTkSuQmCC item5.IMPP;X-SERVICE-TYPE=GoogleTalk:xmpp:google%20talk item6.IMPP;X-SERVICE-TYPE=AIM:aim:aim item7.IMPP;X-SERVICE-TYPE=Yahoo:ymsgr:yahoo diff --git a/test/testcases/synctests/googlecontacts/eds_contact/testDownload/remote-synced b/test/testcases/synctests/googlecontacts/eds_contact/testDownload/remote-synced index 257ba73b..8c91ef7f 100644 --- a/test/testcases/synctests/googlecontacts/eds_contact/testDownload/remote-synced +++ b/test/testcases/synctests/googlecontacts/eds_contact/testDownload/remote-synced @@ -25,16 +25,6 @@ EMAIL;TYPE=WORK:doe@work.com item2.EMAIL:john@custom.com EMAIL:new local email NOTE:A test contact. -PHOTO;ENCODING=b;TYPE=PNG:iVBORw0KGgoAAAANSUhEUgAAACQAAAAXCAYAAABj7u2bAAAAB - mJLR0QA/wD/AP+gvaeTAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3RJTUUH1gEICjgdiWkBO - QAAAB10RVh0Q29tbWVudABDcmVhdGVkIHdpdGggVGhlIEdJTVDvZCVuAAABaElEQVRIx+3Wu - 0tcURAG8F98gRKTYGORRqwksJV/QOqFFIFgKgsRYbHV1larDQQCKQxpUscyhUmXJuCSNpYWP - sAU6wPxHW6aWbgsu+ve3RUs7geHc+fON3O+M4c5HHLkyHG/eISkg5heIGmUr++hVWigyY6TH - lejbWSt0Bv8QBXX2MF7jKU4IyjjJ45xg31sYKZuw7Xv9Gh6vvXO9QbBtbGNJ8Ert+AlTURkF - jQX9g5e4ykGUcBm+FaDexx2MUQOYhIL2Lpj09oV9CvsQgPuePj+hP037BL6M6yRSdDZHWVOc - BHcEv7FvyN8xxqmeynovA1Baf4UVvANhyn/Uq8E/Q57ssNufhvx1QZrDHfS9p9i3sQsnscdN - owXWEQlOBXMYyI4j3EavqFUzpOYl4OTqUJ9+NzmkbXyb6Ryfumm7Wso4it2cYXL6K6PeBmcV - 8E5iEvxPDjv8CyVaxQfsIfbqGIlf17k6Bb/Ae0cnahfg6KuAAAAAElFTkSuQmCC item5.IMPP;X-SERVICE-TYPE=GoogleTalk:xmpp:google%20talk item6.IMPP;X-SERVICE-TYPE=AIM:aim:aim item7.IMPP;X-SERVICE-TYPE=Yahoo:ymsgr:yahoo diff --git a/test/testcases/synctests/googlecontacts/eds_contact/testUpdateLocalWins/README b/test/testcases/synctests/googlecontacts/eds_contact/testUpdateLocalWins/README new file mode 100644 index 00000000..cfb55025 --- /dev/null +++ b/test/testcases/synctests/googlecontacts/eds_contact/testUpdateLocalWins/README @@ -0,0 +1 @@ +- no PHOTO data because the server may re-encode the image diff --git a/test/testcases/synctests/googlecontacts/eds_contact/testUpdateLocalWins/local b/test/testcases/synctests/googlecontacts/eds_contact/testUpdateLocalWins/local index 883a9db4..d0ee49b7 100644 --- a/test/testcases/synctests/googlecontacts/eds_contact/testUpdateLocalWins/local +++ b/test/testcases/synctests/googlecontacts/eds_contact/testUpdateLocalWins/local @@ -48,21 +48,6 @@ X-JABBER:JABBER DOE X-MSN:MSN DOE X-SKYPE:SKYPE DOE X-SIP:SIP DOE -PHOTO;ENCODING=b;TYPE=JPEG:/9j/4AAQSkZJRgABAQEASABIAAD/4QAWRXhpZgAATU0AKgAA - AAgAAAAAAAD//gAXQ3JlYXRlZCB3aXRoIFRoZSBHSU1Q/9sAQwAFAwQEBAMFBAQEBQUFBgcM - CAcHBwcPCwsJDBEPEhIRDxERExYcFxMUGhURERghGBodHR8fHxMXIiQiHiQcHh8e/9sAQwEF - BQUHBgcOCAgOHhQRFB4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4e - Hh4eHh4eHh4e/8AAEQgAFwAkAwEiAAIRAQMRAf/EABkAAQADAQEAAAAAAAAAAAAAAAAGBwgE - Bf/EADIQAAECBQMCAwQLAAAAAAAAAAECBAADBQYRBxIhEzEUFSIIFjNBGCRHUVZ3lqXD0+P/ - xAAUAQEAAAAAAAAAAAAAAAAAAAAA/8QAFBEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEQMR - AD8AuX6UehP45/aXv9MTPTLVKxNSvMPcqu+a+XdLxf1SfJ6fU37PioTnOxfbOMc/KIZ7U/2V - fmTR/wCaKlu6+blu/Ui72zxWtUmmUOrTaWwkWDT09FPR4K587OVrUfVsIwElPPPAbAjxr2um - hWXbDu5rmfeApLPZ4hx0lzNm9aUJ9KAVHKlJHAPf7ozPLqWt9y6Z0EPGmoLNjTq48a1iaybJ - YV52yEtCms5KJmAT61JXtJyUdyQTEc1WlMql7N1/oZ6jagVZVFfUyZPpFy5lvWcxU7Z03BUk - GZLWJqVhPYLkIIPBEBtSEUyNAsjI1q1m/VP+UICwL/sqlXp7v+aOHsnyGttq218MtKd8+Ru2 - JXuScoO45Awe2CIi96aKW1cVyubkYVy6rTqz0J8a5t2qqZl0UjAMwYKScfPAJ+cIQHHP0Dth - VFaMWt0XwxetnM50Ks2rsxL6ZMnJlJmb5hBBBEiVxjA28dznqo+hdksbQuS3Hs6tVtNzdM1Z - /VH5nO3Bl/CJmYHKDynjv3zCEB5rLQNo0bIbydWNWxKljbLQLoWkISOAkBKAABCEID//2Q== END:VCARD BEGIN:VCARD @@ -115,21 +100,6 @@ X-JABBER:JABBER DOE X-MSN:MSN DOE X-SKYPE:SKYPE DOE X-SIP:SIP DOE -PHOTO;ENCODING=b;TYPE=JPEG:/9j/4AAQSkZJRgABAQEASABIAAD/4QAWRXhpZgAATU0AKgAA - AAgAAAAAAAD//gAXQ3JlYXRlZCB3aXRoIFRoZSBHSU1Q/9sAQwAFAwQEBAMFBAQEBQUFBgcM - CAcHBwcPCwsJDBEPEhIRDxERExYcFxMUGhURERghGBodHR8fHxMXIiQiHiQcHh8e/9sAQwEF - BQUHBgcOCAgOHhQRFB4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4e - Hh4eHh4eHh4e/8AAEQgAFwAkAwEiAAIRAQMRAf/EABkAAQADAQEAAAAAAAAAAAAAAAAGBwgE - Bf/EADIQAAECBQMCAwQLAAAAAAAAAAECBAADBQYRBxIhEzEUFSIIFjNBGCRHUVZ3lqXD0+P/ - xAAUAQEAAAAAAAAAAAAAAAAAAAAA/8QAFBEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEQMR - AD8AuX6UehP45/aXv9MTPTLVKxNSvMPcqu+a+XdLxf1SfJ6fU37PioTnOxfbOMc/KIZ7U/2V - fmTR/wCaKlu6+blu/Ui72zxWtUmmUOrTaWwkWDT09FPR4K587OVrUfVsIwElPPPAbAjxr2um - hWXbDu5rmfeApLPZ4hx0lzNm9aUJ9KAVHKlJHAPf7ozPLqWt9y6Z0EPGmoLNjTq48a1iaybJ - YV52yEtCms5KJmAT61JXtJyUdyQTEc1WlMql7N1/oZ6jagVZVFfUyZPpFy5lvWcxU7Z03BUk - GZLWJqVhPYLkIIPBEBtSEUyNAsjI1q1m/VP+UICwL/sqlXp7v+aOHsnyGttq218MtKd8+Ru2 - JXuScoO45Awe2CIi96aKW1cVyubkYVy6rTqz0J8a5t2qqZl0UjAMwYKScfPAJ+cIQHHP0Dth - VFaMWt0XwxetnM50Ks2rsxL6ZMnJlJmb5hBBBEiVxjA28dznqo+hdksbQuS3Hs6tVtNzdM1Z - /VH5nO3Bl/CJmYHKDynjv3zCEB5rLQNo0bIbydWNWxKljbLQLoWkISOAkBKAABCEID//2Q== END:VCARD BEGIN:VCARD @@ -182,20 +152,5 @@ X-JABBER:JABBER DOE X-MSN:MSN DOE X-SKYPE:SKYPE DOE X-SIP:SIP DOE -PHOTO;ENCODING=b;TYPE=JPEG:/9j/4AAQSkZJRgABAQEASABIAAD/4QAWRXhpZgAATU0AKgAA - AAgAAAAAAAD//gAXQ3JlYXRlZCB3aXRoIFRoZSBHSU1Q/9sAQwAFAwQEBAMFBAQEBQUFBgcM - CAcHBwcPCwsJDBEPEhIRDxERExYcFxMUGhURERghGBodHR8fHxMXIiQiHiQcHh8e/9sAQwEF - BQUHBgcOCAgOHhQRFB4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4e - Hh4eHh4eHh4e/8AAEQgAFwAkAwEiAAIRAQMRAf/EABkAAQADAQEAAAAAAAAAAAAAAAAGBwgE - Bf/EADIQAAECBQMCAwQLAAAAAAAAAAECBAADBQYRBxIhEzEUFSIIFjNBGCRHUVZ3lqXD0+P/ - xAAUAQEAAAAAAAAAAAAAAAAAAAAA/8QAFBEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEQMR - AD8AuX6UehP45/aXv9MTPTLVKxNSvMPcqu+a+XdLxf1SfJ6fU37PioTnOxfbOMc/KIZ7U/2V - fmTR/wCaKlu6+blu/Ui72zxWtUmmUOrTaWwkWDT09FPR4K587OVrUfVsIwElPPPAbAjxr2um - hWXbDu5rmfeApLPZ4hx0lzNm9aUJ9KAVHKlJHAPf7ozPLqWt9y6Z0EPGmoLNjTq48a1iaybJ - YV52yEtCms5KJmAT61JXtJyUdyQTEc1WlMql7N1/oZ6jagVZVFfUyZPpFy5lvWcxU7Z03BUk - GZLWJqVhPYLkIIPBEBtSEUyNAsjI1q1m/VP+UICwL/sqlXp7v+aOHsnyGttq218MtKd8+Ru2 - JXuScoO45Awe2CIi96aKW1cVyubkYVy6rTqz0J8a5t2qqZl0UjAMwYKScfPAJ+cIQHHP0Dth - VFaMWt0XwxetnM50Ks2rsxL6ZMnJlJmb5hBBBEiVxjA28dznqo+hdksbQuS3Hs6tVtNzdM1Z - /VH5nO3Bl/CJmYHKDynjv3zCEB5rLQNo0bIbydWNWxKljbLQLoWkISOAkBKAABCEID//2Q== END:VCARD diff --git a/test/testcases/synctests/googlecontacts/eds_contact/testUpdateLocalWins/local-synced b/test/testcases/synctests/googlecontacts/eds_contact/testUpdateLocalWins/local-synced index 34b76f6f..4686c010 100644 --- a/test/testcases/synctests/googlecontacts/eds_contact/testUpdateLocalWins/local-synced +++ b/test/testcases/synctests/googlecontacts/eds_contact/testUpdateLocalWins/local-synced @@ -49,22 +49,6 @@ X-JABBER:JABBER DOE X-MSN:MSN DOE X-SKYPE:SKYPE DOE X-SIP:SIP DOE -PHOTO;ENCODING=B:/9j/4AAQSkZJRgABAQEASABIAAD/4QBgRXhpZgAASUkqAAgAAAACADEBAg - AHAAAAJgAAAGmHBAABAAAALgAAAAAAAABHb29nbGUAAAMAAJAHAAQAAAAwMjIwAqAEAAEAAAAkA - AAAA6AEAAEAAAAXAAAAAAAAAP/bAEMABQMEBAQDBQQEBAUFBQYHDAgHBwcHDwsLCQwRDxISEQ8R - ERMWHBcTFBoVEREYIRgaHR0fHx8TFyIkIh4kHB4fHv/bAEMBBQUFBwYHDggIDh4UERQeHh4eHh4 - eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHv/AABEIABcAJAMBIg - ACEQEDEQH/xAAZAAEAAwEBAAAAAAAAAAAAAAAABgcIBAX/xAAyEAABAgUDAgMECwAAAAAAAAABA - gQAAwUGEQcSIRMxFBUiCBYzQRgkR1FWd5alw9Pj/8QAFAEBAAAAAAAAAAAAAAAAAAAAAP/EABQR - AQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhEDEQA/ALl+lHoT+Of2l7/TEz0y1SsTUrzD3Krvmvl - 3S8X9Unyen1N+z4qE5zsX2zjHPyiGe1P9lX5k0f8Amipbuvm5bv1Iu9s8VrVJplDq02lsJFg09P - RT0eCufOzla1H1bCMBJTzzwGwI8a9rpoVl2w7ua5n3gKSz2eIcdJczZvWlCfSgFRypSRwD3+6Mz - y6lrfcumdBDxpqCzY06uPGtYmsmyWFedshLQprOSiZgE+tSV7SclHckExHNVpTKpezdf6Geo2oF - WVRX1MmT6RcuZb1nMVO2dNwVJBmS1ialYT2C5CCDwRAbUhFMjQLIyNatZv1T/lCAsC/7KpV6e7/ - mjh7J8hrbattfDLSnfPkbtiV7knKDuOQMHtgiIvemiltXFcrm5GFcuq06s9CfGubdqqmZdFIwDM - GCknHzwCfnCEBxz9A7YVRWjFrdF8MXrZzOdCrNq7MS+mTJyZSZm+YQQQRIlcYwNvHc56qPoXZLG - 0Lktx7OrVbTc3TNWf1R+ZztwZfwiZmByg8p4798whAeay0DaNGyG8nVjVsSpY2y0C6FpCEjgJAS - gAAQhCA//9k= TEL;TYPE=HOME:new remote tel 1 TEL;X-ABLabel=new-remote-tel-label:new remote tel 2 EMAIL;X-ABLabel=new-remote-email-label:new remote email 1 @@ -137,21 +121,6 @@ X-JABBER:JABBER DOE X-MSN:MSN DOE X-SKYPE:SKYPE DOE X-SIP:SIP DOE -PHOTO;ENCODING=b;TYPE=JPEG:/9j/4AAQSkZJRgABAQEASABIAAD/4QAWRXhpZgAATU0AKgAA - AAgAAAAAAAD//gAXQ3JlYXRlZCB3aXRoIFRoZSBHSU1Q/9sAQwAFAwQEBAMFBAQEBQUFBgcM - CAcHBwcPCwsJDBEPEhIRDxERExYcFxMUGhURERghGBodHR8fHxMXIiQiHiQcHh8e/9sAQwEF - BQUHBgcOCAgOHhQRFB4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4e - Hh4eHh4eHh4e/8AAEQgAFwAkAwEiAAIRAQMRAf/EABkAAQADAQEAAAAAAAAAAAAAAAAGBwgE - Bf/EADIQAAECBQMCAwQLAAAAAAAAAAECBAADBQYRBxIhEzEUFSIIFjNBGCRHUVZ3lqXD0+P/ - xAAUAQEAAAAAAAAAAAAAAAAAAAAA/8QAFBEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEQMR - AD8AuX6UehP45/aXv9MTPTLVKxNSvMPcqu+a+XdLxf1SfJ6fU37PioTnOxfbOMc/KIZ7U/2V - fmTR/wCaKlu6+blu/Ui72zxWtUmmUOrTaWwkWDT09FPR4K587OVrUfVsIwElPPPAbAjxr2um - hWXbDu5rmfeApLPZ4hx0lzNm9aUJ9KAVHKlJHAPf7ozPLqWt9y6Z0EPGmoLNjTq48a1iaybJ - YV52yEtCms5KJmAT61JXtJyUdyQTEc1WlMql7N1/oZ6jagVZVFfUyZPpFy5lvWcxU7Z03BUk - GZLWJqVhPYLkIIPBEBtSEUyNAsjI1q1m/VP+UICwL/sqlXp7v+aOHsnyGttq218MtKd8+Ru2 - JXuScoO45Awe2CIi96aKW1cVyubkYVy6rTqz0J8a5t2qqZl0UjAMwYKScfPAJ+cIQHHP0Dth - VFaMWt0XwxetnM50Ks2rsxL6ZMnJlJmb5hBBBEiVxjA28dznqo+hdksbQuS3Hs6tVtNzdM1Z - /VH5nO3Bl/CJmYHKDynjv3zCEB5rLQNo0bIbydWNWxKljbLQLoWkISOAkBKAABCEID//2Q== TEL;TYPE=HOME:new remote tel 1 TEL;X-ABLabel=new-remote-tel-label:new remote tel 2 EMAIL;X-ABLabel=new-remote-email-label:new remote email 1 @@ -223,20 +192,5 @@ X-JABBER:JABBER DOE X-MSN:MSN DOE X-SKYPE:SKYPE DOE X-SIP:SIP DOE -PHOTO;ENCODING=b;TYPE=JPEG:/9j/4AAQSkZJRgABAQEASABIAAD/4QAWRXhpZgAATU0AKgAA - AAgAAAAAAAD//gAXQ3JlYXRlZCB3aXRoIFRoZSBHSU1Q/9sAQwAFAwQEBAMFBAQEBQUFBgcM - CAcHBwcPCwsJDBEPEhIRDxERExYcFxMUGhURERghGBodHR8fHxMXIiQiHiQcHh8e/9sAQwEF - BQUHBgcOCAgOHhQRFB4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4e - Hh4eHh4eHh4e/8AAEQgAFwAkAwEiAAIRAQMRAf/EABkAAQADAQEAAAAAAAAAAAAAAAAGBwgE - Bf/EADIQAAECBQMCAwQLAAAAAAAAAAECBAADBQYRBxIhEzEUFSIIFjNBGCRHUVZ3lqXD0+P/ - xAAUAQEAAAAAAAAAAAAAAAAAAAAA/8QAFBEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEQMR - AD8AuX6UehP45/aXv9MTPTLVKxNSvMPcqu+a+XdLxf1SfJ6fU37PioTnOxfbOMc/KIZ7U/2V - fmTR/wCaKlu6+blu/Ui72zxWtUmmUOrTaWwkWDT09FPR4K587OVrUfVsIwElPPPAbAjxr2um - hWXbDu5rmfeApLPZ4hx0lzNm9aUJ9KAVHKlJHAPf7ozPLqWt9y6Z0EPGmoLNjTq48a1iaybJ - YV52yEtCms5KJmAT61JXtJyUdyQTEc1WlMql7N1/oZ6jagVZVFfUyZPpFy5lvWcxU7Z03BUk - GZLWJqVhPYLkIIPBEBtSEUyNAsjI1q1m/VP+UICwL/sqlXp7v+aOHsnyGttq218MtKd8+Ru2 - JXuScoO45Awe2CIi96aKW1cVyubkYVy6rTqz0J8a5t2qqZl0UjAMwYKScfPAJ+cIQHHP0Dth - VFaMWt0XwxetnM50Ks2rsxL6ZMnJlJmb5hBBBEiVxjA28dznqo+hdksbQuS3Hs6tVtNzdM1Z - /VH5nO3Bl/CJmYHKDynjv3zCEB5rLQNo0bIbydWNWxKljbLQLoWkISOAkBKAABCEID//2Q== BDAY:2006-01-01 END:VCARD diff --git a/test/testcases/synctests/googlecontacts/eds_contact/testUpdateLocalWins/remote-synced b/test/testcases/synctests/googlecontacts/eds_contact/testUpdateLocalWins/remote-synced index 3a3d300d..e8eb8f57 100644 --- a/test/testcases/synctests/googlecontacts/eds_contact/testUpdateLocalWins/remote-synced +++ b/test/testcases/synctests/googlecontacts/eds_contact/testUpdateLocalWins/remote-synced @@ -27,22 +27,6 @@ EMAIL;TYPE=HOME:john.doe@home.priv EMAIL:john.doe@other.world EMAIL:john.doe@yet.another.world NOTE:This is a test case which uses almost all Evolution fields. -PHOTO;ENCODING=B:/9j/4AAQSkZJRgABAQEASABIAAD/4QBgRXhpZgAASUkqAAgAAAACADEBAg - AHAAAAJgAAAGmHBAABAAAALgAAAAAAAABHb29nbGUAAAMAAJAHAAQAAAAwMjIwAqAEAAEAAAAkA - AAAA6AEAAEAAAAXAAAAAAAAAP/bAEMABQMEBAQDBQQEBAUFBQYHDAgHBwcHDwsLCQwRDxISEQ8R - ERMWHBcTFBoVEREYIRgaHR0fHx8TFyIkIh4kHB4fHv/bAEMBBQUFBwYHDggIDh4UERQeHh4eHh4 - eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHv/AABEIABcAJAMBIg - ACEQEDEQH/xAAZAAEAAwEBAAAAAAAAAAAAAAAABgcIBAX/xAAyEAABAgUDAgMECwAAAAAAAAABA - gQAAwUGEQcSIRMxFBUiCBYzQRgkR1FWd5alw9Pj/8QAFAEBAAAAAAAAAAAAAAAAAAAAAP/EABQR - AQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhEDEQA/ALl+lHoT+Of2l7/TEz0y1SsTUrzD3Krvmvl - 3S8X9Unyen1N+z4qE5zsX2zjHPyiGe1P9lX5k0f8Amipbuvm5bv1Iu9s8VrVJplDq02lsJFg09P - RT0eCufOzla1H1bCMBJTzzwGwI8a9rpoVl2w7ua5n3gKSz2eIcdJczZvWlCfSgFRypSRwD3+6Mz - y6lrfcumdBDxpqCzY06uPGtYmsmyWFedshLQprOSiZgE+tSV7SclHckExHNVpTKpezdf6Geo2oF - WVRX1MmT6RcuZb1nMVO2dNwVJBmS1ialYT2C5CCDwRAbUhFMjQLIyNatZv1T/lCAsC/7KpV6e7/ - mjh7J8hrbattfDLSnfPkbtiV7knKDuOQMHtgiIvemiltXFcrm5GFcuq06s9CfGubdqqmZdFIwDM - GCknHzwCfnCEBxz9A7YVRWjFrdF8MXrZzOdCrNq7MS+mTJyZSZm+YQQQRIlcYwNvHc56qPoXZLG - 0Lktx7OrVbTc3TNWf1R+ZztwZfwiZmByg8p4798whAeay0DaNGyG8nVjVsSpY2y0C6FpCEjgJAS - gAAQhCA//9k= item2.IMPP;X-SERVICE-TYPE=AIM:aim:AIM%20JOHN item3.IMPP;X-SERVICE-TYPE=Gadugadu:x-apple:GADUGADU%20DOE item4.IMPP;X-SERVICE-TYPE=Groupwise:x-apple:GROUPWISE%20DOE @@ -140,22 +124,6 @@ EMAIL:john.doe@other.world EMAIL:john.doe@yet.another.world EMAIL:new local email NOTE:This is a test case which uses almost all Evolution fields. -PHOTO;ENCODING=B:/9j/4AAQSkZJRgABAQEASABIAAD/4QBgRXhpZgAASUkqAAgAAAACADEBAg - AHAAAAJgAAAGmHBAABAAAALgAAAAAAAABHb29nbGUAAAMAAJAHAAQAAAAwMjIwAqAEAAEAAAAkA - AAAA6AEAAEAAAAXAAAAAAAAAP/bAEMABQMEBAQDBQQEBAUFBQYHDAgHBwcHDwsLCQwRDxISEQ8R - ERMWHBcTFBoVEREYIRgaHR0fHx8TFyIkIh4kHB4fHv/bAEMBBQUFBwYHDggIDh4UERQeHh4eHh4 - eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHv/AABEIABcAJAMBIg - ACEQEDEQH/xAAZAAEAAwEBAAAAAAAAAAAAAAAABgcIBAX/xAAyEAABAgUDAgMECwAAAAAAAAABA - gQAAwUGEQcSIRMxFBUiCBYzQRgkR1FWd5alw9Pj/8QAFAEBAAAAAAAAAAAAAAAAAAAAAP/EABQR - AQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhEDEQA/ALl+lHoT+Of2l7/TEz0y1SsTUrzD3Krvmvl - 3S8X9Unyen1N+z4qE5zsX2zjHPyiGe1P9lX5k0f8Amipbuvm5bv1Iu9s8VrVJplDq02lsJFg09P - RT0eCufOzla1H1bCMBJTzzwGwI8a9rpoVl2w7ua5n3gKSz2eIcdJczZvWlCfSgFRypSRwD3+6Mz - y6lrfcumdBDxpqCzY06uPGtYmsmyWFedshLQprOSiZgE+tSV7SclHckExHNVpTKpezdf6Geo2oF - WVRX1MmT6RcuZb1nMVO2dNwVJBmS1ialYT2C5CCDwRAbUhFMjQLIyNatZv1T/lCAsC/7KpV6e7/ - mjh7J8hrbattfDLSnfPkbtiV7knKDuOQMHtgiIvemiltXFcrm5GFcuq06s9CfGubdqqmZdFIwDM - GCknHzwCfnCEBxz9A7YVRWjFrdF8MXrZzOdCrNq7MS+mTJyZSZm+YQQQRIlcYwNvHc56qPoXZLG - 0Lktx7OrVbTc3TNWf1R+ZztwZfwiZmByg8p4798whAeay0DaNGyG8nVjVsSpY2y0C6FpCEjgJAS - gAAQhCA//9k= item2.IMPP;X-SERVICE-TYPE=AIM:aim:AIM%20JOHN item3.IMPP;X-SERVICE-TYPE=Gadugadu:x-apple:GADUGADU%20DOE item4.IMPP;X-SERVICE-TYPE=Groupwise:x-apple:GROUPWISE%20DOE @@ -252,22 +220,6 @@ EMAIL:john.doe@other.world EMAIL:john.doe@yet.another.world EMAIL:new local email NOTE:This is a test case which uses almost all Evolution fields. -PHOTO;ENCODING=B:/9j/4AAQSkZJRgABAQEASABIAAD/4QBgRXhpZgAASUkqAAgAAAACADEBAg - AHAAAAJgAAAGmHBAABAAAALgAAAAAAAABHb29nbGUAAAMAAJAHAAQAAAAwMjIwAqAEAAEAAAAkA - AAAA6AEAAEAAAAXAAAAAAAAAP/bAEMABQMEBAQDBQQEBAUFBQYHDAgHBwcHDwsLCQwRDxISEQ8R - ERMWHBcTFBoVEREYIRgaHR0fHx8TFyIkIh4kHB4fHv/bAEMBBQUFBwYHDggIDh4UERQeHh4eHh4 - eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHv/AABEIABcAJAMBIg - ACEQEDEQH/xAAZAAEAAwEBAAAAAAAAAAAAAAAABgcIBAX/xAAyEAABAgUDAgMECwAAAAAAAAABA - gQAAwUGEQcSIRMxFBUiCBYzQRgkR1FWd5alw9Pj/8QAFAEBAAAAAAAAAAAAAAAAAAAAAP/EABQR - AQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhEDEQA/ALl+lHoT+Of2l7/TEz0y1SsTUrzD3Krvmvl - 3S8X9Unyen1N+z4qE5zsX2zjHPyiGe1P9lX5k0f8Amipbuvm5bv1Iu9s8VrVJplDq02lsJFg09P - RT0eCufOzla1H1bCMBJTzzwGwI8a9rpoVl2w7ua5n3gKSz2eIcdJczZvWlCfSgFRypSRwD3+6Mz - y6lrfcumdBDxpqCzY06uPGtYmsmyWFedshLQprOSiZgE+tSV7SclHckExHNVpTKpezdf6Geo2oF - WVRX1MmT6RcuZb1nMVO2dNwVJBmS1ialYT2C5CCDwRAbUhFMjQLIyNatZv1T/lCAsC/7KpV6e7/ - mjh7J8hrbattfDLSnfPkbtiV7knKDuOQMHtgiIvemiltXFcrm5GFcuq06s9CfGubdqqmZdFIwDM - GCknHzwCfnCEBxz9A7YVRWjFrdF8MXrZzOdCrNq7MS+mTJyZSZm+YQQQRIlcYwNvHc56qPoXZLG - 0Lktx7OrVbTc3TNWf1R+ZztwZfwiZmByg8p4798whAeay0DaNGyG8nVjVsSpY2y0C6FpCEjgJAS - gAAQhCA//9k= item2.IMPP;X-SERVICE-TYPE=AIM:aim:AIM%20JOHN item3.IMPP;X-SERVICE-TYPE=Gadugadu:x-apple:GADUGADU%20DOE item4.IMPP;X-SERVICE-TYPE=Groupwise:x-apple:GROUPWISE%20DOE diff --git a/test/testcases/synctests/googlecontacts/eds_contact/testUpdateRemoteWins/README b/test/testcases/synctests/googlecontacts/eds_contact/testUpdateRemoteWins/README index 05df903f..5d317f72 100644 --- a/test/testcases/synctests/googlecontacts/eds_contact/testUpdateRemoteWins/README +++ b/test/testcases/synctests/googlecontacts/eds_contact/testUpdateRemoteWins/README @@ -2,4 +2,4 @@ Because the remote side wins and replaces values for common properties, the X-EVOLUTION-UI-SLOT gets lost when receiving a remote update or having the remote side win an update conflict. -local-synced takes that into account. \ No newline at end of file +local-synced takes that into account. - no PHOTO data because the server may re-encode the image diff --git a/test/testcases/synctests/googlecontacts/eds_contact/testUpdateRemoteWins/local b/test/testcases/synctests/googlecontacts/eds_contact/testUpdateRemoteWins/local index 883a9db4..d0ee49b7 100644 --- a/test/testcases/synctests/googlecontacts/eds_contact/testUpdateRemoteWins/local +++ b/test/testcases/synctests/googlecontacts/eds_contact/testUpdateRemoteWins/local @@ -48,21 +48,6 @@ X-JABBER:JABBER DOE X-MSN:MSN DOE X-SKYPE:SKYPE DOE X-SIP:SIP DOE -PHOTO;ENCODING=b;TYPE=JPEG:/9j/4AAQSkZJRgABAQEASABIAAD/4QAWRXhpZgAATU0AKgAA - AAgAAAAAAAD//gAXQ3JlYXRlZCB3aXRoIFRoZSBHSU1Q/9sAQwAFAwQEBAMFBAQEBQUFBgcM - CAcHBwcPCwsJDBEPEhIRDxERExYcFxMUGhURERghGBodHR8fHxMXIiQiHiQcHh8e/9sAQwEF - BQUHBgcOCAgOHhQRFB4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4e - Hh4eHh4eHh4e/8AAEQgAFwAkAwEiAAIRAQMRAf/EABkAAQADAQEAAAAAAAAAAAAAAAAGBwgE - Bf/EADIQAAECBQMCAwQLAAAAAAAAAAECBAADBQYRBxIhEzEUFSIIFjNBGCRHUVZ3lqXD0+P/ - xAAUAQEAAAAAAAAAAAAAAAAAAAAA/8QAFBEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEQMR - AD8AuX6UehP45/aXv9MTPTLVKxNSvMPcqu+a+XdLxf1SfJ6fU37PioTnOxfbOMc/KIZ7U/2V - fmTR/wCaKlu6+blu/Ui72zxWtUmmUOrTaWwkWDT09FPR4K587OVrUfVsIwElPPPAbAjxr2um - hWXbDu5rmfeApLPZ4hx0lzNm9aUJ9KAVHKlJHAPf7ozPLqWt9y6Z0EPGmoLNjTq48a1iaybJ - YV52yEtCms5KJmAT61JXtJyUdyQTEc1WlMql7N1/oZ6jagVZVFfUyZPpFy5lvWcxU7Z03BUk - GZLWJqVhPYLkIIPBEBtSEUyNAsjI1q1m/VP+UICwL/sqlXp7v+aOHsnyGttq218MtKd8+Ru2 - JXuScoO45Awe2CIi96aKW1cVyubkYVy6rTqz0J8a5t2qqZl0UjAMwYKScfPAJ+cIQHHP0Dth - VFaMWt0XwxetnM50Ks2rsxL6ZMnJlJmb5hBBBEiVxjA28dznqo+hdksbQuS3Hs6tVtNzdM1Z - /VH5nO3Bl/CJmYHKDynjv3zCEB5rLQNo0bIbydWNWxKljbLQLoWkISOAkBKAABCEID//2Q== END:VCARD BEGIN:VCARD @@ -115,21 +100,6 @@ X-JABBER:JABBER DOE X-MSN:MSN DOE X-SKYPE:SKYPE DOE X-SIP:SIP DOE -PHOTO;ENCODING=b;TYPE=JPEG:/9j/4AAQSkZJRgABAQEASABIAAD/4QAWRXhpZgAATU0AKgAA - AAgAAAAAAAD//gAXQ3JlYXRlZCB3aXRoIFRoZSBHSU1Q/9sAQwAFAwQEBAMFBAQEBQUFBgcM - CAcHBwcPCwsJDBEPEhIRDxERExYcFxMUGhURERghGBodHR8fHxMXIiQiHiQcHh8e/9sAQwEF - BQUHBgcOCAgOHhQRFB4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4e - Hh4eHh4eHh4e/8AAEQgAFwAkAwEiAAIRAQMRAf/EABkAAQADAQEAAAAAAAAAAAAAAAAGBwgE - Bf/EADIQAAECBQMCAwQLAAAAAAAAAAECBAADBQYRBxIhEzEUFSIIFjNBGCRHUVZ3lqXD0+P/ - xAAUAQEAAAAAAAAAAAAAAAAAAAAA/8QAFBEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEQMR - AD8AuX6UehP45/aXv9MTPTLVKxNSvMPcqu+a+XdLxf1SfJ6fU37PioTnOxfbOMc/KIZ7U/2V - fmTR/wCaKlu6+blu/Ui72zxWtUmmUOrTaWwkWDT09FPR4K587OVrUfVsIwElPPPAbAjxr2um - hWXbDu5rmfeApLPZ4hx0lzNm9aUJ9KAVHKlJHAPf7ozPLqWt9y6Z0EPGmoLNjTq48a1iaybJ - YV52yEtCms5KJmAT61JXtJyUdyQTEc1WlMql7N1/oZ6jagVZVFfUyZPpFy5lvWcxU7Z03BUk - GZLWJqVhPYLkIIPBEBtSEUyNAsjI1q1m/VP+UICwL/sqlXp7v+aOHsnyGttq218MtKd8+Ru2 - JXuScoO45Awe2CIi96aKW1cVyubkYVy6rTqz0J8a5t2qqZl0UjAMwYKScfPAJ+cIQHHP0Dth - VFaMWt0XwxetnM50Ks2rsxL6ZMnJlJmb5hBBBEiVxjA28dznqo+hdksbQuS3Hs6tVtNzdM1Z - /VH5nO3Bl/CJmYHKDynjv3zCEB5rLQNo0bIbydWNWxKljbLQLoWkISOAkBKAABCEID//2Q== END:VCARD BEGIN:VCARD @@ -182,20 +152,5 @@ X-JABBER:JABBER DOE X-MSN:MSN DOE X-SKYPE:SKYPE DOE X-SIP:SIP DOE -PHOTO;ENCODING=b;TYPE=JPEG:/9j/4AAQSkZJRgABAQEASABIAAD/4QAWRXhpZgAATU0AKgAA - AAgAAAAAAAD//gAXQ3JlYXRlZCB3aXRoIFRoZSBHSU1Q/9sAQwAFAwQEBAMFBAQEBQUFBgcM - CAcHBwcPCwsJDBEPEhIRDxERExYcFxMUGhURERghGBodHR8fHxMXIiQiHiQcHh8e/9sAQwEF - BQUHBgcOCAgOHhQRFB4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4e - Hh4eHh4eHh4e/8AAEQgAFwAkAwEiAAIRAQMRAf/EABkAAQADAQEAAAAAAAAAAAAAAAAGBwgE - Bf/EADIQAAECBQMCAwQLAAAAAAAAAAECBAADBQYRBxIhEzEUFSIIFjNBGCRHUVZ3lqXD0+P/ - xAAUAQEAAAAAAAAAAAAAAAAAAAAA/8QAFBEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEQMR - AD8AuX6UehP45/aXv9MTPTLVKxNSvMPcqu+a+XdLxf1SfJ6fU37PioTnOxfbOMc/KIZ7U/2V - fmTR/wCaKlu6+blu/Ui72zxWtUmmUOrTaWwkWDT09FPR4K587OVrUfVsIwElPPPAbAjxr2um - hWXbDu5rmfeApLPZ4hx0lzNm9aUJ9KAVHKlJHAPf7ozPLqWt9y6Z0EPGmoLNjTq48a1iaybJ - YV52yEtCms5KJmAT61JXtJyUdyQTEc1WlMql7N1/oZ6jagVZVFfUyZPpFy5lvWcxU7Z03BUk - GZLWJqVhPYLkIIPBEBtSEUyNAsjI1q1m/VP+UICwL/sqlXp7v+aOHsnyGttq218MtKd8+Ru2 - JXuScoO45Awe2CIi96aKW1cVyubkYVy6rTqz0J8a5t2qqZl0UjAMwYKScfPAJ+cIQHHP0Dth - VFaMWt0XwxetnM50Ks2rsxL6ZMnJlJmb5hBBBEiVxjA28dznqo+hdksbQuS3Hs6tVtNzdM1Z - /VH5nO3Bl/CJmYHKDynjv3zCEB5rLQNo0bIbydWNWxKljbLQLoWkISOAkBKAABCEID//2Q== END:VCARD diff --git a/test/testcases/synctests/googlecontacts/eds_contact/testUpdateRemoteWins/local-synced b/test/testcases/synctests/googlecontacts/eds_contact/testUpdateRemoteWins/local-synced index d19541ea..695a9dfd 100644 --- a/test/testcases/synctests/googlecontacts/eds_contact/testUpdateRemoteWins/local-synced +++ b/test/testcases/synctests/googlecontacts/eds_contact/testUpdateRemoteWins/local-synced @@ -49,22 +49,6 @@ X-JABBER:JABBER DOE X-MSN:MSN DOE X-SKYPE:SKYPE DOE X-SIP:SIP DOE -PHOTO;ENCODING=B:/9j/4AAQSkZJRgABAQEASABIAAD/4QBgRXhpZgAASUkqAAgAAAACADEBAg - AHAAAAJgAAAGmHBAABAAAALgAAAAAAAABHb29nbGUAAAMAAJAHAAQAAAAwMjIwAqAEAAEAAAAkA - AAAA6AEAAEAAAAXAAAAAAAAAP/bAEMABQMEBAQDBQQEBAUFBQYHDAgHBwcHDwsLCQwRDxISEQ8R - ERMWHBcTFBoVEREYIRgaHR0fHx8TFyIkIh4kHB4fHv/bAEMBBQUFBwYHDggIDh4UERQeHh4eHh4 - eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHv/AABEIABcAJAMBIg - ACEQEDEQH/xAAZAAEAAwEBAAAAAAAAAAAAAAAABgcIBAX/xAAyEAABAgUDAgMECwAAAAAAAAABA - gQAAwUGEQcSIRMxFBUiCBYzQRgkR1FWd5alw9Pj/8QAFAEBAAAAAAAAAAAAAAAAAAAAAP/EABQR - AQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhEDEQA/ALl+lHoT+Of2l7/TEz0y1SsTUrzD3Krvmvl - 3S8X9Unyen1N+z4qE5zsX2zjHPyiGe1P9lX5k0f8Amipbuvm5bv1Iu9s8VrVJplDq02lsJFg09P - RT0eCufOzla1H1bCMBJTzzwGwI8a9rpoVl2w7ua5n3gKSz2eIcdJczZvWlCfSgFRypSRwD3+6Mz - y6lrfcumdBDxpqCzY06uPGtYmsmyWFedshLQprOSiZgE+tSV7SclHckExHNVpTKpezdf6Geo2oF - WVRX1MmT6RcuZb1nMVO2dNwVJBmS1ialYT2C5CCDwRAbUhFMjQLIyNatZv1T/lCAsC/7KpV6e7/ - mjh7J8hrbattfDLSnfPkbtiV7knKDuOQMHtgiIvemiltXFcrm5GFcuq06s9CfGubdqqmZdFIwDM - GCknHzwCfnCEBxz9A7YVRWjFrdF8MXrZzOdCrNq7MS+mTJyZSZm+YQQQRIlcYwNvHc56qPoXZLG - 0Lktx7OrVbTc3TNWf1R+ZztwZfwiZmByg8p4798whAeay0DaNGyG8nVjVsSpY2y0C6FpCEjgJAS - gAAQhCA//9k= TEL;TYPE=HOME:new remote tel 1 TEL;X-ABLabel=new-remote-tel-label:new remote tel 2 EMAIL;X-ABLabel=new-remote-email-label:new remote email 1 @@ -137,22 +121,6 @@ X-JABBER:JABBER DOE X-MSN:MSN DOE X-SKYPE:SKYPE DOE X-SIP:SIP DOE -PHOTO;ENCODING=B:/9j/4AAQSkZJRgABAQEASABIAAD/4QBgRXhpZgAASUkqAAgAAAACADEBAg - AHAAAAJgAAAGmHBAABAAAALgAAAAAAAABHb29nbGUAAAMAAJAHAAQAAAAwMjIwAqAEAAEAAAAkA - AAAA6AEAAEAAAAXAAAAAAAAAP/bAEMABQMEBAQDBQQEBAUFBQYHDAgHBwcHDwsLCQwRDxISEQ8R - ERMWHBcTFBoVEREYIRgaHR0fHx8TFyIkIh4kHB4fHv/bAEMBBQUFBwYHDggIDh4UERQeHh4eHh4 - eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHv/AABEIABcAJAMBIg - ACEQEDEQH/xAAZAAEAAwEBAAAAAAAAAAAAAAAABgcIBAX/xAAyEAABAgUDAgMECwAAAAAAAAABA - gQAAwUGEQcSIRMxFBUiCBYzQRgkR1FWd5alw9Pj/8QAFAEBAAAAAAAAAAAAAAAAAAAAAP/EABQR - AQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhEDEQA/ALl+lHoT+Of2l7/TEz0y1SsTUrzD3Krvmvl - 3S8X9Unyen1N+z4qE5zsX2zjHPyiGe1P9lX5k0f8Amipbuvm5bv1Iu9s8VrVJplDq02lsJFg09P - RT0eCufOzla1H1bCMBJTzzwGwI8a9rpoVl2w7ua5n3gKSz2eIcdJczZvWlCfSgFRypSRwD3+6Mz - y6lrfcumdBDxpqCzY06uPGtYmsmyWFedshLQprOSiZgE+tSV7SclHckExHNVpTKpezdf6Geo2oF - WVRX1MmT6RcuZb1nMVO2dNwVJBmS1ialYT2C5CCDwRAbUhFMjQLIyNatZv1T/lCAsC/7KpV6e7/ - mjh7J8hrbattfDLSnfPkbtiV7knKDuOQMHtgiIvemiltXFcrm5GFcuq06s9CfGubdqqmZdFIwDM - GCknHzwCfnCEBxz9A7YVRWjFrdF8MXrZzOdCrNq7MS+mTJyZSZm+YQQQRIlcYwNvHc56qPoXZLG - 0Lktx7OrVbTc3TNWf1R+ZztwZfwiZmByg8p4798whAeay0DaNGyG8nVjVsSpY2y0C6FpCEjgJAS - gAAQhCA//9k= TEL;TYPE=HOME:new remote tel 1 TEL;X-ABLabel=new-remote-tel-label:new remote tel 2 EMAIL;X-ABLabel=new-remote-email-label:new remote email 1 @@ -224,21 +192,6 @@ X-JABBER:JABBER DOE X-MSN:MSN DOE X-SKYPE:SKYPE DOE X-SIP:SIP DOE -PHOTO;ENCODING=b;TYPE=JPEG:/9j/4AAQSkZJRgABAQEASABIAAD/4QAWRXhpZgAATU0AKgAA - AAgAAAAAAAD//gAXQ3JlYXRlZCB3aXRoIFRoZSBHSU1Q/9sAQwAFAwQEBAMFBAQEBQUFBgcM - CAcHBwcPCwsJDBEPEhIRDxERExYcFxMUGhURERghGBodHR8fHxMXIiQiHiQcHh8e/9sAQwEF - BQUHBgcOCAgOHhQRFB4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4e - Hh4eHh4eHh4e/8AAEQgAFwAkAwEiAAIRAQMRAf/EABkAAQADAQEAAAAAAAAAAAAAAAAGBwgE - Bf/EADIQAAECBQMCAwQLAAAAAAAAAAECBAADBQYRBxIhEzEUFSIIFjNBGCRHUVZ3lqXD0+P/ - xAAUAQEAAAAAAAAAAAAAAAAAAAAA/8QAFBEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEQMR - AD8AuX6UehP45/aXv9MTPTLVKxNSvMPcqu+a+XdLxf1SfJ6fU37PioTnOxfbOMc/KIZ7U/2V - fmTR/wCaKlu6+blu/Ui72zxWtUmmUOrTaWwkWDT09FPR4K587OVrUfVsIwElPPPAbAjxr2um - hWXbDu5rmfeApLPZ4hx0lzNm9aUJ9KAVHKlJHAPf7ozPLqWt9y6Z0EPGmoLNjTq48a1iaybJ - YV52yEtCms5KJmAT61JXtJyUdyQTEc1WlMql7N1/oZ6jagVZVFfUyZPpFy5lvWcxU7Z03BUk - GZLWJqVhPYLkIIPBEBtSEUyNAsjI1q1m/VP+UICwL/sqlXp7v+aOHsnyGttq218MtKd8+Ru2 - JXuScoO45Awe2CIi96aKW1cVyubkYVy6rTqz0J8a5t2qqZl0UjAMwYKScfPAJ+cIQHHP0Dth - VFaMWt0XwxetnM50Ks2rsxL6ZMnJlJmb5hBBBEiVxjA28dznqo+hdksbQuS3Hs6tVtNzdM1Z - /VH5nO3Bl/CJmYHKDynjv3zCEB5rLQNo0bIbydWNWxKljbLQLoWkISOAkBKAABCEID//2Q== BDAY:2006-01-01 END:VCARD diff --git a/test/testcases/synctests/googlecontacts/eds_contact/testUpdateRemoteWins/remote-synced b/test/testcases/synctests/googlecontacts/eds_contact/testUpdateRemoteWins/remote-synced index 350ad5d7..62458698 100644 --- a/test/testcases/synctests/googlecontacts/eds_contact/testUpdateRemoteWins/remote-synced +++ b/test/testcases/synctests/googlecontacts/eds_contact/testUpdateRemoteWins/remote-synced @@ -27,22 +27,6 @@ EMAIL;TYPE=HOME:john.doe@home.priv EMAIL:john.doe@other.world EMAIL:john.doe@yet.another.world NOTE:This is a test case which uses almost all Evolution fields. -PHOTO;ENCODING=B:/9j/4AAQSkZJRgABAQEASABIAAD/4QBgRXhpZgAASUkqAAgAAAACADEBAg - AHAAAAJgAAAGmHBAABAAAALgAAAAAAAABHb29nbGUAAAMAAJAHAAQAAAAwMjIwAqAEAAEAAAAkA - AAAA6AEAAEAAAAXAAAAAAAAAP/bAEMABQMEBAQDBQQEBAUFBQYHDAgHBwcHDwsLCQwRDxISEQ8R - ERMWHBcTFBoVEREYIRgaHR0fHx8TFyIkIh4kHB4fHv/bAEMBBQUFBwYHDggIDh4UERQeHh4eHh4 - eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHv/AABEIABcAJAMBIg - ACEQEDEQH/xAAZAAEAAwEBAAAAAAAAAAAAAAAABgcIBAX/xAAyEAABAgUDAgMECwAAAAAAAAABA - gQAAwUGEQcSIRMxFBUiCBYzQRgkR1FWd5alw9Pj/8QAFAEBAAAAAAAAAAAAAAAAAAAAAP/EABQR - AQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhEDEQA/ALl+lHoT+Of2l7/TEz0y1SsTUrzD3Krvmvl - 3S8X9Unyen1N+z4qE5zsX2zjHPyiGe1P9lX5k0f8Amipbuvm5bv1Iu9s8VrVJplDq02lsJFg09P - RT0eCufOzla1H1bCMBJTzzwGwI8a9rpoVl2w7ua5n3gKSz2eIcdJczZvWlCfSgFRypSRwD3+6Mz - y6lrfcumdBDxpqCzY06uPGtYmsmyWFedshLQprOSiZgE+tSV7SclHckExHNVpTKpezdf6Geo2oF - WVRX1MmT6RcuZb1nMVO2dNwVJBmS1ialYT2C5CCDwRAbUhFMjQLIyNatZv1T/lCAsC/7KpV6e7/ - mjh7J8hrbattfDLSnfPkbtiV7knKDuOQMHtgiIvemiltXFcrm5GFcuq06s9CfGubdqqmZdFIwDM - GCknHzwCfnCEBxz9A7YVRWjFrdF8MXrZzOdCrNq7MS+mTJyZSZm+YQQQRIlcYwNvHc56qPoXZLG - 0Lktx7OrVbTc3TNWf1R+ZztwZfwiZmByg8p4798whAeay0DaNGyG8nVjVsSpY2y0C6FpCEjgJAS - gAAQhCA//9k= item2.IMPP;X-SERVICE-TYPE=AIM:aim:AIM%20JOHN item3.IMPP;X-SERVICE-TYPE=Gadugadu:x-apple:GADUGADU%20DOE item4.IMPP;X-SERVICE-TYPE=Groupwise:x-apple:GROUPWISE%20DOE @@ -140,22 +124,6 @@ EMAIL:john.doe@other.world EMAIL:john.doe@yet.another.world EMAIL:new local email NOTE:This is a test case which uses almost all Evolution fields. -PHOTO;ENCODING=B:/9j/4AAQSkZJRgABAQEASABIAAD/4QBgRXhpZgAASUkqAAgAAAACADEBAg - AHAAAAJgAAAGmHBAABAAAALgAAAAAAAABHb29nbGUAAAMAAJAHAAQAAAAwMjIwAqAEAAEAAAAkA - AAAA6AEAAEAAAAXAAAAAAAAAP/bAEMABQMEBAQDBQQEBAUFBQYHDAgHBwcHDwsLCQwRDxISEQ8R - ERMWHBcTFBoVEREYIRgaHR0fHx8TFyIkIh4kHB4fHv/bAEMBBQUFBwYHDggIDh4UERQeHh4eHh4 - eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHv/AABEIABcAJAMBIg - ACEQEDEQH/xAAZAAEAAwEBAAAAAAAAAAAAAAAABgcIBAX/xAAyEAABAgUDAgMECwAAAAAAAAABA - gQAAwUGEQcSIRMxFBUiCBYzQRgkR1FWd5alw9Pj/8QAFAEBAAAAAAAAAAAAAAAAAAAAAP/EABQR - AQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhEDEQA/ALl+lHoT+Of2l7/TEz0y1SsTUrzD3Krvmvl - 3S8X9Unyen1N+z4qE5zsX2zjHPyiGe1P9lX5k0f8Amipbuvm5bv1Iu9s8VrVJplDq02lsJFg09P - RT0eCufOzla1H1bCMBJTzzwGwI8a9rpoVl2w7ua5n3gKSz2eIcdJczZvWlCfSgFRypSRwD3+6Mz - y6lrfcumdBDxpqCzY06uPGtYmsmyWFedshLQprOSiZgE+tSV7SclHckExHNVpTKpezdf6Geo2oF - WVRX1MmT6RcuZb1nMVO2dNwVJBmS1ialYT2C5CCDwRAbUhFMjQLIyNatZv1T/lCAsC/7KpV6e7/ - mjh7J8hrbattfDLSnfPkbtiV7knKDuOQMHtgiIvemiltXFcrm5GFcuq06s9CfGubdqqmZdFIwDM - GCknHzwCfnCEBxz9A7YVRWjFrdF8MXrZzOdCrNq7MS+mTJyZSZm+YQQQRIlcYwNvHc56qPoXZLG - 0Lktx7OrVbTc3TNWf1R+ZztwZfwiZmByg8p4798whAeay0DaNGyG8nVjVsSpY2y0C6FpCEjgJAS - gAAQhCA//9k= item2.IMPP;X-SERVICE-TYPE=AIM:aim:AIM%20JOHN item3.IMPP;X-SERVICE-TYPE=Gadugadu:x-apple:GADUGADU%20DOE item4.IMPP;X-SERVICE-TYPE=Groupwise:x-apple:GROUPWISE%20DOE @@ -252,22 +220,6 @@ EMAIL:john.doe@other.world EMAIL:john.doe@yet.another.world EMAIL:new local email NOTE:This is a test case which uses almost all Evolution fields. -PHOTO;ENCODING=B:/9j/4AAQSkZJRgABAQEASABIAAD/4QBgRXhpZgAASUkqAAgAAAACADEBAg - AHAAAAJgAAAGmHBAABAAAALgAAAAAAAABHb29nbGUAAAMAAJAHAAQAAAAwMjIwAqAEAAEAAAAkA - AAAA6AEAAEAAAAXAAAAAAAAAP/bAEMABQMEBAQDBQQEBAUFBQYHDAgHBwcHDwsLCQwRDxISEQ8R - ERMWHBcTFBoVEREYIRgaHR0fHx8TFyIkIh4kHB4fHv/bAEMBBQUFBwYHDggIDh4UERQeHh4eHh4 - eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHv/AABEIABcAJAMBIg - ACEQEDEQH/xAAZAAEAAwEBAAAAAAAAAAAAAAAABgcIBAX/xAAyEAABAgUDAgMECwAAAAAAAAABA - gQAAwUGEQcSIRMxFBUiCBYzQRgkR1FWd5alw9Pj/8QAFAEBAAAAAAAAAAAAAAAAAAAAAP/EABQR - AQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhEDEQA/ALl+lHoT+Of2l7/TEz0y1SsTUrzD3Krvmvl - 3S8X9Unyen1N+z4qE5zsX2zjHPyiGe1P9lX5k0f8Amipbuvm5bv1Iu9s8VrVJplDq02lsJFg09P - RT0eCufOzla1H1bCMBJTzzwGwI8a9rpoVl2w7ua5n3gKSz2eIcdJczZvWlCfSgFRypSRwD3+6Mz - y6lrfcumdBDxpqCzY06uPGtYmsmyWFedshLQprOSiZgE+tSV7SclHckExHNVpTKpezdf6Geo2oF - WVRX1MmT6RcuZb1nMVO2dNwVJBmS1ialYT2C5CCDwRAbUhFMjQLIyNatZv1T/lCAsC/7KpV6e7/ - mjh7J8hrbattfDLSnfPkbtiV7knKDuOQMHtgiIvemiltXFcrm5GFcuq06s9CfGubdqqmZdFIwDM - GCknHzwCfnCEBxz9A7YVRWjFrdF8MXrZzOdCrNq7MS+mTJyZSZm+YQQQRIlcYwNvHc56qPoXZLG - 0Lktx7OrVbTc3TNWf1R+ZztwZfwiZmByg8p4798whAeay0DaNGyG8nVjVsSpY2y0C6FpCEjgJAS - gAAQhCA//9k= item2.IMPP;X-SERVICE-TYPE=AIM:aim:AIM%20JOHN item3.IMPP;X-SERVICE-TYPE=Gadugadu:x-apple:GADUGADU%20DOE item4.IMPP;X-SERVICE-TYPE=Groupwise:x-apple:GROUPWISE%20DOE diff --git a/test/testcases/synctests/googlecontacts/eds_contact/testUpload/README b/test/testcases/synctests/googlecontacts/eds_contact/testUpload/README index f2bd426a..2ae51fec 100644 --- a/test/testcases/synctests/googlecontacts/eds_contact/testUpload/README +++ b/test/testcases/synctests/googlecontacts/eds_contact/testUpload/README @@ -4,3 +4,4 @@ The test data was adapted to cope with some bugs/limitations: and get lost. - ORG department and unit get merged. +- no PHOTO data because the server may re-encode the image diff --git a/test/testcases/synctests/googlecontacts/eds_contact/testUpload/local b/test/testcases/synctests/googlecontacts/eds_contact/testUpload/local index 515623b1..5fa9e31b 100644 --- a/test/testcases/synctests/googlecontacts/eds_contact/testUpload/local +++ b/test/testcases/synctests/googlecontacts/eds_contact/testUpload/local @@ -54,19 +54,4 @@ X-JABBER:JABBER DOE X-MSN:MSN DOE X-SKYPE:SKYPE DOE X-SIP:SIP DOE -PHOTO;ENCODING=b;TYPE=JPEG:/9j/4AAQSkZJRgABAQEASABIAAD/4QAWRXhpZgAATU0AKgAA - AAgAAAAAAAD//gAXQ3JlYXRlZCB3aXRoIFRoZSBHSU1Q/9sAQwAFAwQEBAMFBAQEBQUFBgcM - CAcHBwcPCwsJDBEPEhIRDxERExYcFxMUGhURERghGBodHR8fHxMXIiQiHiQcHh8e/9sAQwEF - BQUHBgcOCAgOHhQRFB4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4e - Hh4eHh4eHh4e/8AAEQgAFwAkAwEiAAIRAQMRAf/EABkAAQADAQEAAAAAAAAAAAAAAAAGBwgE - Bf/EADIQAAECBQMCAwQLAAAAAAAAAAECBAADBQYRBxIhEzEUFSIIFjNBGCRHUVZ3lqXD0+P/ - xAAUAQEAAAAAAAAAAAAAAAAAAAAA/8QAFBEBAAAAAAAAAAAAAAAAAAAAAP/aAAwDAQACEQMR - AD8AuX6UehP45/aXv9MTPTLVKxNSvMPcqu+a+XdLxf1SfJ6fU37PioTnOxfbOMc/KIZ7U/2V - fmTR/wCaKlu6+blu/Ui72zxWtUmmUOrTaWwkWDT09FPR4K587OVrUfVsIwElPPPAbAjxr2um - hWXbDu5rmfeApLPZ4hx0lzNm9aUJ9KAVHKlJHAPf7ozPLqWt9y6Z0EPGmoLNjTq48a1iaybJ - YV52yEtCms5KJmAT61JXtJyUdyQTEc1WlMql7N1/oZ6jagVZVFfUyZPpFy5lvWcxU7Z03BUk - GZLWJqVhPYLkIIPBEBtSEUyNAsjI1q1m/VP+UICwL/sqlXp7v+aOHsnyGttq218MtKd8+Ru2 - JXuScoO45Awe2CIi96aKW1cVyubkYVy6rTqz0J8a5t2qqZl0UjAMwYKScfPAJ+cIQHHP0Dth - VFaMWt0XwxetnM50Ks2rsxL6ZMnJlJmb5hBBBEiVxjA28dznqo+hdksbQuS3Hs6tVtNzdM1Z - /VH5nO3Bl/CJmYHKDynjv3zCEB5rLQNo0bIbydWNWxKljbLQLoWkISOAkBKAABCEID//2Q== END:VCARD diff --git a/test/testcases/synctests/googlecontacts/eds_contact/testUpload/local-synced b/test/testcases/synctests/googlecontacts/eds_contact/testUpload/local-synced index 756c82bd..0fcbbb91 100644 --- a/test/testcases/synctests/googlecontacts/eds_contact/testUpload/local-synced +++ b/test/testcases/synctests/googlecontacts/eds_contact/testUpload/local-synced @@ -50,20 +50,4 @@ X-JABBER:JABBER DOE X-MSN:MSN DOE X-SKYPE:SKYPE DOE X-SIP:SIP DOE -PHOTO;ENCODING=B:/9j/4AAQSkZJRgABAQEASABIAAD/4QBgRXhpZgAASUkqAAgAAAACADEBAg - AHAAAAJgAAAGmHBAABAAAALgAAAAAAAABHb29nbGUAAAMAAJAHAAQAAAAwMjIwAqAEAAEAAAAkA - AAAA6AEAAEAAAAXAAAAAAAAAP/bAEMABQMEBAQDBQQEBAUFBQYHDAgHBwcHDwsLCQwRDxISEQ8R - ERMWHBcTFBoVEREYIRgaHR0fHx8TFyIkIh4kHB4fHv/bAEMBBQUFBwYHDggIDh4UERQeHh4eHh4 - eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHv/AABEIABcAJAMBIg - ACEQEDEQH/xAAZAAEAAwEBAAAAAAAAAAAAAAAABgcIBAX/xAAyEAABAgUDAgMECwAAAAAAAAABA - gQAAwUGEQcSIRMxFBUiCBYzQRgkR1FWd5alw9Pj/8QAFAEBAAAAAAAAAAAAAAAAAAAAAP/EABQR - AQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhEDEQA/ALl+lHoT+Of2l7/TEz0y1SsTUrzD3Krvmvl - 3S8X9Unyen1N+z4qE5zsX2zjHPyiGe1P9lX5k0f8Amipbuvm5bv1Iu9s8VrVJplDq02lsJFg09P - RT0eCufOzla1H1bCMBJTzzwGwI8a9rpoVl2w7ua5n3gKSz2eIcdJczZvWlCfSgFRypSRwD3+6Mz - y6lrfcumdBDxpqCzY06uPGtYmsmyWFedshLQprOSiZgE+tSV7SclHckExHNVpTKpezdf6Geo2oF - WVRX1MmT6RcuZb1nMVO2dNwVJBmS1ialYT2C5CCDwRAbUhFMjQLIyNatZv1T/lCAsC/7KpV6e7/ - mjh7J8hrbattfDLSnfPkbtiV7knKDuOQMHtgiIvemiltXFcrm5GFcuq06s9CfGubdqqmZdFIwDM - GCknHzwCfnCEBxz9A7YVRWjFrdF8MXrZzOdCrNq7MS+mTJyZSZm+YQQQRIlcYwNvHc56qPoXZLG - 0Lktx7OrVbTc3TNWf1R+ZztwZfwiZmByg8p4798whAeay0DaNGyG8nVjVsSpY2y0C6FpCEjgJAS - gAAQhCA//9k= END:VCARD diff --git a/test/testcases/synctests/googlecontacts/eds_contact/testUpload/remote b/test/testcases/synctests/googlecontacts/eds_contact/testUpload/remote index aa379d54..a9f265be 100644 --- a/test/testcases/synctests/googlecontacts/eds_contact/testUpload/remote +++ b/test/testcases/synctests/googlecontacts/eds_contact/testUpload/remote @@ -27,22 +27,6 @@ EMAIL;TYPE=HOME:john.doe@home.priv EMAIL:john.doe@other.world EMAIL:john.doe@yet.another.world NOTE:This is a test case which uses almost all Evolution fields. -PHOTO;ENCODING=B:/9j/4AAQSkZJRgABAQEASABIAAD/4QBgRXhpZgAASUkqAAgAAAACADEBAg - AHAAAAJgAAAGmHBAABAAAALgAAAAAAAABHb29nbGUAAAMAAJAHAAQAAAAwMjIwAqAEAAEAAAAkA - AAAA6AEAAEAAAAXAAAAAAAAAP/bAEMABQMEBAQDBQQEBAUFBQYHDAgHBwcHDwsLCQwRDxISEQ8R - ERMWHBcTFBoVEREYIRgaHR0fHx8TFyIkIh4kHB4fHv/bAEMBBQUFBwYHDggIDh4UERQeHh4eHh4 - eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHh4eHv/AABEIABcAJAMBIg - ACEQEDEQH/xAAZAAEAAwEBAAAAAAAAAAAAAAAABgcIBAX/xAAyEAABAgUDAgMECwAAAAAAAAABA - gQAAwUGEQcSIRMxFBUiCBYzQRgkR1FWd5alw9Pj/8QAFAEBAAAAAAAAAAAAAAAAAAAAAP/EABQR - AQAAAAAAAAAAAAAAAAAAAAD/2gAMAwEAAhEDEQA/ALl+lHoT+Of2l7/TEz0y1SsTUrzD3Krvmvl - 3S8X9Unyen1N+z4qE5zsX2zjHPyiGe1P9lX5k0f8Amipbuvm5bv1Iu9s8VrVJplDq02lsJFg09P - RT0eCufOzla1H1bCMBJTzzwGwI8a9rpoVl2w7ua5n3gKSz2eIcdJczZvWlCfSgFRypSRwD3+6Mz - y6lrfcumdBDxpqCzY06uPGtYmsmyWFedshLQprOSiZgE+tSV7SclHckExHNVpTKpezdf6Geo2oF - WVRX1MmT6RcuZb1nMVO2dNwVJBmS1ialYT2C5CCDwRAbUhFMjQLIyNatZv1T/lCAsC/7KpV6e7/ - mjh7J8hrbattfDLSnfPkbtiV7knKDuOQMHtgiIvemiltXFcrm5GFcuq06s9CfGubdqqmZdFIwDM - GCknHzwCfnCEBxz9A7YVRWjFrdF8MXrZzOdCrNq7MS+mTJyZSZm+YQQQRIlcYwNvHc56qPoXZLG - 0Lktx7OrVbTc3TNWf1R+ZztwZfwiZmByg8p4798whAeay0DaNGyG8nVjVsSpY2y0C6FpCEjgJAS - gAAQhCA//9k= item2.IMPP;X-SERVICE-TYPE=AIM:aim:AIM%20JOHN item3.IMPP;X-SERVICE-TYPE=Gadugadu:x-apple:GADUGADU%20DOE item4.IMPP;X-SERVICE-TYPE=Groupwise:x-apple:GROUPWISE%20DOE diff --git a/test/wrappercheck.sh b/test/wrappercheck.sh index 357e0639..55be48b2 100755 --- a/test/wrappercheck.sh +++ b/test/wrappercheck.sh @@ -74,10 +74,8 @@ PIDS+="$BACKGROUND_PID" if [ "$DAEMON_LOG" ] && [ "$WAIT_FOR_DAEMON_OUTPUT" ]; then ( set +x; echo >&2 "*** waiting for daemon to write '$WAIT_FOR_DAEMON_OUTPUT' into $DAEMON_LOG" - while [ $daemonmatches -eq $(grep -e "$WAIT_FOR_DAEMON_OUTPUT" "$DAEMON_LOG" | wc -l) ]; do - if ! kill -0 $BACKGROUND_PID 2>/dev/null; then - break - fi + while kill -0 $BACKGROUND_PID 2>/dev/null && + [ $daemonmatches -eq $(grep -e "$WAIT_FOR_DAEMON_OUTPUT" "$DAEMON_LOG" | wc -l) ]; do sleep 1 done ) @@ -85,7 +83,8 @@ fi if [ "$WAIT_FOR_DBUS_DAEMON" ]; then ( set +x; echo >&2 "*** waiting for daemon to connect to D-Bus as '$WAIT_FOR_DBUS_DAEMON'" - while ! (dbus-send --session --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.ListNames | grep -q "$WAIT_FOR_DBUS_DAEMON"); do + while kill -0 $BACKGROUND_PID 2>/dev/null && + ! (dbus-send --session --print-reply --dest=org.freedesktop.DBus /org/freedesktop/DBus org.freedesktop.DBus.ListNames | grep -q "$WAIT_FOR_DBUS_DAEMON"); do sleep 1 done )