Hello community, here is the log from the commit of package libfilezilla for openSUSE:Factory checked in at 2018-02-24 16:39:45 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/libfilezilla (Old) and /work/SRC/openSUSE:Factory/.libfilezilla.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "libfilezilla" Sat Feb 24 16:39:45 2018 rev:16 rq:579769 version:0.12.1 Changes: -------- --- /work/SRC/openSUSE:Factory/libfilezilla/libfilezilla.changes 2018-01-26 13:39:21.573687000 +0100 +++ /work/SRC/openSUSE:Factory/.libfilezilla.new/libfilezilla.changes 2018-02-24 16:40:27.359125139 +0100 @@ -1,0 +2,13 @@ +Sat Feb 24 09:54:50 UTC 2018 - ec...@opensuse.org + +- update to 0.12.1 + * New features: + - Added fz::buffer::operator== and operator!= + * Bugfixes and minor changes: + - Fixed bug in fz::buffer::get(size_t) +- changes from 0.12.0 + * New features: + - Added fz::datetime::operator bool + - Added fz::datetime::get_rfc822 and fz::datetime::set_rfc822 + +------------------------------------------------------------------- Old: ---- libfilezilla-0.11.2.tar.bz2 New: ---- libfilezilla-0.12.1.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ libfilezilla.spec ++++++ --- /var/tmp/diff_new_pack.yLPlLi/_old 2018-02-24 16:40:28.287091744 +0100 +++ /var/tmp/diff_new_pack.yLPlLi/_new 2018-02-24 16:40:28.291091600 +0100 @@ -20,7 +20,7 @@ %define libname %{name}%{major} %define develname %{name}-devel Name: libfilezilla -Version: 0.11.2 +Version: 0.12.1 Release: 0 Summary: C++ library for filezilla License: GPL-2.0+ ++++++ libfilezilla-0.11.2.tar.bz2 -> libfilezilla-0.12.1.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfilezilla-0.11.2/NEWS new/libfilezilla-0.12.1/NEWS --- old/libfilezilla-0.11.2/NEWS 2018-01-05 11:43:06.000000000 +0100 +++ new/libfilezilla-0.12.1/NEWS 2018-02-23 09:29:01.000000000 +0100 @@ -1,3 +1,13 @@ +0.12.1 (2018-02-23) + ++ Added fz::buffer::operator== and operator!= +- Fixed bug in fz::buffer::get(size_t) + +0.12.0 (2018-02-16) + ++ Added fz::datetime::operator bool ++ Added fz::datetime::get_rfc822 and fz::datetime::set_rfc822 + 0.11.2 (2018-01-05) + Added fz::starts_with and fz::ends_with diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfilezilla-0.11.2/configure new/libfilezilla-0.12.1/configure --- old/libfilezilla-0.11.2/configure 2018-01-05 11:43:22.000000000 +0100 +++ new/libfilezilla-0.12.1/configure 2018-02-23 09:29:12.000000000 +0100 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for libfilezilla 0.11.2. +# Generated by GNU Autoconf 2.69 for libfilezilla 0.12.1. # # Report bugs to <tim.ko...@filezilla-project.org>. # @@ -590,8 +590,8 @@ # Identity of this package. PACKAGE_NAME='libfilezilla' PACKAGE_TARNAME='libfilezilla' -PACKAGE_VERSION='0.11.2' -PACKAGE_STRING='libfilezilla 0.11.2' +PACKAGE_VERSION='0.12.1' +PACKAGE_STRING='libfilezilla 0.12.1' PACKAGE_BUGREPORT='tim.ko...@filezilla-project.org' PACKAGE_URL='https://lib.filezilla-project.org/' @@ -1413,7 +1413,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures libfilezilla 0.11.2 to adapt to many kinds of systems. +\`configure' configures libfilezilla 0.12.1 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1484,7 +1484,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of libfilezilla 0.11.2:";; + short | recursive ) echo "Configuration of libfilezilla 0.12.1:";; esac cat <<\_ACEOF @@ -1621,7 +1621,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -libfilezilla configure 0.11.2 +libfilezilla configure 0.12.1 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -2066,7 +2066,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by libfilezilla $as_me 0.11.2, which was +It was created by libfilezilla $as_me 0.12.1, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2932,7 +2932,7 @@ # Define the identity of the package. PACKAGE='libfilezilla' - VERSION='0.11.2' + VERSION='0.12.1' cat >>confdefs.h <<_ACEOF @@ -20908,7 +20908,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by libfilezilla $as_me 0.11.2, which was +This file was extended by libfilezilla $as_me 0.12.1, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -20975,7 +20975,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -libfilezilla config.status 0.11.2 +libfilezilla config.status 0.12.1 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfilezilla-0.11.2/configure.ac new/libfilezilla-0.12.1/configure.ac --- old/libfilezilla-0.11.2/configure.ac 2018-01-05 11:43:06.000000000 +0100 +++ new/libfilezilla-0.12.1/configure.ac 2018-02-23 09:29:01.000000000 +0100 @@ -1,4 +1,4 @@ -AC_INIT([libfilezilla],[0.11.2],[tim.ko...@filezilla-project.org],[],[https://lib.filezilla-project.org/]) +AC_INIT([libfilezilla],[0.12.1],[tim.ko...@filezilla-project.org],[],[https://lib.filezilla-project.org/]) AC_CONFIG_HEADERS([lib/libfilezilla/private/config.hpp]) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_AUX_DIR(config) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfilezilla-0.11.2/lib/buffer.cpp new/libfilezilla-0.12.1/lib/buffer.cpp --- old/libfilezilla-0.11.2/lib/buffer.cpp 2018-01-05 11:43:06.000000000 +0100 +++ new/libfilezilla-0.12.1/lib/buffer.cpp 2018-02-23 09:29:01.000000000 +0100 @@ -53,7 +53,7 @@ pos_ = data; } } - return data_; + return pos_ + size_; } buffer& buffer::operator=(buffer const& buf) @@ -150,4 +150,17 @@ pos_ = data_; } +bool buffer::operator==(buffer const& rhs) const +{ + if (size() != rhs.size()) { + return false; + } + + if (!size()) { + return true; + } + + return memcmp(get(), rhs.get(), size()) == 0; +} + } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfilezilla-0.11.2/lib/libfilezilla/buffer.hpp new/libfilezilla-0.12.1/lib/libfilezilla/buffer.hpp --- old/libfilezilla-0.11.2/lib/libfilezilla/buffer.hpp 2018-01-05 11:43:06.000000000 +0100 +++ new/libfilezilla-0.12.1/lib/libfilezilla/buffer.hpp 2018-02-23 09:29:01.000000000 +0100 @@ -15,6 +15,10 @@ * * This class is useful when buffering data for sending over the network, or for buffering data for further * piecemeal processing after having received it. + * + * In general, copying/moving data around is expensive and allocations are even more expensive. Using this + * class helps to limit both to the bare minimum. + * */ class FZ_PUBLIC_SYMBOL buffer final { @@ -32,16 +36,31 @@ buffer& operator=(buffer const& buf); buffer& operator=(buffer && buf); - // Undefined if buffer is empty + /// Undefined if buffer is empty + unsigned char const* get() const { return pos_; } unsigned char* get() { return pos_; } /** \brief Returns a writable buffer guaranteed to be large enough for write_size bytes, call add when done. * + * The returned pointer is pointing just after the data already stored in the buffer. + + * Calling this function does not does not affect size(). + * \sa append + * + * \par Example: + * \code + * fz::buffer buf; + * size_t to_read = 44; + * int read = recv(fd, buf.get(to_read), to_read, 0); // Read stuff from some socket + * if (read > 0) + * buf.add(read); // Adjust size with the amount actually written into the buffer + * \endcode + * */ unsigned char* get(size_t write_size); - // Increase size by the passed amount. Call this after having obtained a writable buffer with get(size_t write_size) + /// Increase size by the passed amount. Call this after having obtained a writable buffer with get(size_t write_size) void add(size_t added); /** \brief Removes consumed bytes from the beginning of the buffer. @@ -59,7 +78,7 @@ /** \brief Appends the passed data to the buffer. * - * The number of reallocations as result to repeated append are armortized O(1) + * The number of reallocations as result to repeated append are amortized O(1) */ void append(unsigned char const* data, size_t len); void append(std::string const& str); @@ -74,6 +93,12 @@ /// Gets element at offset i. Does not do bounds checking unsigned char operator[](size_t i) const { return pos_[i]; } unsigned char & operator[](size_t i) { return pos_[i]; } + + bool operator==(buffer const& rhs) const; + + bool operator!=(buffer const& rhs) const { + return !(*this == rhs); + } private: // Invariants: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfilezilla-0.11.2/lib/libfilezilla/string.hpp new/libfilezilla-0.12.1/lib/libfilezilla/string.hpp --- old/libfilezilla-0.11.2/lib/libfilezilla/string.hpp 2018-01-05 11:43:06.000000000 +0100 +++ new/libfilezilla-0.12.1/lib/libfilezilla/string.hpp 2018-02-16 12:47:48.000000000 +0100 @@ -345,12 +345,12 @@ } template<typename String> -String ltrimmed(String const& s, String const& chars = fzS(typename String::value_type, " \r\n\t"), bool fromLeft = true, bool fromRight = true) { +String ltrimmed(String const& s, String const& chars = fzS(typename String::value_type, " \r\n\t")) { return trimmed(s, chars, true, false); } template<typename String> -String rtrimmed(String const& s, String const& chars = fzS(typename String::value_type, " \r\n\t"), bool fromLeft = true, bool fromRight = true) { +String rtrimmed(String const& s, String const& chars = fzS(typename String::value_type, " \r\n\t")) { return trimmed(s, chars, false, true); } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfilezilla-0.11.2/lib/libfilezilla/time.hpp new/libfilezilla-0.12.1/lib/libfilezilla/time.hpp --- old/libfilezilla-0.11.2/lib/libfilezilla/time.hpp 2016-01-31 11:35:01.000000000 +0100 +++ new/libfilezilla-0.12.1/lib/libfilezilla/time.hpp 2018-02-23 09:29:01.000000000 +0100 @@ -87,6 +87,10 @@ /// \return \c true if no timestamp has been set bool empty() const; + explicit operator bool() const { + return !empty(); + } + /// Resulting timestamp is empty() void clear(); @@ -187,6 +191,8 @@ /** Format time as string * * \param format is a format string as understood by ::strftime + * + * Note that some format specifiers are locale-dependent. */ std::string format(std::string const& format, zone z) const; std::wstring format(std::wstring const& format, zone z) const; @@ -205,7 +211,10 @@ /// Get timestamp as time_t, seconds since 1970-01-01 00:00:00 time_t get_time_t() const; - /// Get timestamp as struct tm + /** \brief Get timestamp as struct tm + * + * Undefined if datetime is empty. + */ tm get_tm(zone z) const; #ifdef FZ_WINDOWS @@ -213,6 +222,32 @@ FILETIME get_filetime() const; #endif + /** + * Returns date in the format specified in RFC 822, updated by RFC 1123. + * + * \par Example: + * \li Sun, 06 Nov 1994 08:49:37 GMT + */ + std::string get_rfc822() const; + + /** + * Parses a date in the format specified in RFC 822, either original or updated by RFC 1123. + * Also supports RFC 850 and ANSI C asctime formats. + * + * Used timezone is always UTC. + * + * On errors, object gets clears + * + * \return whether setting the timestamp succeeded. On failure object gets cleared. + * + * \par Examples: + * Sun, 06 Nov 1994 08:49:37 GMT // RFC 822, updated by RFC 1123\n + * Sun, 06-Nov-94 08:49:37 GMT // obsolete RFC 850\n + * Sun Nov 6 08:49:37 1994 // ANSI C asctime\n + */ + bool set_rfc822(std::string const& str); + bool set_rfc822(std::wstring const& str); + private: int FZ_PRIVATE_SYMBOL compare_slow(datetime const& op) const; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfilezilla-0.11.2/lib/libfilezilla/uri.hpp new/libfilezilla-0.12.1/lib/libfilezilla/uri.hpp --- old/libfilezilla-0.11.2/lib/libfilezilla/uri.hpp 2017-07-10 19:43:37.000000000 +0200 +++ new/libfilezilla-0.12.1/lib/libfilezilla/uri.hpp 2018-02-16 12:47:48.000000000 +0100 @@ -58,13 +58,23 @@ unsigned short port_{}; std::string path_; - /// THe part of a URI after ? but before # + /** + * \brief The part of a URI after ? but before # + * + * The query string is not encoded when building the URI, neither is it decoded when parsing a URI. + * + * \sa \c fz::query_string + */ std::string query_; - /// The part of a URI after # + /** + * \brief The part of a URI after # + * + * The fragment is not encoded when building the URI, neither is it decoded when parsing a URI. + */ std::string fragment_; - /// \brief Checks that the URI is absolut, that is the path starting with a slash. + /// \brief Checks that the URI is absolute, that is the path starting with a slash. bool is_absolute() const { return path_[0] == '/'; } /** @@ -80,7 +90,7 @@ /** * \brief Class for parsing a URI's query string. * - * Assumes the usual semantivs of key-value pairs separated by ampersands. + * Assumes the usual semantics of key-value pairs separated by ampersands. */ class FZ_PUBLIC_SYMBOL query_string final { diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfilezilla-0.11.2/lib/libfilezilla/version.hpp new/libfilezilla-0.12.1/lib/libfilezilla/version.hpp --- old/libfilezilla-0.11.2/lib/libfilezilla/version.hpp 2018-01-05 11:43:24.000000000 +0100 +++ new/libfilezilla-0.12.1/lib/libfilezilla/version.hpp 2018-02-23 09:29:14.000000000 +0100 @@ -9,15 +9,15 @@ #include <tuple> /// \brief Version string of the libfilezilla headers -#define LIBFILEZILLA_VERSION "0.11.2" +#define LIBFILEZILLA_VERSION "0.12.1" #define LIBFILEZILLA_VERSION_MAJOR 0 -#define LIBFILEZILLA_VERSION_MINOR 11 -#define LIBFILEZILLA_VERSION_MICRO 2 +#define LIBFILEZILLA_VERSION_MINOR 12 +#define LIBFILEZILLA_VERSION_MICRO 1 #define LIBFILEZILLA_VERSION_NANO 0 /// \brief Suffix string, e.g. "rc1" -#define LIBFILEZILLA_VERSION_SUFFIX "0.11.2" +#define LIBFILEZILLA_VERSION_SUFFIX "0.12.1" namespace fz { /// \brief Get version string of libfilezilla diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfilezilla-0.11.2/lib/time.cpp new/libfilezilla-0.12.1/lib/time.cpp --- old/libfilezilla-0.11.2/lib/time.cpp 2017-09-29 10:41:58.000000000 +0200 +++ new/libfilezilla-0.12.1/lib/time.cpp 2018-02-16 12:47:48.000000000 +0100 @@ -1,5 +1,7 @@ #include "libfilezilla/time.hpp" +#include "libfilezilla/format.hpp" + #ifndef FZ_WINDOWS #include <errno.h> #include <sys/time.h> @@ -769,4 +771,91 @@ #endif +std::string datetime::get_rfc822() const +{ + if (empty()) { + return std::string(); + } + tm const t = get_tm(datetime::zone::utc); + if (t.tm_wday < 0 || t.tm_wday > 6 || t.tm_mon < 0 || t.tm_mon > 11) { + return std::string(); + } + + static const char* months[] = { "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" }; + static const char* wdays[] = { "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" }; + + return sprintf("%s, %02d %s %d %02d:%02d:%02d GMT", wdays[t.tm_wday], t.tm_mday, months[t.tm_mon], t.tm_year + 1900, + t.tm_hour, t.tm_min, t.tm_sec); +} + +namespace { +template<typename String> +bool do_set_rfc822(datetime& dt, String const& str) +{ + auto tokens = strtok(str, fzS(typename String::value_type, ", :-")); + if (tokens.size() >= 7) { + auto getMonth = [](String const& m) { + if (m == fzS(typename String::value_type, "Jan")) return 1; + if (m == fzS(typename String::value_type, "Feb")) return 2; + if (m == fzS(typename String::value_type, "Mar")) return 3; + if (m == fzS(typename String::value_type, "Apr")) return 4; + if (m == fzS(typename String::value_type, "May")) return 5; + if (m == fzS(typename String::value_type, "Jun")) return 6; + if (m == fzS(typename String::value_type, "Jul")) return 7; + if (m == fzS(typename String::value_type, "Aug")) return 8; + if (m == fzS(typename String::value_type, "Sep")) return 9; + if (m == fzS(typename String::value_type, "Oct")) return 10; + if (m == fzS(typename String::value_type, "Nov")) return 11; + if (m == fzS(typename String::value_type, "Dec")) return 12; + return 0; + }; + + int day = to_integral<int>(tokens[1]); + int month; + if (!day) { + day = to_integral<int>(tokens[2]); + month = getMonth(tokens[1]); + } + else { + month = getMonth(tokens[2]); + } + + int year = to_integral<int>(tokens[6]); + int hour; + int minute; + int second; + if (year < 1000) { + year = to_integral<int>(tokens[3]); + if (year < 1000) { + year += 1900; + } + hour = to_integral<int>(tokens[4]); + minute = to_integral<int>(tokens[5]); + second = to_integral<int>(tokens[6]); + } + else { + hour = to_integral<int>(tokens[3]); + minute = to_integral<int>(tokens[4]); + second = to_integral<int>(tokens[5]); + } + + return dt.set(datetime::utc, year, month, day, hour, minute, second); + } + else { + dt.clear(); + return false; + } +} +} + +bool datetime::set_rfc822(std::string const& str) +{ + return do_set_rfc822(*this, str); +} + +bool datetime::set_rfc822(std::wstring const& str) +{ + return do_set_rfc822(*this, str); +} + } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfilezilla-0.11.2/tests/Makefile.am new/libfilezilla-0.12.1/tests/Makefile.am --- old/libfilezilla-0.11.2/tests/Makefile.am 2016-07-05 09:30:27.000000000 +0200 +++ new/libfilezilla-0.12.1/tests/Makefile.am 2018-02-23 09:29:01.000000000 +0100 @@ -4,6 +4,7 @@ check_PROGRAMS = $(TESTS) test_SOURCES = test.cpp \ + buffer.cpp \ dispatch.cpp \ eventloop.cpp \ format.cpp \ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfilezilla-0.11.2/tests/Makefile.in new/libfilezilla-0.12.1/tests/Makefile.in --- old/libfilezilla-0.11.2/tests/Makefile.in 2018-01-05 11:43:22.000000000 +0100 +++ new/libfilezilla-0.12.1/tests/Makefile.in 2018-02-23 09:29:11.000000000 +0100 @@ -118,10 +118,11 @@ CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__EXEEXT_1 = test$(EXEEXT) -am_test_OBJECTS = test-test.$(OBJEXT) test-dispatch.$(OBJEXT) \ - test-eventloop.$(OBJEXT) test-format.$(OBJEXT) \ - test-iputils.$(OBJEXT) test-smart_pointer.$(OBJEXT) \ - test-string.$(OBJEXT) test-time.$(OBJEXT) +am_test_OBJECTS = test-test.$(OBJEXT) test-buffer.$(OBJEXT) \ + test-dispatch.$(OBJEXT) test-eventloop.$(OBJEXT) \ + test-format.$(OBJEXT) test-iputils.$(OBJEXT) \ + test-smart_pointer.$(OBJEXT) test-string.$(OBJEXT) \ + test-time.$(OBJEXT) test_OBJECTS = $(am_test_OBJECTS) am__DEPENDENCIES_1 = AM_V_lt = $(am__v_lt_@AM_V@) @@ -559,6 +560,7 @@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ test_SOURCES = test.cpp \ + buffer.cpp \ dispatch.cpp \ eventloop.cpp \ format.cpp \ @@ -625,6 +627,7 @@ distclean-compile: -rm -f *.tab.c +@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-buffer.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-dispatch.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-eventloop.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/test-format.Po@am__quote@ @@ -669,6 +672,20 @@ @AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test-test.obj `if test -f 'test.cpp'; then $(CYGPATH_W) 'test.cpp'; else $(CYGPATH_W) '$(srcdir)/test.cpp'; fi` +test-buffer.o: buffer.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test-buffer.o -MD -MP -MF $(DEPDIR)/test-buffer.Tpo -c -o test-buffer.o `test -f 'buffer.cpp' || echo '$(srcdir)/'`buffer.cpp +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test-buffer.Tpo $(DEPDIR)/test-buffer.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='buffer.cpp' object='test-buffer.o' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test-buffer.o `test -f 'buffer.cpp' || echo '$(srcdir)/'`buffer.cpp + +test-buffer.obj: buffer.cpp +@am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test-buffer.obj -MD -MP -MF $(DEPDIR)/test-buffer.Tpo -c -o test-buffer.obj `if test -f 'buffer.cpp'; then $(CYGPATH_W) 'buffer.cpp'; else $(CYGPATH_W) '$(srcdir)/buffer.cpp'; fi` +@am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test-buffer.Tpo $(DEPDIR)/test-buffer.Po +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ $(AM_V_CXX)source='buffer.cpp' object='test-buffer.obj' libtool=no @AMDEPBACKSLASH@ +@AMDEP_TRUE@@am__fastdepCXX_FALSE@ DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@ +@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o test-buffer.obj `if test -f 'buffer.cpp'; then $(CYGPATH_W) 'buffer.cpp'; else $(CYGPATH_W) '$(srcdir)/buffer.cpp'; fi` + test-dispatch.o: dispatch.cpp @am__fastdepCXX_TRUE@ $(AM_V_CXX)$(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(test_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT test-dispatch.o -MD -MP -MF $(DEPDIR)/test-dispatch.Tpo -c -o test-dispatch.o `test -f 'dispatch.cpp' || echo '$(srcdir)/'`dispatch.cpp @am__fastdepCXX_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/test-dispatch.Tpo $(DEPDIR)/test-dispatch.Po diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfilezilla-0.11.2/tests/buffer.cpp new/libfilezilla-0.12.1/tests/buffer.cpp --- old/libfilezilla-0.11.2/tests/buffer.cpp 1970-01-01 01:00:00.000000000 +0100 +++ new/libfilezilla-0.12.1/tests/buffer.cpp 2018-02-23 09:29:01.000000000 +0100 @@ -0,0 +1,40 @@ +#include "libfilezilla/buffer.hpp" + +#include "test_utils.hpp" + +#include <string.h> + +class buffer_test final : public CppUnit::TestFixture +{ + CPPUNIT_TEST_SUITE(buffer_test); + CPPUNIT_TEST(test_simple); + CPPUNIT_TEST_SUITE_END(); + +public: + void setUp() {} + void tearDown() {} + + void test_simple(); +}; + +CPPUNIT_TEST_SUITE_REGISTRATION(buffer_test); + +void buffer_test::test_simple() +{ + fz::buffer buf; + buf.append("foo"); + buf.append("bar"); + + ASSERT_EQUAL(size_t(6), buf.size()); + + buf.consume(3); + buf.append("baz"); + + ASSERT_EQUAL(size_t(6), buf.size()); + + fz::buffer buf2; + memcpy(buf2.get(42), "barbaz", 6); + buf2.add(6); + + CPPUNIT_ASSERT(buf == buf2); +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/libfilezilla-0.11.2/tests/smart_pointer.cpp new/libfilezilla-0.12.1/tests/smart_pointer.cpp --- old/libfilezilla-0.11.2/tests/smart_pointer.cpp 2017-02-20 22:19:51.000000000 +0100 +++ new/libfilezilla-0.12.1/tests/smart_pointer.cpp 2018-02-23 09:29:01.000000000 +0100 @@ -4,7 +4,7 @@ #include "test_utils.hpp" /* * This testsuite asserts the correctness of the - * functions handling IP addresses + * smart pointer classes */ class smart_pointer_test final : public CppUnit::TestFixture