summaryrefslogtreecommitdiffstats
path: root/test/test-all.c
diff options
context:
space:
mode:
authorMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2012-03-06 16:57:36 +0100
committerMatthias Vogelgesang <matthias.vogelgesang@kit.edu>2012-03-06 16:57:36 +0100
commiteae2ae49770bcbcdbac3997676c71820dd53fdcc (patch)
treef39b61f6ea2bd30620879595b0fa7c51093bc084 /test/test-all.c
parent09d05f26269799e643c171849f22d24c30836d00 (diff)
downloadlibuca-eae2ae49770bcbcdbac3997676c71820dd53fdcc.tar.gz
libuca-eae2ae49770bcbcdbac3997676c71820dd53fdcc.tar.bz2
libuca-eae2ae49770bcbcdbac3997676c71820dd53fdcc.tar.xz
libuca-eae2ae49770bcbcdbac3997676c71820dd53fdcc.zip
Implement single frame grabbing
Diffstat (limited to 'test/test-all.c')
-rw-r--r--test/test-all.c38
1 files changed, 24 insertions, 14 deletions
diff --git a/test/test-all.c b/test/test-all.c
index 3fb81e7..f6e3002 100644
--- a/test/test-all.c
+++ b/test/test-all.c
@@ -47,24 +47,16 @@ static void test_recording(Fixture *fixture, gconstpointer data)
g_error_free(error);
error = NULL;
- uca_camera_start_recording(camera, &error);
- g_assert_no_error(error);
- uca_camera_stop_recording(camera, &error);
- g_assert_no_error(error);
-}
-
-static void test_recording_signal(Fixture *fixture, gconstpointer data)
-{
- UcaCamera *camera = UCA_CAMERA(fixture->camera);
gboolean success = FALSE;
g_signal_connect(G_OBJECT(camera), "notify::is-recording",
(GCallback) on_property_change, &success);
-
- uca_camera_start_recording(camera, NULL);
+ uca_camera_start_recording(camera, &error);
+ g_assert_no_error(error);
g_assert(success == TRUE);
success = FALSE;
- uca_camera_stop_recording(camera, NULL);
+ uca_camera_stop_recording(camera, &error);
+ g_assert_no_error(error);
g_assert(success == TRUE);
}
@@ -99,6 +91,24 @@ static void test_recording_async(Fixture *fixture, gconstpointer data)
uca_camera_stop_recording(camera, &error);
g_assert_no_error(error);
+ g_assert(success == TRUE);
+}
+
+static void test_recording_grab(Fixture *fixture, gconstpointer data)
+{
+ UcaCamera *camera = UCA_CAMERA(fixture->camera);
+ GError *error = NULL;
+ gpointer frame = NULL;
+
+ uca_camera_start_recording(camera, &error);
+ g_assert_no_error(error);
+
+ uca_camera_grab(camera, &frame, &error);
+ g_assert_no_error(error);
+ g_assert(frame != NULL);
+
+ uca_camera_stop_recording(camera, &error);
+ g_assert_no_error(error);
}
static void test_recording_property(Fixture *fixture, gconstpointer data)
@@ -165,7 +175,7 @@ int main(int argc, char *argv[])
*/
static const gchar *paths[] = {
"/recording",
- "/recording/signal",
+ "/recording/grab",
"/recording/asynchronous",
"/properties/base",
"/properties/recording",
@@ -175,7 +185,7 @@ int main(int argc, char *argv[])
static UcaFixtureFunc test_funcs[] = {
test_recording,
- test_recording_signal,
+ test_recording_grab,
test_recording_async,
test_base_properties,
test_recording_property,