libqtdbusmock-0.2+14.04.20140304/0000755000015201777760000000000012305262522016607 5ustar pbusernogroup00000000000000libqtdbusmock-0.2+14.04.20140304/cmake/0000755000015201777760000000000012305262522017667 5ustar pbusernogroup00000000000000libqtdbusmock-0.2+14.04.20140304/cmake/COPYING-CMAKE-SCRIPTS0000644000015201777760000000245712305262310022670 0ustar pbusernogroup00000000000000Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. libqtdbusmock-0.2+14.04.20140304/cmake/FindValgrind.cmake0000644000015201777760000000132512305262310023234 0ustar pbusernogroup00000000000000 option( ENABLE_MEMCHECK_OPTION "If set to ON, enables automatic creation of memcheck targets" OFF ) find_program( VALGRIND_PROGRAM NAMES valgrind ) if(VALGRIND_PROGRAM) set(VALGRIND_PROGRAM_OPTIONS "--suppressions=${CMAKE_SOURCE_DIR}/tests/data/valgrind.suppression" "--error-exitcode=1" "--leak-check=full" "--gen-suppressions=all" "--quiet" ) endif() find_package_handle_standard_args( VALGRIND DEFAULT_MSG VALGRIND_PROGRAM ) function(add_valgrind_test NAME EXECUTABLE) if(ENABLE_MEMCHECK_OPTION AND VALGRIND_PROGRAM) add_test(${NAME} ${VALGRIND_PROGRAM} ${VALGRIND_PROGRAM_OPTIONS} "${CMAKE_CURRENT_BINARY_DIR}/${EXECUTABLE}") else() add_test(${NAME} ${EXECUTABLE}) endif() endfunction() libqtdbusmock-0.2+14.04.20140304/cmake/FindGMock.cmake0000644000015201777760000000076612305262310022476 0ustar pbusernogroup00000000000000# Build with system gmock and embedded gtest set (GMOCK_INCLUDE_DIRS "/usr/include/gmock/include" CACHE PATH "gmock source include directory") set (GMOCK_SOURCE_DIR "/usr/src/gmock" CACHE PATH "gmock source directory") set (GTEST_INCLUDE_DIRS "${GMOCK_SOURCE_DIR}/gtest/include" CACHE PATH "gtest source include directory") add_subdirectory(${GMOCK_SOURCE_DIR} "${CMAKE_CURRENT_BINARY_DIR}/gmock") set(GTEST_LIBRARIES gtest) set(GTEST_MAIN_LIBRARIES gtest_main) set(GMOCK_LIBRARIES gmock gmock_main) libqtdbusmock-0.2+14.04.20140304/cmake/Coverage.cmake0000644000015201777760000000422612305262310022423 0ustar pbusernogroup00000000000000if (CMAKE_BUILD_TYPE MATCHES coverage) set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --coverage") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} --coverage") set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} --coverage") set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} --coverage") find_program(GCOVR_EXECUTABLE gcovr HINTS ${GCOVR_ROOT} "${GCOVR_ROOT}/bin") if (NOT GCOVR_EXECUTABLE) message(STATUS "Gcovr binary was not found, can not generate XML coverage info.") else () message(STATUS "Gcovr found, can generate XML coverage info.") add_custom_target (coverage-xml WORKING_DIRECTORY ${CMAKE_BINARY_DIR} COMMAND "${GCOVR_EXECUTABLE}" --exclude="test.*" --exclude="obj.*" -x -r "${CMAKE_SOURCE_DIR}" --object-directory=${CMAKE_BINARY_DIR} -o coverage.xml) endif() find_program(LCOV_EXECUTABLE lcov HINTS ${LCOV_ROOT} "${GCOVR_ROOT}/bin") find_program(GENHTML_EXECUTABLE genhtml HINTS ${GENHTML_ROOT}) if (NOT LCOV_EXECUTABLE) message(STATUS "Lcov binary was not found, can not generate HTML coverage info.") else () if(NOT GENHTML_EXECUTABLE) message(STATUS "Genthml binary not found, can not generate HTML coverage info.") else() message(STATUS "Lcov and genhtml found, can generate HTML coverage info.") add_custom_target (coverage-html WORKING_DIRECTORY ${CMAKE_BINARY_DIR} COMMAND "${LCOV_EXECUTABLE}" --capture --output-file "${CMAKE_BINARY_DIR}/coverage.info" --no-checksum --directory "${CMAKE_BINARY_DIR}/src" COMMAND "${LCOV_EXECUTABLE}" --remove "${CMAKE_BINARY_DIR}/coverage.info" '/usr/*' --output-file "${CMAKE_BINARY_DIR}/coverage.info" COMMAND "${LCOV_EXECUTABLE}" --remove "${CMAKE_BINARY_DIR}/coverage.info" '${CMAKE_BINARY_DIR}/*' --output-file "${CMAKE_BINARY_DIR}/coverage.info" COMMAND "${LCOV_EXECUTABLE}" --remove "${CMAKE_BINARY_DIR}/coverage.info" '${CMAKE_SOURCE_DIR}/tests/*' --output-file "${CMAKE_BINARY_DIR}/coverage.info" COMMAND "${GENHTML_EXECUTABLE}" --prefix "${CMAKE_BINARY_DIR}" --output-directory coveragereport --title "Code Coverage" --legend --show-details coverage.info ) endif() endif() endif() libqtdbusmock-0.2+14.04.20140304/tests/0000755000015201777760000000000012305262522017751 5ustar pbusernogroup00000000000000libqtdbusmock-0.2+14.04.20140304/tests/CMakeLists.txt0000644000015201777760000000106312305262310022504 0ustar pbusernogroup00000000000000 set(CMAKE_AUTOMOC OFF) include(FindGMock) set(CMAKE_AUTOMOC ON) find_package("Valgrind" REQUIRED) include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories(${GMOCK_INCLUDE_DIRS}) include_directories(${GTEST_INCLUDE_DIRS}) set( UNIT_TESTS_SRC main.cpp libqtdbusmock/TestDBusMock.cpp ) add_executable( unit-tests ${UNIT_TESTS_SRC} ) qt5_use_modules( unit-tests Core DBus Test ) target_link_libraries( unit-tests qtdbusmock ${QTDBUSTEST_LIBRARIES} ${GTEST_LIBRARIES} ${GMOCK_LIBRARIES} ) add_valgrind_test( unit-tests unit-tests ) libqtdbusmock-0.2+14.04.20140304/tests/libqtdbusmock/0000755000015201777760000000000012305262522022614 5ustar pbusernogroup00000000000000libqtdbusmock-0.2+14.04.20140304/tests/libqtdbusmock/TestDBusMock.cpp0000644000015201777760000001571012305262310025626 0ustar pbusernogroup00000000000000/* * Copyright (C) 2013 Canonical, Ltd. * * This library is free software; you can redistribute it and/or modify it under * the terms of version 3 of the GNU Lesser General Public License as published * by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . * * Author: Pete Woods */ #include #include #include #include #include using namespace std; using namespace testing; using namespace QtDBusTest; using namespace QtDBusMock; namespace { class TestDBusMock: public Test { protected: TestDBusMock() : dbusMock(dbusTestRunner) { } virtual ~TestDBusMock() { } bool processListContains(const char *str) { QProcess pgrep; pgrep.start("ps", QStringList() << "--no-headers" << "--ppid" << QString::number(QCoreApplication::applicationPid()) << "-o" << "args"); pgrep.waitForFinished(); pgrep.waitForReadyRead(); return pgrep.readAll().contains(str); } DBusTestRunner dbusTestRunner; DBusMock dbusMock; }; TEST_F(TestDBusMock, StartsDBusMockSession) { dbusMock.registerCustomMock("test.name", "/test/object", "test.Interface", QDBusConnection::SessionBus); dbusTestRunner.startServices(); EXPECT_TRUE( processListContains( "python3 -m dbusmock test.name /test/object test.Interface")); } TEST_F(TestDBusMock, StartsDBusMockSystem) { dbusMock.registerCustomMock("test.name2", "/test/object2", "test.Interface2", QDBusConnection::SystemBus); dbusTestRunner.startServices(); EXPECT_TRUE( processListContains( "python3 -m dbusmock -s test.name2 /test/object2 test.Interface2")); } TEST_F(TestDBusMock, StartsDBusMockWithTemplate) { dbusMock.registerNetworkManager(); dbusTestRunner.startServices(); EXPECT_TRUE( processListContains( "python3 -m dbusmock --template networkmanager")); NetworkManagerMockInterface &networkManager( dbusMock.networkManagerInterface()); networkManager.AddWiFiDevice("device", "eth1", NM_STATE_DISCONNECTED).waitForFinished(); // OrgFreedesktopDBusMockInterface &networkManagerMock( // dbusMock.mockInterface(NM_DBUS_SERVICE, NM_DBUS_PATH, // NM_DBUS_INTERFACE, QDBusConnection::SystemBus)); // QList methodCalls( // networkManagerMock.GetMethodCalls("AddWiFiDevice")); // ASSERT_EQ(1, methodCalls.size()); // ASSERT_EQ(3, methodCalls.first().args().size()); } TEST_F(TestDBusMock, GetMethodCalls) { dbusMock.registerCustomMock("test.name", "/test/path", "test.interface", QDBusConnection::SessionBus); dbusTestRunner.startServices(); OrgFreedesktopDBusMockInterface &mockInterface( dbusMock.mockInterface("test.name", "/test/path", "test.interface", QDBusConnection::SessionBus)); mockInterface.AddMethod("test.interface", "MethodName", "s", "s", "ret = 'output'").waitForFinished(); QDBusMessage message( QDBusMessage::createMethodCall("test.name", "/test/path", "test.interface", "MethodName")); message.setArguments(QVariantList() << QVariant("input")); QDBusMessage reply(dbusTestRunner.sessionConnection().call(message)); ASSERT_EQ(1, reply.arguments().size()); EXPECT_EQ("output", reply.arguments().first().toString().toStdString()); QList methodCalls(mockInterface.GetMethodCalls("MethodName")); ASSERT_EQ(1, methodCalls.size()); MethodCall call; call = methodCalls.first(); ASSERT_EQ(1, call.args().size()); EXPECT_EQ("input", call.args().first().toString().toStdString()); } TEST_F(TestDBusMock, GetAllMethodCalls) { dbusMock.registerCustomMock("test.name", "/test/path", "test.interface", QDBusConnection::SessionBus); dbusTestRunner.startServices(); OrgFreedesktopDBusMockInterface &mockInterface( dbusMock.mockInterface("test.name", "/test/path", "test.interface", QDBusConnection::SessionBus)); mockInterface.AddMethod("test.interface", "MethodName", "s", "s", "ret = 'output'").waitForFinished(); QDBusMessage message( QDBusMessage::createMethodCall("test.name", "/test/path", "test.interface", "MethodName")); message.setArguments(QVariantList() << QVariant("input")); QDBusMessage reply(dbusTestRunner.sessionConnection().call(message)); ASSERT_EQ(1, reply.arguments().size()); EXPECT_EQ("output", reply.arguments().first().toString().toStdString()); QList methodCalls(mockInterface.GetCalls()); ASSERT_EQ(1, methodCalls.size()); NamedMethodCall call; call = methodCalls.first(); EXPECT_EQ("MethodName", call.methodName().toStdString()); ASSERT_EQ(1, call.args().size()); EXPECT_EQ("input", call.args().first().toString().toStdString()); } TEST_F(TestDBusMock, AddMethods) { dbusMock.registerCustomMock("test.name", "/test/path", "test.interface", QDBusConnection::SessionBus); dbusTestRunner.startServices(); OrgFreedesktopDBusMockInterface &mockInterface( dbusMock.mockInterface("test.name", "/test/path", "test.interface", QDBusConnection::SessionBus)); Method method1; method1.setName("MethodName1"); method1.setInSig("s"); method1.setOutSig("s"); method1.setCode("ret = 'output1'"); Method methodTemp; methodTemp.setName("MethodName2"); methodTemp.setInSig("u"); methodTemp.setOutSig("s"); methodTemp.setCode("ret = 'output2'"); Method method2; method2 = methodTemp; mockInterface.AddMethods("test.interface", QList() << method1 << method2).waitForFinished(); { QDBusMessage message( QDBusMessage::createMethodCall("test.name", "/test/path", "test.interface", "MethodName1")); message.setArguments(QVariantList() << QVariant("input")); QDBusMessage reply(dbusTestRunner.sessionConnection().call(message)); ASSERT_EQ(1, reply.arguments().size()); EXPECT_EQ("output1", reply.arguments().first().toString().toStdString()); } { QDBusMessage message( QDBusMessage::createMethodCall("test.name", "/test/path", "test.interface", "MethodName2")); message.setArguments(QVariantList() << QVariant(123)); QDBusMessage reply(dbusTestRunner.sessionConnection().call(message)); ASSERT_EQ(1, reply.arguments().size()); EXPECT_EQ("output2", reply.arguments().first().toString().toStdString()); } QList methodCalls(mockInterface.GetCalls()); ASSERT_EQ(2, methodCalls.size()); { NamedMethodCall call; call = methodCalls.first(); EXPECT_EQ("MethodName1", call.methodName().toStdString()); ASSERT_EQ(1, call.args().size()); EXPECT_EQ("input", call.args().first().toString().toStdString()); } { NamedMethodCall call; call = methodCalls[1]; EXPECT_EQ("MethodName2", call.methodName().toStdString()); ASSERT_EQ(1, call.args().size()); EXPECT_EQ(123, call.args().first().toUInt()); } } } // namespace libqtdbusmock-0.2+14.04.20140304/tests/main.cpp0000644000015201777760000000234612305262310021401 0ustar pbusernogroup00000000000000/* * Copyright (C) 2013 Canonical, Ltd. * * This library is free software; you can redistribute it and/or modify it under * the terms of version 3 of the GNU Lesser General Public License as published * by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . * * Author: Pete Woods */ #include #include #include #include using namespace QtDBusMock; int main(int argc, char **argv) { // qputenv("LANG", "C.UTF-8"); // unsetenv("LC_ALL"); // setlocale(LC_ALL, ""); // bindtextdomain(GETTEXT_PACKAGE, LOCALE_DIR); // textdomain(GETTEXT_PACKAGE); QCoreApplication application(argc, argv); DBusMock::registerMetaTypes(); ::testing::InitGoogleTest(&argc, argv); return RUN_ALL_TESTS(); } libqtdbusmock-0.2+14.04.20140304/tests/data/0000755000015201777760000000000012305262522020662 5ustar pbusernogroup00000000000000libqtdbusmock-0.2+14.04.20140304/tests/data/valgrind.suppression0000644000015201777760000000154412305262310025003 0ustar pbusernogroup00000000000000{ Ignore pthreads Memcheck:Leak ... fun:pthread_create@@* } { Glib memalign Memcheck:Leak ... fun:posix_memalign } { Ignore glib mainloop Memcheck:Leak ... fun:g_main_context_push_thread_default } { Ignore glib main context Memcheck:Leak ... fun:g_main_context_new } { False positive leak on strings in i386 Memcheck:Leak fun:_Znwj fun:_ZNSs4_Rep9_S_createEjjRKSaIcE ... fun:_ZN7testing14InitGoogleTestEPiPPc fun:(below main) } { False positive leak on strings on i386 Memcheck:Leak fun:_Znwj fun:_ZNSs4_Rep9_S_createEjjRKSaIcE ... fun:__libc_csu_init fun:(below main) } { Qt apparently has some statically allocated data here Memcheck:Leak fun:calloc fun:allocate_dtv fun:_ZN7QThread5startENS_8PriorityE obj:/usr/lib/*/libQt5Core.so.* ... obj:* } libqtdbusmock-0.2+14.04.20140304/CMakeLists.txt0000644000015201777760000000367712305262310021357 0ustar pbusernogroup00000000000000project(libqtdbusmock CXX) cmake_minimum_required(VERSION 2.8.9) set(API_VERSION 1) set(ABI_VERSION 1) set(GETTEXT_PACKAGE libqtdbusmock) set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" "${CMAKE_MODULE_PATH}") find_package(PkgConfig REQUIRED) find_package(Qt5Core REQUIRED) include_directories(${Qt5Core_INCLUDE_DIRS}) find_package(Qt5DBus COMPONENTS Qt5DBusMacros REQUIRED) include_directories(${Qt5DBus_INCLUDE_DIRS}) find_package(Qt5Test REQUIRED) include_directories(${Qt5Test_INCLUDE_DIRS}) pkg_check_modules(QTDBUSTEST REQUIRED libqtdbustest-1 REQUIRED) include_directories(${QTDBUSTEST_INCLUDE_DIRS}) pkg_check_modules(NM REQUIRED NetworkManager REQUIRED) include_directories(${NM_INCLUDE_DIRS}) set(CMAKE_AUTOMOC ON) set(CMAKE_INCLUDE_CURRENT_DIR ON) set(DATA_DIR "${CMAKE_SOURCE_DIR}/data") set(SOURCE_DIR "${CMAKE_SOURCE_DIR}/src") set(SOURCE_BINARY_DIR "${CMAKE_BINARY_DIR}/src") include_directories(${SOURCE_DIR}) include_directories(${SOURCE_BINARY_DIR}) include(GNUInstallDirs) include(Coverage) # Workaround for libexecdir on debian if (EXISTS "/etc/debian_version") set(CMAKE_INSTALL_LIBEXECDIR ${CMAKE_INSTALL_LIBDIR}) set(CMAKE_INSTALL_FULL_LIBEXECDIR "${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBEXECDIR}") endif() set(LOCALE_DIR "${CMAKE_INSTALL_FULL_DATADIR}/locale") add_definitions( -std=c++11 -fno-permissive -pedantic -Wall -Wextra ) #set(DOXYFILE_SOURCE_DIR "include") #set(DOXYFILE_EXTRA_SOURCES "doc") #include(UseDoxygen) #if(DOXYGEN_FOUND AND BUILD_DOXYGEN) # install( # DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/doc/html # DESTINATION ${CMAKE_INSTALL_PREFIX}/share/doc/libusermetrics-doc/ # ) #endif() configure_file( "${SOURCE_DIR}/libqtdbusmock/config.h.in" "${SOURCE_BINARY_DIR}/libqtdbusmock/config.h" ) #add_subdirectory("po") add_subdirectory("src") add_subdirectory("data") enable_testing() add_subdirectory(tests) ADD_CUSTOM_TARGET( check ${CMAKE_CTEST_COMMAND} --force-new-ctest-process --output-on-failure ) libqtdbusmock-0.2+14.04.20140304/build.sh0000755000015201777760000000267412305262310020251 0ustar pbusernogroup00000000000000#! /bin/bash set -e ECLIPSE=false CLEAN=false SOURCEDIR="$PWD" BRANCHNAME=`basename $SOURCEDIR` BUILDDIR="$SOURCEDIR/../$BRANCHNAME-build" usage() { echo "usage: $0 [OPTIONS] [BUILD_TYPE]\n" >&2 echo "Script to build libqtdbusmock. If BUILD_TYPE is not specified, it defaults to \"Debug\".\n" >&2 echo "OPTIONS:" >&2 echo " -e, --eclipse Generate Eclipse projects" >&2 echo " -c, --clean Clean the build tree before building" >&2 echo >&2 exit 1 } ARGS=`getopt -n$0 -u -a --longoptions="eclipse,clean,help" -o "sch" -- "$@"` [ $? -ne 0 ] && usage eval set -- "$ARGS" while [ $# -gt 0 ] do case "$1" in -e|--eclipse) ECLIPSE=true;; -c|--clean) CLEAN=true;; -h|--help) usage;; --) shift;break;; esac shift done [ $# -gt 1 ] && usage BUILD_TYPE="Debug" [ $# -eq 1 ] && BUILD_TYPE="$1" if [ -f "/usr/bin/ninja" ] ; then if $ECLIPSE; then GENERATOR="Eclipse CDT4 - Ninja" else GENERATOR="Ninja" fi BUILD_COMMAND="ninja" else if $ECLIPSE; then GENERATOR="Eclipse CDT4 - Unix Makefiles" else GENERATOR="Unix Makefiles" fi BUILD_COMMAND="make" fi echo "Using $BUILD_COMMAND to build" if $CLEAN; then rm -rf $BUILDDIR fi mkdir -p $BUILDDIR ( cd $BUILDDIR cmake "$SOURCEDIR" -G "$GENERATOR" \ -DCMAKE_BUILD_TYPE=$BUILD_TYPE \ -DENABLE_MEMCHECK_OPTION=YES \ -DCMAKE_INSTALL_PREFIX="$SOURCEDIR/../$BRANCHNAME-install" $BUILD_COMMAND ) libqtdbusmock-0.2+14.04.20140304/src/0000755000015201777760000000000012305262522017376 5ustar pbusernogroup00000000000000libqtdbusmock-0.2+14.04.20140304/src/CMakeLists.txt0000644000015201777760000000013212305262310022125 0ustar pbusernogroup00000000000000include(GenerateExportHeader) add_compiler_export_flags() add_subdirectory(libqtdbusmock)libqtdbusmock-0.2+14.04.20140304/src/libqtdbusmock/0000755000015201777760000000000012305262522022241 5ustar pbusernogroup00000000000000libqtdbusmock-0.2+14.04.20140304/src/libqtdbusmock/NamedMethodCall.h0000644000015201777760000000330612305262310025370 0ustar pbusernogroup00000000000000/* * Copyright (C) 2013 Canonical, Ltd. * * This library is free software; you can redistribute it and/or modify it under * the terms of version 3 of the GNU Lesser General Public License as published * by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . * * Author: Pete Woods */ #ifndef LIBQTDBUSMOCK_NAMEDMETHODCALL_H_ #define LIBQTDBUSMOCK_NAMEDMETHODCALL_H_ #include namespace QtDBusMock { class Q_DECL_EXPORT NamedMethodCall { public: explicit NamedMethodCall(); NamedMethodCall(const NamedMethodCall &other); NamedMethodCall& operator=(const NamedMethodCall &other); ~NamedMethodCall(); static void registerMetaType(); const QString & methodName() const; void setMethodName(const QString &methodName); const quint64 & timestamp() const; const QVariantList & args() const; void setTimestamp(quint64 timestamp); void setArgs(const QVariantList &args); protected: quint64 m_timestamp; QString m_methodName; QVariantList m_args; }; } Q_DECL_EXPORT QDBusArgument &operator<<(QDBusArgument &argument, const QtDBusMock::NamedMethodCall &methodCalls); Q_DECL_EXPORT const QDBusArgument &operator>>(const QDBusArgument &argument, QtDBusMock::NamedMethodCall &methodCalls); Q_DECLARE_METATYPE(QtDBusMock::NamedMethodCall) #endif // LIBQTDBUSMOCK_NAMEDMETHODCALL_H_ libqtdbusmock-0.2+14.04.20140304/src/libqtdbusmock/MethodCall.h0000644000015201777760000000303112305262310024416 0ustar pbusernogroup00000000000000/* * Copyright (C) 2013 Canonical, Ltd. * * This library is free software; you can redistribute it and/or modify it under * the terms of version 3 of the GNU Lesser General Public License as published * by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . * * Author: Pete Woods */ #ifndef LIBQTDBUSMOCK_METHODCALLS_H_ #define LIBQTDBUSMOCK_METHODCALLS_H_ #include namespace QtDBusMock { class Q_DECL_EXPORT MethodCall { public: explicit MethodCall(); MethodCall(const MethodCall &other); MethodCall& operator=(const MethodCall &other); ~MethodCall(); static void registerMetaType(); const quint64 & timestamp() const; const QVariantList & args() const; void setTimestamp(quint64 timestamp); void setArgs(const QVariantList &args); protected: quint64 m_timestamp; QVariantList m_args; }; } Q_DECL_EXPORT QDBusArgument &operator<<(QDBusArgument &argument, const QtDBusMock::MethodCall &methodCalls); Q_DECL_EXPORT const QDBusArgument &operator>>(const QDBusArgument &argument, QtDBusMock::MethodCall &methodCalls); Q_DECLARE_METATYPE(QtDBusMock::MethodCall) #endif // LIBQTDBUSMOCK_METHODCALLS_H_ libqtdbusmock-0.2+14.04.20140304/src/libqtdbusmock/libqtdbusmock.pc.in0000644000015201777760000000047212305262310026033 0ustar pbusernogroup00000000000000libdir=@CMAKE_INSTALL_FULL_LIBDIR@ includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@ Cflags: -I${includedir}/libqtdbusmock-@API_VERSION@ Requires: Qt5Core Libs: -L${libdir} -lqtdbusmock -lqtdbustest Name: libqtdbusmock Description: A library to facilitate mocking DBus services written in Qt/C++ Version: @ABI_VERSION@ libqtdbusmock-0.2+14.04.20140304/src/libqtdbusmock/MockInterfaceClasses.h0000644000015201777760000000154112305262310026436 0ustar pbusernogroup00000000000000/* * Copyright (C) 2013 Canonical, Ltd. * * This library is free software; you can redistribute it and/or modify it under * the terms of version 3 of the GNU Lesser General Public License as published * by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . * * Author: Pete Woods */ #include #include #include #include libqtdbusmock-0.2+14.04.20140304/src/libqtdbusmock/CMakeLists.txt0000644000015201777760000000371212305262310024777 0ustar pbusernogroup00000000000000 set( QTDBUSMOCK_SRC DBusMock.cpp Method.cpp MethodCall.cpp NamedMethodCall.cpp ) set( QTDBUSMOCK_PUBLIC_HEADERS "${CMAKE_CURRENT_BINARY_DIR}/config.h" DBusMock.h ExportInterfaces.h Method.h MethodCall.h MockInterfaceClasses.h NamedMethodCall.h "${CMAKE_CURRENT_BINARY_DIR}/MockInterface.h" "${CMAKE_CURRENT_BINARY_DIR}/PropertiesInterface.h" "${CMAKE_CURRENT_BINARY_DIR}/NetworkManagerMockInterface.h" ) set_source_files_properties( "${DATA_DIR}/org.freedesktop.DBus.Mock.xml" PROPERTIES NO_NAMESPACE YES INCLUDE "libqtdbusmock/MockInterfaceClasses.h" ) set_source_files_properties( "${DATA_DIR}/org.freedesktop.DBus.Properties.xml" PROPERTIES NO_NAMESPACE YES INCLUDE "libqtdbusmock/ExportInterfaces.h" ) set_source_files_properties( "${DATA_DIR}/nm-manager-mock.xml" PROPERTIES NO_NAMESPACE YES CLASSNAME NetworkManagerMockInterface INCLUDE "libqtdbusmock/ExportInterfaces.h" ) qt5_add_dbus_interface( QTDBUSMOCK_SRC "${DATA_DIR}/org.freedesktop.DBus.Mock.xml" MockInterface ) qt5_add_dbus_interface( QTDBUSMOCK_SRC "${DATA_DIR}/org.freedesktop.DBus.Properties.xml" PropertiesInterface ) qt5_add_dbus_interface( QTDBUSMOCK_SRC "${DATA_DIR}/nm-manager-mock.xml" NetworkManagerMockInterface ) add_library( qtdbusmock SHARED ${QTDBUSMOCK_SRC} ) qt5_use_modules( qtdbusmock Core DBus Test ) target_link_libraries( qtdbusmock ${QTDBUSTEST_LIBRARIES} ) set_target_properties( qtdbusmock PROPERTIES VERSION ${API_VERSION}.0.0 SOVERSION ${ABI_VERSION} PUBLIC_HEADER "${QTDBUSMOCK_PUBLIC_HEADERS}" ) install( TARGETS qtdbusmock LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} PUBLIC_HEADER DESTINATION "${CMAKE_INSTALL_INCLUDEDIR}/libqtdbusmock-${API_VERSION}/libqtdbusmock" ) # Package config set(LIBQTDBUSMOCK_PC "${CMAKE_CURRENT_BINARY_DIR}/libqtdbusmock-${API_VERSION}.pc") configure_file("libqtdbusmock.pc.in" "${LIBQTDBUSMOCK_PC}" @ONLY) install( FILES "${LIBQTDBUSMOCK_PC}" DESTINATION "${CMAKE_INSTALL_LIBDIR}/pkgconfig" ) libqtdbusmock-0.2+14.04.20140304/src/libqtdbusmock/Method.cpp0000644000015201777760000000452712305262310024170 0ustar pbusernogroup00000000000000/* * Copyright (C) 2013 Canonical, Ltd. * * This library is free software; you can redistribute it and/or modify it under * the terms of version 3 of the GNU Lesser General Public License as published * by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . * * Author: Pete Woods */ #include using namespace QtDBusMock; Method::Method() { } Method::Method(const Method &other) : m_name(other.m_name), m_inSig(other.m_inSig), m_outSig(other.m_outSig), m_code( other.m_code) { } Method& Method::operator=(const Method &other) { m_name = other.m_name; m_inSig = other.m_inSig; m_outSig = other.m_outSig; m_code = other.m_code; return *this; } Method::~Method() { } void Method::registerMetaType() { qRegisterMetaType("QtDBusMock::Method"); qDBusRegisterMetaType(); qDBusRegisterMetaType>(); } const QString & Method::name() const { return m_name; } void Method::setName(const QString &name) { m_name = name; } const QString & Method::inSig() const { return m_inSig; } void Method::setInSig(const QString &inSig) { m_inSig = inSig; } const QString & Method::outSig() const { return m_outSig; } void Method::setOutSig(const QString &outSig) { m_outSig = outSig; } const QString & Method::code() const { return m_code; } void Method::setCode(const QString &code) { m_code = code; } QDBusArgument &operator<<(QDBusArgument &argument, const Method& method) { argument.beginStructure(); argument << method.name() << method.inSig() << method.outSig() << method.code(); argument.endStructure(); return argument; } const QDBusArgument &operator>>(const QDBusArgument &argument, Method &method) { QString name; QString inSig; QString outSig; QString code; argument.beginStructure(); argument >> name >> inSig >> outSig >> code; argument.endStructure(); method.setName(name); method.setInSig(inSig); method.setOutSig(outSig); method.setCode(code); return argument; } libqtdbusmock-0.2+14.04.20140304/src/libqtdbusmock/NamedMethodCall.cpp0000644000015201777760000000500412305262310025720 0ustar pbusernogroup00000000000000/* * Copyright (C) 2013 Canonical, Ltd. * * This library is free software; you can redistribute it and/or modify it under * the terms of version 3 of the GNU Lesser General Public License as published * by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . * * Author: Pete Woods */ #include using namespace QtDBusMock; NamedMethodCall::NamedMethodCall() : m_timestamp(0) { } NamedMethodCall::NamedMethodCall(const NamedMethodCall &other) : m_timestamp(other.m_timestamp), m_methodName(other.m_methodName), m_args( other.m_args) { } NamedMethodCall& NamedMethodCall::operator=(const NamedMethodCall &other) { m_timestamp = other.m_timestamp; m_methodName = other.m_methodName; m_args = other.m_args; return *this; } NamedMethodCall::~NamedMethodCall() { } void NamedMethodCall::registerMetaType() { qRegisterMetaType("QtDBusMock::NamedMethodCall"); qDBusRegisterMetaType(); qDBusRegisterMetaType>(); } const QString & NamedMethodCall::methodName() const { return m_methodName; } const quint64 & NamedMethodCall::timestamp() const { return m_timestamp; } const QVariantList & NamedMethodCall::args() const { return m_args; } void NamedMethodCall::setMethodName(const QString &methodName) { m_methodName = methodName; } void NamedMethodCall::setTimestamp(quint64 timestamp) { m_timestamp = timestamp; } void NamedMethodCall::setArgs(const QVariantList &args) { m_args = args; } QDBusArgument &operator<<(QDBusArgument &argument, const NamedMethodCall& methodCall) { argument.beginStructure(); argument << methodCall.timestamp() << methodCall.methodName() << methodCall.args(); argument.endStructure(); return argument; } const QDBusArgument &operator>>(const QDBusArgument &argument, NamedMethodCall &methodCall) { quint64 timestamp; QString methodName; QVariantList args; argument.beginStructure(); argument >> timestamp >> methodName >> args; argument.endStructure(); methodCall.setTimestamp(timestamp); methodCall.setMethodName(methodName); methodCall.setArgs(args); return argument; } libqtdbusmock-0.2+14.04.20140304/src/libqtdbusmock/MethodCall.cpp0000644000015201777760000000651612305262310024764 0ustar pbusernogroup00000000000000/* * Copyright (C) 2013 Canonical, Ltd. * * This library is free software; you can redistribute it and/or modify it under * the terms of version 3 of the GNU Lesser General Public License as published * by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . * * Author: Pete Woods */ #include using namespace QtDBusMock; MethodCall::MethodCall() : m_timestamp(0) { } MethodCall::MethodCall(const MethodCall &other) : m_timestamp(other.m_timestamp), m_args(other.m_args) { } MethodCall& MethodCall::operator=(const MethodCall &other) { m_timestamp = other.m_timestamp; m_args = other.m_args; return *this; } MethodCall::~MethodCall() { } void MethodCall::registerMetaType() { qRegisterMetaType("QtDBusMock::MethodCall"); qDBusRegisterMetaType(); qDBusRegisterMetaType>(); } const quint64 & MethodCall::timestamp() const { return m_timestamp; } const QVariantList & MethodCall::args() const { return m_args; } void MethodCall::setTimestamp(quint64 timestamp) { m_timestamp = timestamp; } void MethodCall::setArgs(const QVariantList &args) { m_args = args; } QDBusArgument &operator<<(QDBusArgument &argument, const MethodCall& methodCall) { argument.beginStructure(); argument << methodCall.timestamp() << methodCall.args(); argument.endStructure(); return argument; } static void transform(QVariantList &list); static void transform(QVariantMap &map); static QVariant transform(const QDBusArgument & value) { switch (value.currentType()) { case QDBusArgument::ArrayType: { value.beginArray(); QVariantList list = transform(value).toList(); value.endArray(); return list; } case QDBusArgument::MapType: { QVariantMap map; value >> map; transform(map); return map; } case QDBusArgument::StructureType: { value.beginStructure(); QVariantList list; while (!value.atEnd()) { list << value.asVariant(); } value.endStructure(); return list; break; } default: qDebug() << "Unhandled type" << value.currentType() << value.currentSignature(); } return QVariant(); } static void transform(QVariant &variant) { if (variant.canConvert()) { QVariantList list = variant.toList(); transform(list); variant = list; } else if (variant.canConvert()) { QDBusArgument value(variant.value()); variant = transform(value); } } static void transform(QVariantMap &map) { for (auto it(map.begin()); it != map.end(); ++it) { transform(*it); } } static void transform(QVariantList &list) { for (auto it(list.begin()); it != list.end(); ++it) { transform(*it); } } const QDBusArgument &operator>>(const QDBusArgument &argument, MethodCall &methodCall) { quint64 timestamp; QVariantList args; argument.beginStructure(); argument >> timestamp >> args; argument.endStructure(); transform(args); methodCall.setTimestamp(timestamp); methodCall.setArgs(args); return argument; } libqtdbusmock-0.2+14.04.20140304/src/libqtdbusmock/config.h.in0000644000015201777760000000156312305262310024264 0ustar pbusernogroup00000000000000/* * Copyright (C) 2013 Canonical, Ltd. * * This library is free software; you can redistribute it and/or modify it under * the terms of version 3 of the GNU Lesser General Public License as published * by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . * * Author: Pete Woods */ #ifndef LIBQTDBUSMOCK_CONFIG_H_ #define LIBQTDBUSMOCK_CONFIG_H_ #define GETTEXT_PACKAGE "@GETTEXT_PACKAGE@" #define LOCALE_DIR "@LOCALE_DIR@" #endif // LIBQTDBUSMOCK_CONFIG_H_ libqtdbusmock-0.2+14.04.20140304/src/libqtdbusmock/DBusMock.cpp0000644000015201777760000000644612305262310024421 0ustar pbusernogroup00000000000000/* * Copyright (C) 2013 Canonical, Ltd. * * This library is free software; you can redistribute it and/or modify it under * the terms of version 3 of the GNU Lesser General Public License as published * by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . * * Author: Pete Woods */ #include #include #include using namespace QtDBusTest; namespace QtDBusMock { class DBusMockPrivate { public: DBusMockPrivate(DBusTestRunner &testRunner) : m_testRunner(testRunner) { } QtDBusTest::DBusTestRunner &m_testRunner; QScopedPointer m_networkManagerMock; QMap > m_mockInterfaces; }; DBusMock::DBusMock(DBusTestRunner &testRunner) : d(new DBusMockPrivate(testRunner)) { } DBusMock::~DBusMock() { } void DBusMock::registerMetaTypes() { Method::registerMetaType(); MethodCall::registerMetaType(); NamedMethodCall::registerMetaType(); } void DBusMock::registerNetworkManager() { d->m_testRunner.registerService( DBusServicePtr( new QProcessDBusService(NM_DBUS_SERVICE, QDBusConnection::SystemBus, "python3", QStringList() << "-m" << "dbusmock" << "--template" << "networkmanager"))); } void DBusMock::registerCustomMock(const QString &name, const QString &path, const QString &interface, QDBusConnection::BusType busType) { QStringList args; args << "-m" << "dbusmock"; if (busType == QDBusConnection::SystemBus) { args << "-s"; } args << name << path << interface; d->m_testRunner.registerService( DBusServicePtr( new QProcessDBusService(name, busType, "python3", args))); } NetworkManagerMockInterface & DBusMock::networkManagerInterface() { if (d->m_networkManagerMock.isNull()) { d->m_networkManagerMock.reset( new NetworkManagerMockInterface(NM_DBUS_INTERFACE, NM_DBUS_PATH, d->m_testRunner.systemConnection())); } return *d->m_networkManagerMock; } OrgFreedesktopDBusMockInterface & DBusMock::mockInterface(const QString &name, const QString &path, const QString &interface, QDBusConnection::BusType busType) { Q_UNUSED(interface); QString id(name); id.append(':'); id.append(path); auto it(d->m_mockInterfaces.find(id)); if (it == d->m_mockInterfaces.end()) { switch (busType) { case QDBusConnection::SystemBus: it = d->m_mockInterfaces.insert(id, QSharedPointer( new OrgFreedesktopDBusMockInterface(name, path, d->m_testRunner.systemConnection()))); break; case QDBusConnection::SessionBus: it = d->m_mockInterfaces.insert(id, QSharedPointer( new OrgFreedesktopDBusMockInterface(name, path, d->m_testRunner.sessionConnection()))); break; case QDBusConnection::ActivationBus: qWarning() << "Unknown bus type"; break; } } return **it; } } libqtdbusmock-0.2+14.04.20140304/src/libqtdbusmock/ExportInterfaces.h0000644000015201777760000000222112305262310025667 0ustar pbusernogroup00000000000000/* * Copyright (C) 2013 Canonical, Ltd. * * This library is free software; you can redistribute it and/or modify it under * the terms of version 3 of the GNU Lesser General Public License as published * by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . * * Author: Pete Woods */ #ifndef LIBQTDBUSMOCK_EXPORTINTERFACES_H_ #define LIBQTDBUSMOCK_EXPORTINTERFACES_H_ #include class Q_DECL_EXPORT OrgFreedesktopDBusMockInterface; class Q_DECL_EXPORT NetworkManagerMockInterface; class Q_DECL_EXPORT OrgFreedesktopDBusPropertiesInterface; #include #include #include #endif /* LIBQTDBUSMOCK_EXPORTINTERFACES_H_ */ libqtdbusmock-0.2+14.04.20140304/src/libqtdbusmock/DBusMock.h0000644000015201777760000000317612305262310024063 0ustar pbusernogroup00000000000000/* * Copyright (C) 2013 Canonical, Ltd. * * This library is free software; you can redistribute it and/or modify it under * the terms of version 3 of the GNU Lesser General Public License as published * by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . * * Author: Pete Woods */ #ifndef QTDBUSMOCK_DBUSMOCK_H_ #define QTDBUSMOCK_DBUSMOCK_H_ #include #include #include #include namespace QtDBusMock { class DBusMockPrivate; class Q_DECL_EXPORT DBusMock { public: DBusMock(QtDBusTest::DBusTestRunner &testRunner); virtual ~DBusMock(); Q_DECL_EXPORT static void registerMetaTypes(); virtual void registerNetworkManager(); virtual void registerCustomMock(const QString &name, const QString &path, const QString &interface, QDBusConnection::BusType); virtual NetworkManagerMockInterface & networkManagerInterface(); virtual OrgFreedesktopDBusMockInterface & mockInterface(const QString &name, const QString &path, const QString &interface, QDBusConnection::BusType busType); private: QSharedPointer d; }; } #endif /* QTDBUSMOCK_DBUSMOCK_H_ */ libqtdbusmock-0.2+14.04.20140304/src/libqtdbusmock/Method.h0000644000015201777760000000316612305262310023633 0ustar pbusernogroup00000000000000/* * Copyright (C) 2013 Canonical, Ltd. * * This library is free software; you can redistribute it and/or modify it under * the terms of version 3 of the GNU Lesser General Public License as published * by the Free Software Foundation. * * This library is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more * details. * * You should have received a copy of the GNU Lesser General Public License * along with this program. If not, see . * * Author: Pete Woods */ #ifndef LIBQTDBUSMOCK_METHOD_H_ #define LIBQTDBUSMOCK_METHOD_H_ #include namespace QtDBusMock { class Q_DECL_EXPORT Method { public: explicit Method(); Method(const Method &other); Method& operator=(const Method &other); ~Method(); static void registerMetaType(); const QString & name() const; const QString & inSig() const; const QString & outSig() const; const QString & code() const; void setName(const QString &name); void setInSig(const QString &inSig); void setOutSig(const QString &outSig); void setCode(const QString &code); protected: QString m_name; QString m_inSig; QString m_outSig; QString m_code; }; } Q_DECL_EXPORT QDBusArgument &operator<<(QDBusArgument &argument, const QtDBusMock::Method &method); Q_DECL_EXPORT const QDBusArgument &operator>>(const QDBusArgument &argument, QtDBusMock::Method &method); Q_DECLARE_METATYPE(QtDBusMock::Method) #endif // LIBQTDBUSMOCK_METHOD_H_ libqtdbusmock-0.2+14.04.20140304/data/0000755000015201777760000000000012305262522017520 5ustar pbusernogroup00000000000000libqtdbusmock-0.2+14.04.20140304/data/org.freedesktop.DBus.Mock.xml0000644000015201777760000000545212305262310025070 0ustar pbusernogroup00000000000000 libqtdbusmock-0.2+14.04.20140304/data/org.freedesktop.DBus.Properties.xml0000644000015201777760000000202312305262310026322 0ustar pbusernogroup00000000000000 libqtdbusmock-0.2+14.04.20140304/data/CMakeLists.txt0000644000015201777760000000000012305262310022241 0ustar pbusernogroup00000000000000libqtdbusmock-0.2+14.04.20140304/data/nm-manager-mock.xml0000644000015201777760000000222212305262310023204 0ustar pbusernogroup00000000000000 libqtdbusmock-0.2+14.04.20140304/COPYING0000644000015201777760000001672712305262310017652 0ustar pbusernogroup00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. This version of the GNU Lesser General Public License incorporates the terms and conditions of version 3 of the GNU General Public License, supplemented by the additional permissions listed below. 0. Additional Definitions. As used herein, "this License" refers to version 3 of the GNU Lesser General Public License, and the "GNU GPL" refers to version 3 of the GNU General Public License. "The Library" refers to a covered work governed by this License, other than an Application or a Combined Work as defined below. An "Application" is any work that makes use of an interface provided by the Library, but which is not otherwise based on the Library. Defining a subclass of a class defined by the Library is deemed a mode of using an interface provided by the Library. A "Combined Work" is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the "Linked Version". The "Minimal Corresponding Source" for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version. The "Corresponding Application Code" for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work. 1. Exception to Section 3 of the GNU GPL. You may convey a covered work under sections 3 and 4 of this License without being bound by section 3 of the GNU GPL. 2. Conveying Modified Versions. If you modify a copy of the Library, and, in your modifications, a facility refers to a function or data to be supplied by an Application that uses the facility (other than as an argument passed when the facility is invoked), then you may convey a copy of the modified version: a) under this License, provided that you make a good faith effort to ensure that, in the event an Application does not supply the function or data, the facility still operates, and performs whatever part of its purpose remains meaningful, or b) under the GNU GPL, with none of the additional permissions of this License applicable to that copy. 3. Object Code Incorporating Material from Library Header Files. The object code form of an Application may incorporate material from a header file that is part of the Library. You may convey such object code under terms of your choice, provided that, if the incorporated material is not limited to numerical parameters, data structure layouts and accessors, or small macros, inline functions and templates (ten or fewer lines in length), you do both of the following: a) Give prominent notice with each copy of the object code that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the object code with a copy of the GNU GPL and this license document. 4. Combined Works. You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: a) Give prominent notice with each copy of the Combined Work that the Library is used in it and that the Library and its use are covered by this License. b) Accompany the Combined Work with a copy of the GNU GPL and this license document. c) For a Combined Work that displays copyright notices during execution, include the copyright notice for the Library among these notices, as well as a reference directing the user to the copies of the GNU GPL and this license document. d) Do one of the following: 0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source. 1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version. e) Provide Installation Information, but only if you would otherwise be required to provide such information under section 6 of the GNU GPL, and only to the extent that such information is necessary to install and execute a modified version of the Combined Work produced by recombining or relinking the Application with a modified version of the Linked Version. (If you use option 4d0, the Installation Information must accompany the Minimal Corresponding Source and Corresponding Application Code. If you use option 4d1, you must provide the Installation Information in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.) 5. Combined Libraries. You may place library facilities that are a work based on the Library side by side in a single library together with other library facilities that are not Applications and are not covered by this License, and convey such a combined library under terms of your choice, if you do both of the following: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities, conveyed under the terms of this License. b) Give prominent notice with the combined library that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 6. Revised Versions of the GNU Lesser General Public License. The Free Software Foundation may publish revised and/or new versions of the GNU Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library as you received it specifies that a certain numbered version of the GNU Lesser General Public License "or any later version" applies to it, you have the option of following the terms and conditions either of that published version or of any later version published by the Free Software Foundation. If the Library as you received it does not specify a version number of the GNU Lesser General Public License, you may choose any version of the GNU Lesser General Public License ever published by the Free Software Foundation. If the Library as you received it specifies that a proxy can decide whether future versions of the GNU Lesser General Public License shall apply, that proxy's public statement of acceptance of any version is permanent authorization for you to choose that version for the Library.