summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWolf Bergenheim <ext-wolf.2.bergenheim@nokia.com>2010-02-02 15:51:41 +0200
committerWolf Bergenheim <ext-wolf.2.bergenheim@nokia.com>2010-02-02 15:51:41 +0200
commit8bff62c335842b4c850cc09716e79c2f556247c7 (patch)
tree281dd5c4a92087f6308e3fb540aba62d7fd272c2
parentb7d622788b55d30d51ce30bd58634763fddf66fc (diff)
directory structure changes
-rw-r--r--Makefile26
-rw-r--r--libresourceqt/Doxyfile (renamed from Doxyfile)0
-rw-r--r--libresourceqt/include/resource-set.h (renamed from include/resource-set.h)0
-rw-r--r--libresourceqt/include/resource.h (renamed from include/resource.h)0
-rw-r--r--libresourceqt/include/resources.h (renamed from include/resources.h)0
-rw-r--r--libresourceqt/libresourceqt.pro (renamed from libresourceqt.pro)1
-rw-r--r--libresourceqt/src/resource-engine.cpp (renamed from src/resource-engine.cpp)0
-rw-r--r--libresourceqt/src/resource-engine.h (renamed from src/resource-engine.h)0
-rw-r--r--libresourceqt/src/resource-factory.cpp (renamed from src/resource-factory.cpp)0
-rw-r--r--libresourceqt/src/resource-set.cpp (renamed from src/resource-set.cpp)0
-rw-r--r--libresourceqt/src/resource.cpp (renamed from src/resource.cpp)0
-rw-r--r--libresourceqt/src/resources.cpp (renamed from src/resources.cpp)0
-rw-r--r--tests/Makefile21
-rw-r--r--tests/test-resource-engine/test-resource-engine.cpp62
-rw-r--r--tests/test-resource-engine/test-resource-engine.h32
-rw-r--r--tests/test-resource-engine/test-resource-engine.pro29
-rw-r--r--tests/test-resource-set/test-resource-set.cpp (renamed from tests/test-resource-set.cpp)0
-rw-r--r--tests/test-resource-set/test-resource-set.h (renamed from tests/test-resource-set.h)0
-rw-r--r--tests/test-resource-set/test-resource-set.pro (renamed from tests/test-resource-set.pro)0
-rw-r--r--tests/test-resource/test-resource.cpp (renamed from tests/test-resource.cpp)0
-rw-r--r--tests/test-resource/test-resource.h (renamed from tests/test-resource.h)0
-rw-r--r--tests/test-resource/test-resource.pro (renamed from tests/test-resource.pro)0
22 files changed, 123 insertions, 48 deletions
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 387abfa..0000000
--- a/Makefile
+++ /dev/null
@@ -1,26 +0,0 @@
-QMAKE = qmake
-MAKEFILE = libresourceqt.make
-LIB = build/libresourceqt.so.1.0.0
-
-%.make: %.pro
- $(QMAKE) -o $@ $<
-
-all: $(MAKEFILE)
- $(MAKE) -f $(MAKEFILE) all
- $(MAKE) -C tests all
-
-clean:
- $(RM) $(MAKEFILE)
- $(RM) -r build
- $(MAKE) -C tests clean
-
-install: $(MAKEFILE)
- $(MAKE) -f $(MAKEFILE) install
- $(MAKE) -C tests install
-
-tests: force
- $(MAKE) -C tests tests
-
-force: ;
-
-.phony: clean all install tests
diff --git a/Doxyfile b/libresourceqt/Doxyfile
index d41c553..d41c553 100644
--- a/Doxyfile
+++ b/libresourceqt/Doxyfile
diff --git a/include/resource-set.h b/libresourceqt/include/resource-set.h
index 1f515ee..1f515ee 100644
--- a/include/resource-set.h
+++ b/libresourceqt/include/resource-set.h
diff --git a/include/resource.h b/libresourceqt/include/resource.h
index 13265d5..13265d5 100644
--- a/include/resource.h
+++ b/libresourceqt/include/resource.h
diff --git a/include/resources.h b/libresourceqt/include/resources.h
index 8e3da70..8e3da70 100644
--- a/include/resources.h
+++ b/libresourceqt/include/resources.h
diff --git a/libresourceqt.pro b/libresourceqt/libresourceqt.pro
index bf4f4dc..b9e5cd5 100644
--- a/libresourceqt.pro
+++ b/libresourceqt/libresourceqt.pro
@@ -28,4 +28,3 @@ target.path = $$INSTALLBASE/lib
headers.path = $$INSTALLBASE/include/resource/qt4
INSTALLS = target headers
-
diff --git a/src/resource-engine.cpp b/libresourceqt/src/resource-engine.cpp
index cd34c08..cd34c08 100644
--- a/src/resource-engine.cpp
+++ b/libresourceqt/src/resource-engine.cpp
diff --git a/src/resource-engine.h b/libresourceqt/src/resource-engine.h
index 9dd5fe5..9dd5fe5 100644
--- a/src/resource-engine.h
+++ b/libresourceqt/src/resource-engine.h
diff --git a/src/resource-factory.cpp b/libresourceqt/src/resource-factory.cpp
index f500792..f500792 100644
--- a/src/resource-factory.cpp
+++ b/libresourceqt/src/resource-factory.cpp
diff --git a/src/resource-set.cpp b/libresourceqt/src/resource-set.cpp
index c7862ef..c7862ef 100644
--- a/src/resource-set.cpp
+++ b/libresourceqt/src/resource-set.cpp
diff --git a/src/resource.cpp b/libresourceqt/src/resource.cpp
index 8207b66..8207b66 100644
--- a/src/resource.cpp
+++ b/libresourceqt/src/resource.cpp
diff --git a/src/resources.cpp b/libresourceqt/src/resources.cpp
index 9858bd3..9858bd3 100644
--- a/src/resources.cpp
+++ b/libresourceqt/src/resources.cpp
diff --git a/tests/Makefile b/tests/Makefile
deleted file mode 100644
index 20ae9ef..0000000
--- a/tests/Makefile
+++ /dev/null
@@ -1,21 +0,0 @@
-QMAKE = qmake
-MAKEFILES = $(patsubst %.pro,%.make,$(wildcard *.pro))
-MAKEOVERRIDES =
-
-%.make: %.pro
- $(QMAKE) -o $@ $<
-
-tests: all
- find build -type f -name 'test-*' -exec sh -c "if test -x {}; then {}; fi" \;
-
-clean:
- $(RM) $(MAKEFILES)
- $(RM) -r build
-
-all: $(MAKEFILES)
- for makefile in $(MAKEFILES); do $(MAKE) -f "$$makefile" all; done
-
-install: $(MAKEFILES)
- for makefile in $(MAKEFILES); do $(MAKE) -f "$$makefile" install; done
-
-.phony: install tests all clean
diff --git a/tests/test-resource-engine/test-resource-engine.cpp b/tests/test-resource-engine/test-resource-engine.cpp
new file mode 100644
index 0000000..5c95224
--- /dev/null
+++ b/tests/test-resource-engine/test-resource-engine.cpp
@@ -0,0 +1,62 @@
+#include "test-resource-engine.h"
+#include <dbus/dbus.h>
+
+using namespace ResourcePolicy;
+
+TestResourceEngine::TestResourceEngine()
+ : resourceEngine(NULL), resourceSet(NULL),
+ audioPlayback(AudioPlaybackResource), videoPlayback(VideoPlaybackResource),
+ audioRecorder(AudioRecorderResource), videoRecorder(VideoRecorderResource)
+{
+ resourceSet = new ResourceSet("player", this);
+ resourceSet->addResource(audioPlayback);
+ resourceSet->addResource(videoPlayback);
+ resourceSet->addResource(audioRecorder);
+ resourceSet->addResource(videoRecorder);
+}
+
+TestResourceEngine::~TestResourceEngine()
+{
+}
+
+void TestResourceEngine::init()
+{
+ resourceEngine = new ResourceEngine(resourceSet);
+ bool initializeSucceeded = resourceEngine->initialize();
+ QVERIFY(!resourceEngine->isConnected());
+ QVERIFY(initializeSucceeded);
+}
+
+void TestResourceEngine::testConnect()
+{
+ bool connectIsSuccessful = resourceEngine->connect();
+ QVERIFY(connectIsSuccessful);
+}
+
+QTEST_MAIN(TestResourceEngine)
+
+////////////////////////////////////////////////////////////////
+
+resconn_t* resproto_init(resproto_role_t role, resproto_transport_t transport, ...)
+{
+ resconn_t *resourceConnection;
+ resconn_linkup_t callbackFunction;
+ DBusConnection *dbusConnection, systemBus;
+ va_list args;
+
+ va_start();
+ callbackFunction = va_arg(args, resconn_linkup_t);
+ dbusConnection = va_arg(args, DBusConnection *);
+ va_end();
+
+ systemBus = dbus_bus_get(DBUS_BUS_SYSTEM);
+
+ QVERIFY(callbackFunction != NULL);
+ QVERIFY(dbusConnection == systemBus);
+ QVERIFY(role == RESPROTO_ROLE_CLIENT);
+ QVERIFY(transport == RESPROTO_TRANSPORT_DBUS);
+
+ resourceConnection =(resconn_t *) calloc(1, sizeof(resconn_t));
+
+ return resourceConnection;
+}
diff --git a/tests/test-resource-engine/test-resource-engine.h b/tests/test-resource-engine/test-resource-engine.h
new file mode 100644
index 0000000..5484a05
--- /dev/null
+++ b/tests/test-resource-engine/test-resource-engine.h
@@ -0,0 +1,32 @@
+#ifndef TEST_RESOURCE_ENGINE_H
+#define TEST_RESOURCE_ENGINE_H
+
+#include <QtTest/QTest>
+#include "resource-engine.h"
+
+using namespace ResourcePolicy;
+
+class TestResourceEngine: public QObject
+{
+ Q_OBJECT
+ friend resconn_t* resproto_init(resproto_role_t, resproto_transport_t, ...);
+private:
+ ResourceEngine *resourceEngine;
+ ResourceSet *resourceSet;
+ Resource audioPlayback;
+ Resource videoPlayback;
+ Resource audioRecorder;
+ Resource videoRecorder;
+ bool libresourceInitialized;
+public:
+ TestResourceEngine();
+ ~TestResourceEngine();
+public slots:
+
+private slots:
+ void init();
+
+ void testConnect();
+};
+
+#endif
diff --git a/tests/test-resource-engine/test-resource-engine.pro b/tests/test-resource-engine/test-resource-engine.pro
new file mode 100644
index 0000000..9413609
--- /dev/null
+++ b/tests/test-resource-engine/test-resource-engine.pro
@@ -0,0 +1,29 @@
+BASE = ..
+TEMPLATE = app
+TARGET = test-resource-engine
+DESTDIR = build
+DEPENDPATH += $${BASE}/include $${BASE}/src .
+INCLUDEPATH += $${BASE}/src $${BASE}/include $${BASE}/../libresource/src
+
+# Input
+HEADERS += $${BASE}/include/resource.h \
+ $${BASE}/include/resource-set.h \
+ $${BASE}/src/resource-engine.h \
+ test-resource-engine.h
+
+SOURCES += $${BASE}/src/resource.cpp \
+ $${BASE}/src/resource-set.cpp \
+ $${BASE}/src/resource-engine.cpp \
+ test-resource-engine.cpp
+
+OBJECTS_DIR = build
+MOC_DIR = build
+
+CONFIG += qt qtestlib debug warn_on link_pkgconfig
+QT -= gui
+PKGCONFIG += dbus-1
+
+# Install directives
+INSTALLBASE = /usr
+target.path = $${INSTALLBASE}/share/libresourceqt/tests
+INSTALLS = target
diff --git a/tests/test-resource-set.cpp b/tests/test-resource-set/test-resource-set.cpp
index e9ee74b..e9ee74b 100644
--- a/tests/test-resource-set.cpp
+++ b/tests/test-resource-set/test-resource-set.cpp
diff --git a/tests/test-resource-set.h b/tests/test-resource-set/test-resource-set.h
index 0a3eeef..0a3eeef 100644
--- a/tests/test-resource-set.h
+++ b/tests/test-resource-set/test-resource-set.h
diff --git a/tests/test-resource-set.pro b/tests/test-resource-set/test-resource-set.pro
index ad6d90d..ad6d90d 100644
--- a/tests/test-resource-set.pro
+++ b/tests/test-resource-set/test-resource-set.pro
diff --git a/tests/test-resource.cpp b/tests/test-resource/test-resource.cpp
index 2098a88..2098a88 100644
--- a/tests/test-resource.cpp
+++ b/tests/test-resource/test-resource.cpp
diff --git a/tests/test-resource.h b/tests/test-resource/test-resource.h
index fc04c47..fc04c47 100644
--- a/tests/test-resource.h
+++ b/tests/test-resource/test-resource.h
diff --git a/tests/test-resource.pro b/tests/test-resource/test-resource.pro
index 7ab2678..7ab2678 100644
--- a/tests/test-resource.pro
+++ b/tests/test-resource/test-resource.pro