aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/client/CMakeLists.txt6
-rw-r--r--tests/client/actiongrouptest.cpp22
-rw-r--r--tests/client/convertertest.cpp4
-rw-r--r--tests/client/menuchangestest.cpp2
-rw-r--r--tests/client/modeltest.cpp26
-rw-r--r--tests/client/servicetest.cpp20
-rw-r--r--tests/script/menuscript.py2
7 files changed, 39 insertions, 43 deletions
diff --git a/tests/client/CMakeLists.txt b/tests/client/CMakeLists.txt
index c427f54..2c48a07 100644
--- a/tests/client/CMakeLists.txt
+++ b/tests/client/CMakeLists.txt
@@ -4,7 +4,7 @@ macro(declare_test testname)
add_executable(${testname} ${testname}.cpp ${TEST_MOC_FILE})
target_link_libraries(${testname}
- qmenumodelcommon
+ qmenumodel
dbusmenuscript
${QT_QTTEST_LIBRARY}
${QT_QTCORE_LIBRARY}
@@ -30,7 +30,7 @@ macro(declare_simple_test testname)
add_executable(${testname} ${testname}.cpp ${TEST_MOC_FILE})
target_link_libraries(${testname}
- qmenumodelcommon
+ qmenumodel
${QT_QTTEST_LIBRARY}
${QT_QTCORE_LIBRARY}
${QT_QTGUI_LIBRARY}
@@ -45,7 +45,7 @@ macro(declare_simple_test testname)
TIMEOUT ${CTEST_TESTING_TIMEOUT})
endmacro(declare_simple_test testname)
-include_directories(${qmenumodelcommon_SOURCE_DIR}
+include_directories(${src_SOURCE_DIR}
${dbusmenuscript_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${QT_INCLUDE_DIR}
diff --git a/tests/client/actiongrouptest.cpp b/tests/client/actiongrouptest.cpp
index c77c3d5..116bd44 100644
--- a/tests/client/actiongrouptest.cpp
+++ b/tests/client/actiongrouptest.cpp
@@ -49,12 +49,12 @@ private Q_SLOTS:
void init()
{
m_model.stop();
- m_model.setBusType(QDBusObject::SessionBus);
+ m_model.setBusType(DBusEnums::SessionBus);
m_model.setBusName(MENU_SERVICE_NAME);
m_model.setObjectPath(MENU_OBJECT_PATH);
m_actionGroup.stop();
- m_actionGroup.setBusType(QDBusObject::SessionBus);
+ m_actionGroup.setBusType(DBusEnums::SessionBus);
m_actionGroup.setBusName(MENU_SERVICE_NAME);
m_actionGroup.setObjectPath(MENU_OBJECT_PATH);
}
@@ -70,16 +70,16 @@ private Q_SLOTS:
void testBusTypeProperty()
{
m_actionGroup.setProperty("busType", 1);
- QCOMPARE(m_actionGroup.busType(), QDBusObject::SessionBus);
+ QCOMPARE(m_actionGroup.busType(), DBusEnums::SessionBus);
m_actionGroup.setProperty("busType", 2);
- QCOMPARE(m_actionGroup.busType(), QDBusObject::SystemBus);
+ QCOMPARE(m_actionGroup.busType(), DBusEnums::SystemBus);
m_actionGroup.setProperty("busType", 0);
- QCOMPARE(m_actionGroup.busType(), QDBusObject::SystemBus);
+ QCOMPARE(m_actionGroup.busType(), DBusEnums::SystemBus);
m_actionGroup.setProperty("busType", 10);
- QCOMPARE(m_actionGroup.busType(), QDBusObject::SystemBus);
+ QCOMPARE(m_actionGroup.busType(), DBusEnums::SystemBus);
}
/*
@@ -90,12 +90,12 @@ private Q_SLOTS:
{
m_model.start();
m_actionGroup.start();
- QCOMPARE(m_actionGroup.status(), QDBusObject::Connecting);
+ QCOMPARE(m_actionGroup.status(), DBusEnums::Connecting);
// Make menu available
m_script.publishMenu();
- QCOMPARE(m_actionGroup.status(), QDBusObject::Connected);
+ QCOMPARE(m_actionGroup.status(), DBusEnums::Connected);
}
/*
@@ -109,17 +109,17 @@ private Q_SLOTS:
// Make menu available
m_script.publishMenu();
- QCOMPARE(m_actionGroup.status(), QDBusObject::Connected);
+ QCOMPARE(m_actionGroup.status(), DBusEnums::Connected);
// Append menus
m_script.walk(2);
// Remove menu from dbus
m_script.unpublishMenu();
- QCOMPARE(m_actionGroup.status(), QDBusObject::Connecting);
+ QCOMPARE(m_actionGroup.status(), DBusEnums::Connecting);
m_actionGroup.stop();
- QCOMPARE(m_actionGroup.status(), QDBusObject::Disconnected);
+ QCOMPARE(m_actionGroup.status(), DBusEnums::Disconnected);
}
/*
diff --git a/tests/client/convertertest.cpp b/tests/client/convertertest.cpp
index 496b62a..72b6a87 100644
--- a/tests/client/convertertest.cpp
+++ b/tests/client/convertertest.cpp
@@ -17,6 +17,10 @@
* Renato Araujo Oliveira Filho <renato@canonical.com>
*/
+extern "C" {
+#include <glib.h>
+}
+
#include "converter.h"
#include <QObject>
diff --git a/tests/client/menuchangestest.cpp b/tests/client/menuchangestest.cpp
index 64c1729..2015582 100644
--- a/tests/client/menuchangestest.cpp
+++ b/tests/client/menuchangestest.cpp
@@ -46,7 +46,7 @@ private Q_SLOTS:
void init()
{
m_model.stop();
- m_model.setBusType(QDBusObject::SessionBus);
+ m_model.setBusType(DBusEnums::SessionBus);
m_model.setBusName(MENU_SERVICE_NAME);
m_model.setObjectPath(MENU_OBJECT_PATH);
}
diff --git a/tests/client/modeltest.cpp b/tests/client/modeltest.cpp
index ee3e0f4..9f6ee76 100644
--- a/tests/client/modeltest.cpp
+++ b/tests/client/modeltest.cpp
@@ -46,7 +46,7 @@ private Q_SLOTS:
void init()
{
m_model.stop();
- m_model.setBusType(QDBusObject::SessionBus);
+ m_model.setBusType(DBusEnums::SessionBus);
m_model.setBusName(MENU_SERVICE_NAME);
m_model.setObjectPath(MENU_OBJECT_PATH);
}
@@ -57,14 +57,6 @@ private Q_SLOTS:
}
/*
- * Test if columnCount is always 1
- */
- void testColumnCount()
- {
- QCOMPARE(m_model.columnCount(), 1);
- }
-
- /*
* Test if parent function always return a empty QModelIndex
*/
void testParent()
@@ -78,16 +70,16 @@ private Q_SLOTS:
void testBusTypeProperty()
{
m_model.setProperty("busType", 1);
- QCOMPARE(m_model.busType(), QDBusObject::SessionBus);
+ QCOMPARE(m_model.busType(), DBusEnums::SessionBus);
m_model.setProperty("busType", 2);
- QCOMPARE(m_model.busType(), QDBusObject::SystemBus);
+ QCOMPARE(m_model.busType(), DBusEnums::SystemBus);
m_model.setProperty("busType", 0);
- QCOMPARE(m_model.busType(), QDBusObject::SystemBus);
+ QCOMPARE(m_model.busType(), DBusEnums::SystemBus);
m_model.setProperty("busType", 10);
- QCOMPARE(m_model.busType(), QDBusObject::SystemBus);
+ QCOMPARE(m_model.busType(), DBusEnums::SystemBus);
}
@@ -106,7 +98,7 @@ private Q_SLOTS:
// Wait for dbus sync
QTest::qWait(500);
- QCOMPARE(m_model.status(), QDBusObject::Connected);
+ QCOMPARE(m_model.status(), DBusEnums::Connected);
QCOMPARE(m_model.rowCount(), 4);
// Label (String)
@@ -154,7 +146,7 @@ private Q_SLOTS:
// Wait for dbus sync
QTest::qWait(500);
- QCOMPARE(m_model.status(), QDBusObject::Connected);
+ QCOMPARE(m_model.status(), DBusEnums::Connected);
QCOMPARE(m_model.rowCount(), 4);
QVariant e = m_model.data(m_model.index(0, 0), QMenuModel::Extra);
@@ -193,12 +185,12 @@ private Q_SLOTS:
// Int64
v = extra["int64"];
- QCOMPARE(v.typeName(), "long");
+ QCOMPARE(v.type(), QVariant::LongLong);
QCOMPARE(v.value<long>(), (long) -42);
// UInt64
v = extra["uint64"];
- QCOMPARE(v.typeName(), "ulong");
+ QCOMPARE(v.type(), QVariant::ULongLong);
QCOMPARE(v.value<ulong>(), (ulong) 42);
// Double
diff --git a/tests/client/servicetest.cpp b/tests/client/servicetest.cpp
index cc47334..a8b0c2a 100644
--- a/tests/client/servicetest.cpp
+++ b/tests/client/servicetest.cpp
@@ -34,7 +34,7 @@ private:
void setupModel(QDBusMenuModel *model)
{
- model->setBusType(QDBusObject::SessionBus);
+ model->setBusType(DBusEnums::SessionBus);
model->setBusName(MENU_SERVICE_NAME);
model->setObjectPath(MENU_OBJECT_PATH);
}
@@ -53,7 +53,7 @@ private Q_SLOTS:
void init()
{
m_model.stop();
- m_model.setBusType(QDBusObject::SessionBus);
+ m_model.setBusType(DBusEnums::SessionBus);
m_model.setBusName(MENU_SERVICE_NAME);
m_model.setObjectPath(MENU_OBJECT_PATH);
}
@@ -66,10 +66,10 @@ private Q_SLOTS:
void testMenuStartStopWithNoService()
{
m_model.start();
- QCOMPARE(m_model.status(), QDBusObject::Connecting);
+ QCOMPARE(m_model.status(), DBusEnums::Connecting);
m_model.stop();
- QCOMPARE(m_model.status(), QDBusObject::Disconnected);
+ QCOMPARE(m_model.status(), DBusEnums::Disconnected);
}
void testMenuStartStopWithService()
@@ -83,33 +83,33 @@ private Q_SLOTS:
// Wait for dbus sync
QTest::qWait(500);
- QCOMPARE(m_model.status(), QDBusObject::Connected);
+ QCOMPARE(m_model.status(), DBusEnums::Connected);
// Diconnect model
m_model.stop();
- QCOMPARE(m_model.status(), QDBusObject::Disconnected);
+ QCOMPARE(m_model.status(), DBusEnums::Disconnected);
}
void testMenuServiceAppearAndDissapear()
{
m_model.start();
- QCOMPARE(m_model.status(), QDBusObject::Connecting);
+ QCOMPARE(m_model.status(), DBusEnums::Connecting);
- QSignalSpy spy(&m_model, SIGNAL(statusChanged(QDBusObject::ConnectionStatus)));
+ QSignalSpy spy(&m_model, SIGNAL(statusChanged(DBusEnums::ConnectionStatus)));
// Make menu available
m_script.publishMenu();
// singal changed to connected
QCOMPARE(spy.count(), 1);
- QCOMPARE(m_model.status(), QDBusObject::Connected);
+ QCOMPARE(m_model.status(), DBusEnums::Connected);
// remove menu service
m_script.unpublishMenu();
// signal changed to connecting
QCOMPARE(spy.count(), 2);
- QCOMPARE(m_model.status(), QDBusObject::Connecting);
+ QCOMPARE(m_model.status(), DBusEnums::Connecting);
}
};
diff --git a/tests/script/menuscript.py b/tests/script/menuscript.py
index f50aacd..ba67560 100644
--- a/tests/script/menuscript.py
+++ b/tests/script/menuscript.py
@@ -127,7 +127,7 @@ class ActionList(object):
self._actions = []
self._actions_bk = []
self._objectPath = objectPath
- self._bux = None
+ self._bus = None
self._exportMenuID = None
self._exportActionID = None
self._ownNameID = None