[aravis] tests: add the beginning of genicam tests.
- From: Emmanuel Pacaud <emmanuel src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [aravis] tests: add the beginning of genicam tests.
- Date: Wed, 28 Apr 2010 14:22:53 +0000 (UTC)
commit 1f4e6e170d101807aa601bcd3e97a7736f87ec0d
Author: Emmanuel Pacaud <emmanuel gnome org>
Date: Wed Apr 28 16:22:24 2010 +0200
tests: add the beginning of genicam tests.
src/tests/.gitignore | 1 +
src/tests/Makefile.am | 7 +++-
src/tests/genicam.c | 41 ++++++++++++++++++++++++
src/tests/genicam.xml | 82 +++++++++++++++++++++++++++++++++++++++++++++++++
4 files changed, 130 insertions(+), 1 deletions(-)
---
diff --git a/src/tests/.gitignore b/src/tests/.gitignore
index 23e24ca..022518c 100644
--- a/src/tests/.gitignore
+++ b/src/tests/.gitignore
@@ -1 +1,2 @@
evaluator
+genicam
diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am
index d2c52ca..73ad240 100644
--- a/src/tests/Makefile.am
+++ b/src/tests/Makefile.am
@@ -4,6 +4,11 @@ INCLUDES = -g -I$(top_srcdir)/src/ $(ARAVIS_CFLAGS)
noinst_PROGRAMS = $(TEST_PROGS)
-TEST_PROGS += evaluator
+TEST_PROGS += evaluator genicam
+
evaluator_SOURCES = evaluator.c
evaluator_LDADD = $(ARAVIS_LIBS) $(top_builddir)/src/libaravis.la
+
+genicam_SOURCES = genicam.c
+genicam_CFLAGS = -DGENICAM_FILENAME="\"$(srcdir)/genicam.xml\""
+genicam_LDADD = $(ARAVIS_LIBS) $(top_builddir)/src/libaravis.la
diff --git a/src/tests/genicam.c b/src/tests/genicam.c
new file mode 100644
index 0000000..22fef11
--- /dev/null
+++ b/src/tests/genicam.c
@@ -0,0 +1,41 @@
+#include <glib.h>
+#include <arv.h>
+
+static void
+load_genicam_test (void)
+{
+ ArvGc *genicam;
+ ArvGcNode *node;
+ char *genicam_data;
+ size_t genicam_data_size;
+
+ g_file_get_contents (GENICAM_FILENAME, &genicam_data, &genicam_data_size, NULL);
+ g_assert (genicam_data != NULL);
+
+ genicam = arv_gc_new (NULL, genicam_data, genicam_data_size);
+ g_assert (ARV_IS_GC (genicam));
+
+ node = arv_gc_get_node (genicam, "AcquisitionStart");
+ g_assert (ARV_IS_GC_COMMAND (node));
+
+ node = arv_gc_get_node (genicam, "Unknown");
+ g_assert (!ARV_IS_GC_COMMAND (node));
+
+ g_object_unref (genicam);
+
+ g_free (genicam_data);
+}
+
+int
+main (int argc, char *argv[])
+{
+ int i;
+
+ g_test_init (&argc, &argv, NULL);
+
+ g_type_init ();
+
+ g_test_add_func ("/genicam/load-genicam", load_genicam_test);
+
+ return g_test_run();
+}
diff --git a/src/tests/genicam.xml b/src/tests/genicam.xml
new file mode 100644
index 0000000..b7d5daf
--- /dev/null
+++ b/src/tests/genicam.xml
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="utf-8"?>
+
+<RegisterDescription
+ ModelName="Model"
+ VendorName="Aravis"
+ StandardNameSpace="None"
+ SchemaMajorVersion="1"
+ SchemaMinorVersion="0"
+ SchemaSubMinorVersion="0"
+ MajorVersion="292"
+ MinorVersion="0"
+ SubMinorVersion="0"
+ ToolTip="TestTooltip"
+ ProductGuid="111-222"
+ VersionGuid="222-333"
+ xmlns="http://www.genicam.org/GenApi/Version_1_0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://www.genicam.org/GenApi/Version_1_0 GenApiSchema.xsd">
+ <Category Name="Root" NameSpace="Standard">
+ <pFeature>AcquisitionControl</pFeature>
+ </Category>
+
+ <Category Name="AcquisitionControl" NameSpace="Custom">
+ <pFeature>AcquisitionStart</pFeature>
+ <pFeature>AcquisitionStop</pFeature>
+ </Category>
+
+ <Command Name="AcquisitionStart" NameSpace="Standard">
+ <Description>Start acquisition. Before image acquisition can occur, acquisition must be started, either by a hardware trigger or this software command.</Description>
+ <pValue>RegAcquisitionCommand</pValue>
+ <CommandValue>1</CommandValue>
+ </Command>
+
+ <Command Name="AcquisitionStop" NameSpace="Standard">
+ <Description>Stop acquisition. Acquisition will stop after acquisition of the current frame is complete.</Description>
+ <pValue>RegAcquisitionCommand</pValue>
+ <CommandValue>0</CommandValue>
+ </Command>
+
+ <IntReg Name="RegAcquisitionCommand" NameSpace="Custom">
+ <Address>0x130F4</Address>
+ <Length>4</Length>
+ <AccessMode>WO</AccessMode>
+ <pPort>Device</pPort>
+ <Sign>Unsigned</Sign>
+ <Endianess>BigEndian</Endianess>
+ </IntReg>
+
+ <IntReg Name="RegPixelFormat" NameSpace="Custom">
+ <Address>0x12120</Address>
+ <Length>4</Length>
+ <AccessMode>RW</AccessMode>
+ <pPort>Device</pPort>
+ <pInvalidator>BinningHorizontal</pInvalidator>
+ <pInvalidator>BinningVertical</pInvalidator>
+ <Sign>Unsigned</Sign>
+ <Endianess>BigEndian</Endianess>
+ </IntReg>
+
+ <IntReg Name="RegWhitebalValueMax" NameSpace="Custom">
+ <Address>0x1418C</Address>
+ <Length>4</Length>
+ <AccessMode>RW</AccessMode>
+ <pPort>Device</pPort>
+ <Sign>Unsigned</Sign>
+ <Endianess>BigEndian</Endianess>
+ </IntReg>
+
+ <IntSwissKnife Name="IntWidthIncrement" NameSpace="Custom">
+ <pVariable Name="FORMAT">RegPixelFormat</pVariable>
+ <Formula>((FORMAT=35127328) || (FORMAT=34603039) || (FORMAT=34340894)) ? 4 : 1</Formula>
+ </IntSwissKnife>
+
+ <SwissKnife Name="WhitebalValueMin" NameSpace="Custom">
+ <pVariable Name="VALUE">RegWhitebalValueMin</pVariable>
+ <Formula>(VALUE / 100)</Formula>
+ </SwissKnife>
+
+ <Port Name="Device" NameSpace="Standard">
+ </Port>
+
+</RegisterDescription>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]