From b29c78f818ac92f42621c69c29736fe5c8e32c6f Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Thu, 1 Mar 2012 12:32:10 +0100 Subject: Initial prototype of GObject-based libuca --- test/CMakeLists.txt | 14 ++++++++++++++ test/test-gobject.c | 20 ++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 test/test-gobject.c (limited to 'test') diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index e2664bf..7d829c3 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -34,3 +34,17 @@ if (GTK2_FOUND) ) endif() +# >>> TEMPORARY TEST EXECUTABLE <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< + +pkg_check_modules(GLIB2 glib-2.0>=2.24 REQUIRED) +pkg_check_modules(GOBJECT2 gobject-2.0>=2.24 REQUIRED) + +include_directories( + ${GLIB2_INCLUDE_DIRS} + ${GOBJECT2_INCLUDE_DIRS} + ${CMAKE_CURRENT_SOURCE_DIR}/../src/cameras + ) + +add_executable(test-gobject test-gobject.c) +target_link_libraries(test-gobject uca-gobject ${GLIB2_LIBRARIES} + ${GOBJECT2_LIBRARIES}) diff --git a/test/test-gobject.c b/test/test-gobject.c new file mode 100644 index 0000000..392a4f3 --- /dev/null +++ b/test/test-gobject.c @@ -0,0 +1,20 @@ +#include +#include "uca-camera.h" +#include "uca-mock-camera.h" + +int main(int argc, char **argv) +{ + g_type_init(); + + UcaMockCamera *cam = (UcaMockCamera *) g_object_new(UCA_TYPE_MOCK_CAMERA, NULL); + + guint width; + g_object_get(cam, + "sensor-width", &width, + NULL); + g_print("width = %i\n", width); + + uca_camera_start_recording(UCA_CAMERA(cam)); + + g_object_unref(cam); +} -- cgit v1.2.3