diff options
author | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2012-03-01 17:23:14 +0100 |
---|---|---|
committer | Matthias Vogelgesang <matthias.vogelgesang@kit.edu> | 2012-03-01 17:23:14 +0100 |
commit | e26a093b4036083f13265bcbde5eae442d502377 (patch) | |
tree | 1fd30bbeba4eb7c7ee6d1c6d4f5e9593f30882da /test | |
parent | b29c78f818ac92f42621c69c29736fe5c8e32c6f (diff) | |
download | libuca-e26a093b4036083f13265bcbde5eae442d502377.tar.gz libuca-e26a093b4036083f13265bcbde5eae442d502377.tar.bz2 libuca-e26a093b4036083f13265bcbde5eae442d502377.tar.xz libuca-e26a093b4036083f13265bcbde5eae442d502377.zip |
First draft at clean pco object construction
Diffstat (limited to 'test')
-rw-r--r-- | test/CMakeLists.txt | 46 | ||||
-rw-r--r-- | test/test-gobject.c | 16 |
2 files changed, 34 insertions, 28 deletions
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 <glib-object.h> #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); } |