[aravis] tests: test trigger feature in fake.
- From: Emmanuel Pacaud <emmanuel src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [aravis] tests: test trigger feature in fake.
- Date: Sun, 16 May 2010 19:55:03 +0000 (UTC)
commit 6938ed7d2ec616d4fcc4b1e8e21874847e9ed00a
Author: Emmanuel Pacaud <emmanuel gnome org>
Date: Sun May 16 00:29:53 2010 +0200
tests: test trigger feature in fake.
src/arvfakecamera.h | 5 +++++
src/tests/fake.c | 37 +++++++++++++++++++++++++++++++++++++
2 files changed, 42 insertions(+), 0 deletions(-)
---
diff --git a/src/arvfakecamera.h b/src/arvfakecamera.h
index 850be96..c49b5c5 100644
--- a/src/arvfakecamera.h
+++ b/src/arvfakecamera.h
@@ -43,6 +43,11 @@ G_BEGIN_DECLS
/* Acquisition control */
+#define ARV_FAKE_CAMERA_REGISTER_TRIGGER_OFFSET 0x020
+
+#define ARV_FAKE_CAMERA_REGISTER_TRIGGER_MODE 0x300
+#define ARV_FAKE_CAMERA_REGISTER_TRIGGER_SOURCE 0x304
+#define ARV_FAKE_CAMERA_REGISTER_TRIGGER_ACTIVATION 0x308
#define ARV_FAKE_CAMERA_REGISTER_ACQUISITION 0x124
#define ARV_FAKE_CAMERA_REGISTER_EXPOSURE_TIME_US 0x120
diff --git a/src/tests/fake.c b/src/tests/fake.c
index 01c7299..47791ea 100644
--- a/src/tests/fake.c
+++ b/src/tests/fake.c
@@ -16,6 +16,42 @@ load_fake_camera_genicam_test (void)
}
static void
+trigger_registers_test (void)
+{
+ ArvDevice *device;
+ ArvGc *genicam;
+ ArvGcNode *node;
+ gint64 address;
+
+ device = arv_fake_device_new ("TEST0");
+ g_assert (ARV_IS_FAKE_DEVICE (device));
+
+ genicam = arv_device_get_genicam (device);
+ g_assert (ARV_IS_GC (genicam));
+
+ node = arv_gc_get_node (genicam, "TriggerModeRegister");
+ g_assert (ARV_IS_GC_NODE (node));
+
+ address = arv_gc_register_get_address (ARV_GC_REGISTER (node));
+ g_assert_cmpint (address, ==, ARV_FAKE_CAMERA_REGISTER_TRIGGER_MODE);
+
+ address = arv_gc_register_get_address (ARV_GC_REGISTER (arv_gc_get_node (genicam,
+ "TriggerSourceRegister")));
+ g_assert_cmpint (address, ==, ARV_FAKE_CAMERA_REGISTER_TRIGGER_SOURCE);
+
+ address = arv_gc_register_get_address (ARV_GC_REGISTER (arv_gc_get_node (genicam,
+ "TriggerActivationRegister")));
+ g_assert_cmpint (address, ==, ARV_FAKE_CAMERA_REGISTER_TRIGGER_ACTIVATION);
+
+ arv_device_set_string_feature_value (device, "TriggerSelector", "AcquisitionStart");
+
+ address = arv_gc_register_get_address (ARV_GC_REGISTER (node));
+ g_assert_cmpint (address, ==, ARV_FAKE_CAMERA_REGISTER_TRIGGER_MODE + ARV_FAKE_CAMERA_REGISTER_TRIGGER_OFFSET);
+
+ g_object_unref (device);
+}
+
+static void
fake_device_test (void)
{
ArvDevice *device;
@@ -73,6 +109,7 @@ main (int argc, char *argv[])
arv_set_fake_camera_genicam_filename (GENICAM_FILENAME);
g_test_add_func ("/fake/load-fake-camera-genicam", load_fake_camera_genicam_test);
+ g_test_add_func ("/fake/trigger-registers", trigger_registers_test);
g_test_add_func ("/fake/fake-device", fake_device_test);
return g_test_run();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]