libqtdbusmock-0.2+14.04.20140304/ 0000755 0000152 0177776 00000000000 12305262522 016607 5 ustar pbuser nogroup 0000000 0000000 libqtdbusmock-0.2+14.04.20140304/cmake/ 0000755 0000152 0177776 00000000000 12305262522 017667 5 ustar pbuser nogroup 0000000 0000000 libqtdbusmock-0.2+14.04.20140304/cmake/COPYING-CMAKE-SCRIPTS 0000644 0000152 0177776 00000002457 12305262310 022670 0 ustar pbuser nogroup 0000000 0000000 Redistribution 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.cmake 0000644 0000152 0177776 00000001325 12305262310 023234 0 ustar pbuser nogroup 0000000 0000000
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.cmake 0000644 0000152 0177776 00000000766 12305262310 022476 0 ustar pbuser nogroup 0000000 0000000 # 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.cmake 0000644 0000152 0177776 00000004226 12305262310 022423 0 ustar pbuser nogroup 0000000 0000000 if (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/ 0000755 0000152 0177776 00000000000 12305262522 017751 5 ustar pbuser nogroup 0000000 0000000 libqtdbusmock-0.2+14.04.20140304/tests/CMakeLists.txt 0000644 0000152 0177776 00000001063 12305262310 022504 0 ustar pbuser nogroup 0000000 0000000
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/ 0000755 0000152 0177776 00000000000 12305262522 022614 5 ustar pbuser nogroup 0000000 0000000 libqtdbusmock-0.2+14.04.20140304/tests/libqtdbusmock/TestDBusMock.cpp 0000644 0000152 0177776 00000015710 12305262310 025626 0 ustar pbuser nogroup 0000000 0000000 /*
* 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.cpp 0000644 0000152 0177776 00000002346 12305262310 021401 0 ustar pbuser nogroup 0000000 0000000 /*
* 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/ 0000755 0000152 0177776 00000000000 12305262522 020662 5 ustar pbuser nogroup 0000000 0000000 libqtdbusmock-0.2+14.04.20140304/tests/data/valgrind.suppression 0000644 0000152 0177776 00000001544 12305262310 025003 0 ustar pbuser nogroup 0000000 0000000 {
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.txt 0000644 0000152 0177776 00000003677 12305262310 021357 0 ustar pbuser nogroup 0000000 0000000 project(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.sh 0000755 0000152 0177776 00000002674 12305262310 020251 0 ustar pbuser nogroup 0000000 0000000 #! /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/ 0000755 0000152 0177776 00000000000 12305262522 017376 5 ustar pbuser nogroup 0000000 0000000 libqtdbusmock-0.2+14.04.20140304/src/CMakeLists.txt 0000644 0000152 0177776 00000000132 12305262310 022125 0 ustar pbuser nogroup 0000000 0000000 include(GenerateExportHeader)
add_compiler_export_flags()
add_subdirectory(libqtdbusmock) libqtdbusmock-0.2+14.04.20140304/src/libqtdbusmock/ 0000755 0000152 0177776 00000000000 12305262522 022241 5 ustar pbuser nogroup 0000000 0000000 libqtdbusmock-0.2+14.04.20140304/src/libqtdbusmock/NamedMethodCall.h 0000644 0000152 0177776 00000003306 12305262310 025370 0 ustar pbuser nogroup 0000000 0000000 /*
* 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.h 0000644 0000152 0177776 00000003031 12305262310 024416 0 ustar pbuser nogroup 0000000 0000000 /*
* 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.in 0000644 0000152 0177776 00000000472 12305262310 026033 0 ustar pbuser nogroup 0000000 0000000 libdir=@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.h 0000644 0000152 0177776 00000001541 12305262310 026436 0 ustar pbuser nogroup 0000000 0000000 /*
* 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.txt 0000644 0000152 0177776 00000003712 12305262310 024777 0 ustar pbuser nogroup 0000000 0000000
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.cpp 0000644 0000152 0177776 00000004527 12305262310 024170 0 ustar pbuser nogroup 0000000 0000000 /*
* 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.cpp 0000644 0000152 0177776 00000005004 12305262310 025720 0 ustar pbuser nogroup 0000000 0000000 /*
* 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.cpp 0000644 0000152 0177776 00000006516 12305262310 024764 0 ustar pbuser nogroup 0000000 0000000 /*
* 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.in 0000644 0000152 0177776 00000001563 12305262310 024264 0 ustar pbuser nogroup 0000000 0000000 /*
* 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.cpp 0000644 0000152 0177776 00000006446 12305262310 024421 0 ustar pbuser nogroup 0000000 0000000 /*
* 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.h 0000644 0000152 0177776 00000002221 12305262310 025667 0 ustar pbuser nogroup 0000000 0000000 /*
* 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.h 0000644 0000152 0177776 00000003176 12305262310 024063 0 ustar pbuser nogroup 0000000 0000000 /*
* 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.h 0000644 0000152 0177776 00000003166 12305262310 023633 0 ustar pbuser nogroup 0000000 0000000 /*
* 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/ 0000755 0000152 0177776 00000000000 12305262522 017520 5 ustar pbuser nogroup 0000000 0000000 libqtdbusmock-0.2+14.04.20140304/data/org.freedesktop.DBus.Mock.xml 0000644 0000152 0177776 00000005452 12305262310 025070 0 ustar pbuser nogroup 0000000 0000000
libqtdbusmock-0.2+14.04.20140304/data/org.freedesktop.DBus.Properties.xml 0000644 0000152 0177776 00000002023 12305262310 026322 0 ustar pbuser nogroup 0000000 0000000