From e26a093b4036083f13265bcbde5eae442d502377 Mon Sep 17 00:00:00 2001 From: Matthias Vogelgesang Date: Thu, 1 Mar 2012 17:23:14 +0100 Subject: First draft at clean pco object construction --- test/CMakeLists.txt | 46 ++++++++++++++++++++++++---------------------- test/test-gobject.c | 16 ++++++++++------ 2 files changed, 34 insertions(+), 28 deletions(-) (limited to 'test') diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index 7d829c3..63c46d7 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -14,26 +14,25 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/control.glade ${CMAKE_CURRENT_BINARY_ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/run.py ${CMAKE_CURRENT_BINARY_DIR}) # --- Build targets ----------------------------------------------------------- -add_executable(enum enum.c) -add_executable(grab grab.c) -add_executable(grab-async grab-async.c) -add_executable(benchmark benchmark.c) - -target_link_libraries(enum uca) -target_link_libraries(grab uca) -target_link_libraries(grab-async uca) -target_link_libraries(benchmark uca) - -if (GTK2_FOUND) - include_directories(${GTK2_INCLUDE_DIRS}) - add_executable(control control.c) - target_link_libraries(control - uca - ${GTK2_LIBRARIES} - ${GTHREAD2_LIBRARIES} - ) -endif() - +#add_executable(enum enum.c) +#add_executable(grab-async grab-async.c) +#add_executable(benchmark benchmark.c) + +#target_link_libraries(enum uca) +#target_link_libraries(grab uca) +#target_link_libraries(grab-async uca) +#target_link_libraries(benchmark uca) + +#if (GTK2_FOUND) +# include_directories(${GTK2_INCLUDE_DIRS}) +# add_executable(control control.c) +# target_link_libraries(control +# uca +# ${GTK2_LIBRARIES} +# ${GTHREAD2_LIBRARIES} +# ) +#endif() +# # >>> TEMPORARY TEST EXECUTABLE <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< pkg_check_modules(GLIB2 glib-2.0>=2.24 REQUIRED) @@ -46,5 +45,8 @@ include_directories( ) add_executable(test-gobject test-gobject.c) -target_link_libraries(test-gobject uca-gobject ${GLIB2_LIBRARIES} - ${GOBJECT2_LIBRARIES}) +target_link_libraries(test-gobject + uca-gobject + ${GLIB2_LIBRARIES} + ${GOBJECT2_LIBRARIES} + ) diff --git a/test/test-gobject.c b/test/test-gobject.c index 392a4f3..44a13cb 100644 --- a/test/test-gobject.c +++ b/test/test-gobject.c @@ -1,20 +1,24 @@ #include #include "uca-camera.h" -#include "uca-mock-camera.h" +#include "uca-pco-camera.h" int main(int argc, char **argv) { g_type_init(); - UcaMockCamera *cam = (UcaMockCamera *) g_object_new(UCA_TYPE_MOCK_CAMERA, NULL); + GError *error = NULL; + UcaPcoCamera *cam = uca_pco_camera_new(&error); - guint width; + if (cam == NULL) { + g_error("Camera could not be initialized\n"); + } + + guint width, height; g_object_get(cam, "sensor-width", &width, + "sensor-height", &height, NULL); - g_print("width = %i\n", width); - - uca_camera_start_recording(UCA_CAMERA(cam)); + g_print("resolution %ix%i\n", width, height); g_object_unref(cam); } -- cgit v1.2.3